Home arrow Site Administration arrow Page 5 - Setting Up Database Driven Websites

Installing PHP - Administration

This tutorial is an introductory guide to get you started in the world of server-side-scripting and web databases. It covers installation and configuration of MySQL, Apache, and PHP. An example script is also included as a guide for making your own server-side-scripts.

TABLE OF CONTENTS:
  1. Setting Up Database Driven Websites
  2. Requirements
  3. Installing MySQL
  4. Installing Apache
  5. Installing PHP
  6. Creating the Database
  7. Making a PHP Script
  8. Testing the Script
By: Ying Zhang
Rating: starstarstarstarstar / 17
May 20, 1999

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

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):


$ cd /tmp $ tar -zxvf php-3.0.7.tar.gz $ cd php-3.0.7 $ ./configure --with-apxs=/usr/local/apache/bin/apxs --with-config-file-path=/etc/httpd --with-mysql --with-system-regex

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:


$ make

If that completed without errors, you will have to su to root and install PHP:


$ su # make install

Voila, PHP is magically installed into Apache, it will get enabled next time Apache is started.

Configuring PHP

Let's configure PHP, start by copying the PHP configuration file into /etc/httpd.


# cp php3.ini-dist /etc/httpd/php3.ini

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:


error_reporting = 15

You can now start Apache again by running:


# /usr/local/apache/bin/apachectl start

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 PHP

Create a file in /home/httpd/htdocs called test.php3:


<html> <head> <title>My First PHP Page</title> </head> <body bgcolor=#ffffff> <? echo "Hello World"; ?> </body> </html>

Save this file, and try to load it up from your web browser. For example:


# lynx http://localhost/test.php3

You should see a page come up with the words Hello World. Now let's get started with a simple web database sample.



 
 
>>> More Site Administration Articles          >>> More By Ying Zhang
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SITE ADMINISTRATION ARTICLES

- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: