Apache / PHP installation/configuration Problems
Posted by Chris_Isaac (Chris Isaac), 16 November 2005Hi
I'm having a bit of a problem with my home setup. I've installed Apache and PHP, both seem to be working but if I try to view a PHP page it just prints out the source to screen, eg <?php phpinfo(); ?> just prints that on screen.
I tried adding the following lines to the http.conf file:
but that brings up a window message box "do you want to save this file"
ANy ideas where I'm going wrong.
PS. I'm using v2.0.55 Apache and PHP 4.4.1
Posted by admin (Graham Ellis), 16 November 2005I'm guessing that either you've not installed your PHP where Apache can see it, or you've not restarted the server, or the files you've uploaded have something like at extra .txt on the end of them (notepad and wordpad are very good at doing this). I would probably check the first option out first - a careful look through the PHP installation notes and check that everything's in the right place.
Posted by Chris_Isaac (Chris Isaac), 16 November 2005Thanks for the reply Graham. I've definately restarted the server, and I'm using EditPlus, and its not appending any .txt to the end.
I put php in the standard path, ie, c:/php. How/where do I tell apache where it is. I looked on the installation notes and it said the PHP part would be commented out, I did a search on php in the document (http.conf)and there was no trace of it. Is there a particular part of the file where I need to put the AddType.... bits?
Posted by Custard (Custard), 16 November 2005Hi, I'm no php expert, but my httpd.conf also has:
Which appears to tell apache which module to use.
Posted by Chris_Isaac (Chris Isaac), 17 November 2005Nope, my http.conf dosen't have any statement with php in it, I'll try downloading apache again, perhaps v1 and see if that helps.
Thanks for the reply guys.
Posted by Chris_Isaac (Chris Isaac), 17 November 2005I've now downloaded V1.3.33 (think it was that one anyway its close )
No difference, the php still only shows as the source. I had a look at the http.conf file, and there is still no reference to any PHP statement.
Is it ok for me to just add it anywhere?
Posted by Chris_Isaac (Chris Isaac), 18 November 2005I kinda got it working now, at least if the file is located directly in c:/Program Files/Apache Group/Apache2/htdocs then it works fine, but any file in a directory under that it comes up with cannot find file Any ideas why this is happening?
PS, to get it to work I added the following:
Posted by Chris_Isaac (Chris Isaac), 23 November 2005Got it working
I added the following to httpd.conf to configure apache as a sapi module, also added c:/php to my path and that seems to have fixed it :
Think the above was suggested by Custard so thanks for that, and thank you Graham for your responses.
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: email@example.com • WEB: http://www.wellho.net • SKYPE: wellho