newbie configuration question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mgould
Forum Newbie
Posts: 2
Joined: Mon Jul 15, 2002 9:22 pm

newbie configuration question

Post by mgould »

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.
Patriot
Forum Commoner
Posts: 34
Joined: Tue Jun 18, 2002 1:36 pm

Post by Patriot »

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 :)
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

Had a look at the install instuctions for PHP on Apache, are the following lines in your httpd.conf and uncommented:

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"
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
mgould
Forum Newbie
Posts: 2
Joined: Mon Jul 15, 2002 9:22 pm

Post by mgould »

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). :oops:

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.
Post Reply