Click to See Complete Forum and Search --> : [Resolved] Apache2 displaying PHP5 source code


demetri007
06-18-2005, 06:24 PM
I installed Apache2, PHP5, openssl, Mysql4.1 all from src(except MySql=>RPM). The problem I am having is with PHP ( well I think anyway ). When I start Apache it loads php without error, but when I point Firefox to localhost/test.php which contains

<?php phpinfo(); ?>

,its displayed rather than executed.

Any Ideas, been beating my head for two days with this. I am able to connect to mysql with out a problem also and openssl loads with out error.

Thanks Demetri

planetsim
06-18-2005, 06:56 PM
Make sure the following is present in the httpd.conf file


LoadModule php5_module libexec/libphp5.so
AddType application/x-httpd-php .php


To do so you can use grep


grep AddType /path/to/httpd.conf


Than just check that the php5_module is listed do the same with AddType.

demetri007
06-18-2005, 09:38 PM
I am sorry, what you stated was my first problem. the problem I am having when I point to http:/localhost/phpinfo.php is it asks me if I would like to download the file instead of viewing. I should have also stated I am on Suse 9.1 and apache2 and php5 are installed in /usr/local/lib from src. Apache loads the php module with out error(I dont see any errors in the logs). I also made sure by entering an incorrect path to the module and restarting apache which did display and error. The server also has no problem with HTML files. Here are links to my httpd.config and php.ini files.

httpd.config (http://leapingloot.com/httpd.html)


php.ini (http://leapingloot.com/phpini.html)




I hope you see something I dont. My NIC has IP 192.168.1.252.

Thanks for your help
Demetri

demetri007
06-19-2005, 03:31 PM
OK got it working. I had placed the AddType... statement at the wrong location. To correct the error, I placed it at the last line of the httpd.config file. All is well now.

Thanks for the help
Demetri