[arch-general] New install configuring php - only get text - feeling stupid -- help!
Guys, I can't believe this. On my new arch install on my laptop, I'm finally getting around to configuring the web server and I am having trouble with php. When I try and access a php page, all I get is the text of the script echoed to the browser. I have heard about this happening before and I think I have even fixed it before, but I can't for the life of me remember how? I've been through the wiki at: http://wiki.archlinux.org/index.php/LAMP I have the following loaded: php 5.3.1-2 php-apache 5.3.1-2 php-curl 5.3.1-2 php-docs 5.3.0-1 php-enchant 5.3.1-2 php-gd 5.3.1-2 php-gmp 5.3.1-2 php-intl 5.3.1-2 php-ldap 5.3.1-2 php-mcrypt 5.3.1-2 php-odbc 5.3.1-2 php-pear 5.3.1-2 php-pgsql 5.3.1-2 php-pspell 5.3.1-2 php-snmp 5.3.1-2 php-sqlite 5.3.1-2 php-tidy 5.3.1-2 php-xsl 5.3.1-2 My php config in httpd.conf is: LoadModule php5_module modules/libphp5.so DirectoryIndex index.php index.html index.htm Include conf/extra/php5_module.conf I've configured php and php works from the command line just fine and will dump phpinfo() to a terminal, but from my browser pointed at: http://localhost/dcr/phpinfo.php all I get is: "<?php phpinfo(); ?>" (no quotes) which is nothing more than the content of my test script. I have also configured php.ini with the proper: open_basedir =.:/srv/http:/usr/share/pear:/home:/tmp:/var/lib/egroupware <snip> include_path = ".:/srv/http/secure:/srv/http/htdocs:/srv/http/dl:/usr/share/pear:/srv/http" to accomadate the php include and defined the directory to /dcr. In fact I can browse /dcr just fine, but clicking on the phpinfo() script just returns the text of the script like all my other pages. What's the trick? (yes, I've stopped and restarted httpd...) -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
On Mon, Nov 23, 2009 at 11:59 PM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
Guys,
I can't believe this. On my new arch install on my laptop, I'm finally getting around to configuring the web server and I am having trouble with php. When I try and access a php page, all I get is the text of the script echoed to the browser. I have heard about this happening before and I think I have even fixed it before, but I can't for the life of me remember how? I've been through the wiki at:
http://wiki.archlinux.org/index.php/LAMP
I have the following loaded:
php 5.3.1-2 php-apache 5.3.1-2 php-curl 5.3.1-2 php-docs 5.3.0-1 php-enchant 5.3.1-2 php-gd 5.3.1-2 php-gmp 5.3.1-2 php-intl 5.3.1-2 php-ldap 5.3.1-2 php-mcrypt 5.3.1-2 php-odbc 5.3.1-2 php-pear 5.3.1-2 php-pgsql 5.3.1-2 php-pspell 5.3.1-2 php-snmp 5.3.1-2 php-sqlite 5.3.1-2 php-tidy 5.3.1-2 php-xsl 5.3.1-2
My php config in httpd.conf is:
LoadModule php5_module modules/libphp5.so DirectoryIndex index.php index.html index.htm Include conf/extra/php5_module.conf
I've configured php and php works from the command line just fine and will dump phpinfo() to a terminal, but from my browser pointed at:
http://localhost/dcr/phpinfo.php
all I get is: "<?php phpinfo(); ?>" (no quotes) which is nothing more than the content of my test script. I have also configured php.ini with the proper:
open_basedir =.:/srv/http:/usr/share/pear:/home:/tmp:/var/lib/egroupware <snip>
include_path = ".:/srv/http/secure:/srv/http/htdocs:/srv/http/dl:/usr/share/pear:/srv/http"
to accomadate the php include and defined the directory to /dcr. In fact I can browse /dcr just fine, but clicking on the phpinfo() script just returns the text of the script like all my other pages.
What's the trick?
(yes, I've stopped and restarted httpd...)
The only thing I can think of is that you've placed the Include line before the other LoadModule directives. If you look at /etc/httpd/conf/extra/php5_module.conf, it checks if mod_dir (and mod_php) is loaded before applying its directives.
On Monday 23 November 2009 16:12:49 and regarding:
What's the trick?
(yes, I've stopped and restarted httpd...)
The only thing I can think of is that you've placed the Include line before the other LoadModule directives. If you look at /etc/httpd/conf/extra/php5_module.conf, it checks if mod_dir (and mod_php) is loaded before applying its directives.
Hmm... I've got it working now and I don't really know what I did to get it working :-( I didn't add or changee any of the includess, but I did clean up an unrealated path or two in httpd.conf. I had one path definedd to a "download" directory that had been movedd to a "dl" directory but I don't see how that could have been the problem. I had added additiional modulles as well, but then I backed all of the module changes out and php conntinued to work?? I still have a few places in my pages to change a download to dl, but that is the only thing I can see that could have caused the problem. I'll keep my ouigi board handy in case it happens again! -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
It's either not loading the module (since extra/php5_module.conf depends on it), OR you're missing the AddType lines like these: AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps But most likely php5_module.conf should be handling the addtypes. On Mon, Nov 23, 2009 at 5:56 PM, David C. Rankin <drankinatty@suddenlinkmail.com> wrote:
On Monday 23 November 2009 16:12:49 and regarding:
What's the trick?
(yes, I've stopped and restarted httpd...)
The only thing I can think of is that you've placed the Include line before the other LoadModule directives. If you look at /etc/httpd/conf/extra/php5_module.conf, it checks if mod_dir (and mod_php) is loaded before applying its directives.
Hmm... I've got it working now and I don't really know what I did to get it working :-(
I didn't add or changee any of the includess, but I did clean up an unrealated path or two in httpd.conf. I had one path definedd to a "download" directory that had been movedd to a "dl" directory but I don't see how that could have been the problem. I had added additiional modulles as well, but then I backed all of the module changes out and php conntinued to work??
I still have a few places in my pages to change a download to dl, but that is the only thing I can see that could have caused the problem. I'll keep my ouigi board handy in case it happens again!
-- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com
participants (4)
-
Damjan Georgievski
-
David C. Rankin
-
Evangelos Foutras
-
Trav