...

View Full Version : Installing php 4 on winxp with apache



stovio
04-10-2003, 09:24 AM
I have some problem installing php 4.3.1 on winxp with an apache 1.3.27 web server. Apache seems to work fine (i installed it just now as well), i can see the default index.html file from htdocs by the url http://localhost. When i try accessing http://localhost/phpinfo.php (a file located in C:\Apache\htdocs containing only "<? phpinfo() ?>" i fail however. The apache error message is "Not Found. The requested URL /php4/php.exe/phpinfo.php was not found on this server."

php.exe, php4ts.dll and php4apache.dll is located at C:\php4\php-4.3.1-Win32. The tutorial im following suggested moving php4ts.dll and a file named Msvcrt.dll to the windows\system directory. I couldn't find Msvcrt.dll and the install.txt file included in the php package did not mention it. It also suggested that i let php4ts.dll stay in the /PHP4/ directory and copied php4apache.dll there from the sapi directory, so i did.

I renamed the php.ini-dist file to php.ini, moved it to c:\windows made these changes:
extension_dir = "C:\php4\php-4.3.1-Win32"

I have added these changes to the apache\conf\httpd.conf file:

ScriptAlias /php4/ "C:/php4/php-4.3.1-Win32"

AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

Action application/x-httpd-php /php4/php.exe

All changes has been made acording to a tutorial i'm following. What might be wrong? The url submitted by apache in its error message looks a bit odd i think. /php4/php.exe/phpinfo.php is of course not a correct path or is it written like that to indicate that phpinfo.php is interpreted by php.exe?

I'm thankfull for any help.

duniyadnd
04-10-2003, 12:30 PM
try using nusphere to take care of the installation for you.

http://www.nusphere.com/

Duniyadnd

firepages
04-10-2003, 01:20 PM
php works best as an apache module, you are configuring as a CGI

in your httpd.conf (at the end (& delete the the other stuff)) add these lines ...

LoadModule php4_module C:/php4/php-4.3.1-Win32/sapi/php4apache.dll
AddType application/x-httpd-php .php4 .php .htm .php3
AddType application/x-httpd-php-source .phps

make sure you have php4apache.dll and php4ts.dll in either
C:/php4/php-4.3.1-Win32/sapi/

or in (above is better)

C:/windows(winnt?)/system32

make sure php.ini is in c:\ (or whatever your system root is) and make sure the extension directory matches your path to php-4.3.1-Win32/extensions

restart apache (if its apache2 you need php4apache2.dll) & you should be fine.

Dont worry about Msvcrt.dll , you almost certainly have it somewhere and it will already be in your PATH.

stovio
04-10-2003, 02:05 PM
Thanks! It seems to work fine now.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum