///Installing PHP on Apache 1

Installing PHP on Apache 1

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.

2010-05-26T09:46:40+00:00 June 23rd, 2005|PHP|0 Comments

About the Author:

Brandon is a young web developer who puts emphasis in new web standards
and all the best practices.  Working mostly in open source projects of
his own, he has come to a great understanding with PHP, and helps others
to reach an understanding of their own.

Over the years as a web developer and software tinkerer, he has learned
new ways to overcome previously impossible tasks and still learns with
every large project.  He considers the web a constantly changing
environment, and has adapted to fit it.

Leave A Comment