Training, Open Source computer languages

This is page http://www.wellho.net/forum/Other-issues/Apache-P ... blems.html

Our email: info@wellho.net • Phone: 01144 1225 708225

 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Apache / PHP installation/configuration Problems

Posted by Chris_Isaac (Chris Isaac), 16 November 2005
Hi

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:
Code:
AddType application/x-httpd-php .php .php4
AddType application/x-httpd-php-source .phps


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 2005
I'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 2005
Thanks 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?

Thanks

Chris

Posted by Custard (Custard), 16 November 2005
Hi, I'm no php expert, but my httpd.conf also has:

Code:
LoadModule php5_module        modules/libphp5.so


Which appears to tell apache which module to use.
HTH

B

Posted by Chris_Isaac (Chris Isaac), 17 November 2005
Nope, 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 2005
I'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 2005
I 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:

Code:
ScriptAlias /php/ "C:/PHP/"
AddType application/x-httpd-php .php .php4

# For PHP 4
Action application/x-httpd-php "/php/php.exe"



Posted by Chris_Isaac (Chris Isaac), 23 November 2005
Got 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 :
Code:

LoadModule php4_module c:/php/sapi/php4apache2.dll
AddType application/x-httpd-php .php .php4


Think the above was suggested by Custard so thanks for that, and thank you Graham for your responses.



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho