Administration
  Home arrow Administration arrow Page 5 - Setting Up Database Driven Websites
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ADMINISTRATION

Setting Up Database Driven Websites
By: Ying Zhang
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 12
    1999-05-20

    Table of Contents:
  • Setting Up Database Driven Websites
  • Requirements
  • Installing MySQL
  • Installing Apache
  • Installing PHP
  • Creating the Database
  • Making a PHP Script
  • Testing the Script

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    The Best Selling PC Migration Utility.
     
    ADVERTISEMENT

    Route your faxes to your email inbox. Private, secure fax numbers available from CallWave. Choose your fax number.

    Setting Up Database Driven Websites - Installing PHP
    (Page 5 of 8 )

    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 Administration Articles
    More By Ying Zhang


     

       

    ADMINISTRATION ARTICLES

    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization
    - Advanced Concepts on Dealing with Files and ...
    - Dealing with Files and Filesystems
    - More Hacks for the User Environment in BSD
    - Personalizing the User Environment in BSD
    - Customizing the User Environment in BSD

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway