I am currently trying to convert from CGI/perl/DBI/mySQL to PHP/mySQL and am having a problem installing PHP.
I am running Apache 1.3 on a Windows XP laptop. Installed PHP 4.2.1 as CGI and cannot get Apache to correctly deal with the .php extension.
I have a couple of O'Reilly books, read the config instructions under php.net and have scanned the 21 pages of this forum (nice forum by the way).
All of my investigation generally leads to the suggestion to assure that the following line is in my Apache httpd.conf file...
AddType application/x-httpd-php .php
Action application/x-httpd-php "c:/PHP/php-4.2.1-Win32/php.exe"
Any other suggestions or leads would be muchly appreciated.
Hefty thanks.
newbie configuration question
Moderator: General Moderators
another option if to install phpdev ( http://firepages.com.au/ ) with php, apache, cgi, and pearl already in it. it seems to work fine for me 
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Had a look at the install instuctions for PHP on Apache, are the following lines in your httpd.conf and uncommented:
and is c:/PHP/php-4.2.1-Win32/php.exe the actual path to where you've installed PHP? Have you restarted the server after making changes to the configuration file?
All of these you've probably checked but sometimes a commented out line can be missed or a path can be typed incorrectly.
Mac
Code: Select all
ScriptAlias /php/ "c:/PHP/php-4.2.1-Win32/php.exe"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"All of these you've probably checked but sometimes a commented out line can be missed or a path can be typed incorrectly.
Mac
Thanks for the suggestions. I have apache, cgi and perl currently working and would rather leave them if I can. I think I am close. If I direct the testPage.php to the executable it outputs the correct html which seem to indicat that at least the binaries came down intact.
The config lines twigletmac suggested match the ones in my httpd.conf.
Earlier I was getting the following error...
[Sat Jul 13 09:34:54 2002] [error] [client 169.254.101.152] (2)No such file or directory: script not found or unable to stat: c:/phpphp.exe/testpage.php
This error disappeared (apparently when I adjusted the configuration lines you sited).
I now get the following error in the error log...
[Tue Jul 16 21:35:53 2002] [error] [client 169.254.101.152] Invalid URI in request GET /testPage.php HTTP/1.1
Is this suggestive of an erroneous doc_root? Is it wise to have the .php and .html pages residing in the same directory?
Any other config settings I should examine.
Once again, thanks for your patience and help.
The config lines twigletmac suggested match the ones in my httpd.conf.
Earlier I was getting the following error...
[Sat Jul 13 09:34:54 2002] [error] [client 169.254.101.152] (2)No such file or directory: script not found or unable to stat: c:/phpphp.exe/testpage.php
This error disappeared (apparently when I adjusted the configuration lines you sited).
I now get the following error in the error log...
[Tue Jul 16 21:35:53 2002] [error] [client 169.254.101.152] Invalid URI in request GET /testPage.php HTTP/1.1
Is this suggestive of an erroneous doc_root? Is it wise to have the .php and .html pages residing in the same directory?
Any other config settings I should examine.
Once again, thanks for your patience and help.