Helping ordinary people create extraordinary websites!

Installing PHP on Apache 1

By Brandon Cash
2005-06-23

Installing PHP on Apache 1

Installing PHP on an Apache server is a lot easier than most people seem to think. It takes only a few minutes to do. Follow these easy instructions:

Open httpd.conf in your Apache's /conf directory. This file will be fairly long, as it contains all of the information to configure your server. Find the LoadModule section, where you need to add LoadModule php4_module PHP/sapi/php4apache.dll. After you load a module, you need to add it. This is done right below the LoadModule section, in the AddModule section. Add the line: AddModule mod_php4.c.

Now you get some choice. Do you want to make index.php open as an index? If so, you need to find <IfModule mod_dir.c> somewhere in your httpd.conf file. You'll see a line similar to DirectoryIndex index.html, where all you need to do is add "index.php" to the end: DirectoryIndex index.html index.php

Much further down in the file you can find the AddType section. Types define certain file extensions as filetypes. The application/x-httpd-php type is used to load PHP files. You can add this type by adding the line AddType application/x-httpd-php .php. If you need additional file extensions, just add them to the end: AddType application/x-httpd-php .php .html

You can also make a type for showing PHP source. Most people use the extension .phps for these files. The type is application/x-httpd-php-source: AddType application/x-httpd-php-source .phps

You're done! All you need to do now is restart your Apache server.





Tutorial pages:
  • Installing PHP on Apache 1
 1 Votes

You might also want to check these out:


Leave a Comment on "Installing PHP on Apache 1"
You must be logged in to post a comment.

Link to This Tutorial Page!


GET OUR NEWSLETTERS