HomeApache Page 6 - Getting Started with Apache 2.0, Part 1
PHP 5.0.3 with Apache 2.0.52 - Apache
In this first article in a three-part series, Harish Kamath helps you download and configure the Apache Web server. If you've wanted to use PHP with Apache, look no further; that part of the setup is also covered here.
If you are still looking to get your hands dirty with this combination, despite all my warnings and caveats - welcome aboard.
This is where you must run a quick check on your existing Apache installation: did you build it to load modules dynamically by specifying the "--enable-so" option? If not, quickly fire the following commands to get moving:
Note that I have not enabled many PHP libraries in the above "configure" command. If you plan to use them extensively, it would be wise to review the options that are listed at this URL: http://in.php.net/manual/en/configure.php, before moving ahead. Note that these options have been listed for PHP 4 compilation; however, they should work for PHP 5 also.
Now, you'll have to run the "make" and "make install" commands.
$ make install
Ready to rock-n-roll? Not so fast. There is still one last bit of configuration of the Apache Web server that enables it to identify PHP files and pass them to the PHP module for interpretation. This is only possible by editing the ubiquitous "httpd.conf" Apache configuration file in your favorite text editor and adding the following line:
AddType application/x-httpd-php .php
Now, you can re-start Apache using the "apachectl" script and load the following "phpinfo.php" script (saved in the root folder of the Web server) in a browser:
Instead of getting a screen full of cryptic error messages or warnings, if you get the following screen, rest assured that you have successfully installed PHP 5.0 with Apache 2.0.