PHP set up, but cannot run PHP files!

Forum for you who has PHP installation issues

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 7
Joined: Sun Jan 09, 2005 6:21 pm
Location: Australia

Sat Jan 22, 2005 3:43 pm

I'm a newbie, so I understand very little technical jargon....

I've just installed Apache version 2.0.49. It took me a long time to understand the concept and then get it working, but I finally did.

I next installed PHP version 4.3.7 from an executable file. I copied the php.ini-dist file from the C:/PHP folder to C:/Windows, and renamed it as php.ini I then edited it to the following:

doc_root = "C:/Program Files/Apache/Apache2/htdocs"

user_dir = "C:/PHP"

I then copied the php4ts.dll to the C:/PHP/sapi folder.

I restarted the Apache server several times in the process, and it restarted with no apparent error.

Next, I inserted the following code into the Apache2/conf/httpd.conf file:

#add PHP capabilities
LoadModule php4_module "C:/PHP/sapi/php4apache2.dll"
AddType application/x-httpd-php .php

despite having been confused by three different theories about what code should be added to the httpd.conf file.

I then restarted the server; it was fine. Next I visited http://localhost, and it acknowledges that it is now a PHP server:

Apache/2.0.49 (Win32) PHP/4.3.7 Server at localhost Port 80

Yet, when I create a file in notepad, containing the phpinfo(); code, and save it as test.php in the htdocs folder I specified in the httpd.conf file, it will only open as either a Notepad file with the code, or as an Internet Explorer page with the code showing.

On the http://localhost page, it acknowledges this test file as:


Any suggestions? Should I be using a different httpd.conf code? Should I uninstall and reinstall? Should I be using different versions of Apache / PHP? All help is much appreciated, thank you!
Grace Adair

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2213
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Sat Jan 22, 2005 3:46 pm

Thats a general installation proccedures both for windows and *nix..

take a look... we have some very usedull sticky's on all forums..
Best Regards,
Alexej Kubarev
Zend Certified Engineer
Image Image

User avatar
Posts: 1240
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol

Tue Jan 25, 2005 6:18 am

add to apache config file this but after including php dll's

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";

Post Reply