Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

configuring php w/apache

Status
Not open for further replies.

jain747

Technical User
Apr 22, 2003
17
US
I have apache working, but when I try to load php files onto apache it doesn't work for some reason. My extension_dir = C:\PHP and doc_root = C:\Program Files\Apache Group\Apache2\bin in the php.ini file which was copied into the Windows XP window folder. So does that mean I save .php files into the bin folder? I also copied the php4ts.dll file from the dlls folder to the cli folder. I've been following the install.txt instructions. If anyone can help, I'd appreciate it. Thanks
 
You need to also tell Apache how to handle files with the .php extension by editing Apache's config file. Open conf/httpf.conf. Do a search for these lines below. Some may be there but just be commented out (remove the # before the line). Others you may need to edit (like the first line below) to make them look similar to this, ie. be sure you add the php relevant bits...

# Tell Apache to recognize the index.php file if no
# other file has been specified
DirectoryIndex index.php index.html index.html.var

# Change the path to suit your setup. Tells Apache where
# the PHP engine lives (ie your php installation folder)
ScriptAlias /php/ "W:/Websites/php/"

# you only really need the first line below
# the rest are more specialized, you may not need them
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php-source .phps

# Tell Apache what to do when it encounters a .php
# file, in this case to hand it over to php.exe
Action application/x-httpd-php "/php/php.exe"

That should be about it. Remember to restart Apache after you save the changes. Or if it's just your development machine, turn Apache off then start it back up after you are done.

Hope this helps :)


The New Zealand Site
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top