Site Administration Page 5 - Setting Up Database Driven Websites |
With Apache installed and working, let's now turn our attention to PHP. Assuming you downloaded it to /tmp, let's get to work on it (you don't need to be root yet):
This configures PHP to compile itself as an Apache DSO module. Configuration files are to be stored in /etc/httpd (along with your Apache configuration files). After running that configure script, you can build PHP by running make:
If that completed without errors, you will have to su to root and install PHP:
Voila, PHP is magically installed into Apache, it will get enabled next time Apache is started. Configuring PHPLet's configure PHP, start by copying the PHP configuration file into /etc/httpd.
The defaults in this file are good enough, but I like the debug messages to be more verbose. Change the error_reporting directive from the default value of 7 to 15:
You can now start Apache again by running:
No errors means it started up with PHP enabled. Everything working so far? Excellent! Let's do a quick little test page with PHP to make sure it is indeed working. Testing PHPCreate a file in /home/httpd/htdocs called test.php3:
Save this file, and try to load it up from your web browser. For example:
You should see a page come up with the words Hello World. Now let's get started with a simple web database sample.
blog comments powered by Disqus |