Board index   FAQ   Search  
Register  Login
Board index PHP PHP Installation

PHP set up, but cannot run PHP files!

Forum for you who has PHP installation issues

Moderators: macek, egami, gesf

PHP set up, but cannot run PHP files!

Postby graciedee » 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:

test.php.txt

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!
graciedee
New php-forum User
New php-forum User
 
Posts: 7
Joined: Sun Jan 09, 2005 6:21 pm
Location: Australia

Postby Alexej Kubarev » Sat Jan 22, 2005 3:46 pm

http://www.php-forum.com/p/viewtopic.php?t=5572

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

take a look... we have some very usedull sticky's on all forums..
User avatar
Alexej Kubarev
Site Admin
Site Admin
 
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Re: PHP set up, but cannot run PHP files!

Postby WiZARD » 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
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol


Return to PHP Installation

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.