Database Articles

  Home arrow Database Articles arrow Page 5 - Create dynamic sites with PHP & MySQL
DATABASE ARTICLES

Create dynamic sites with PHP & MySQL
By: Codewalkers
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 54
    2002-05-19

    Table of Contents:
  • Create dynamic sites with PHP & MySQL
  • Introduction and installation
  • Installing Apache server routines
  • Installing MySQL
  • Installing PHP
  • Your first script
  • Your first database
  • Where's my view?
  • Creating an HTML form
  • Putting it together
  • Passing variables
  • Viewing individual rows
  • Deleting rows
  • Editing data
  • Searching our data
  • Tips for common tasks

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    advertisement

    Create dynamic sites with PHP & MySQL - Installing PHP


    (Page 5 of 16 )

    We will follow a similar procedure to install PHP. Download and save the source from the PHP site to /tmp/ src:

    # cd /tmp/ src/ 
    # gunzip -dc php-x.x.xx.tar.gz | tar xv 
    # cd php-x.x.xx 
    # ./configure --with-mysql=/usr/local/mysql --with-apxs=/usr/local/apache/bin/apxs 
    # make 
    # make install

    Copy the ini file to the proper directory:

    # cp php.ini-dist /usr/local/lib/php.ini

    Open httpd. conf in your text editor (probably located in /usr/local/apache/conf directory), and find a section that looks like the following:

    # And for PHP 4. x, use: 

    #AddType application/x-httpd-php .php 
    #AddType application/x-httpd-php-source .phps

    Just remove those #s before the AddType line so that it looks like:

    # And for PHP 4. x, use: 

    AddType application/x-httpd-php .php .phtml 
    AddType application/x-httpd-php-source .phps

    Save your file and restart apache:

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

    Then test whether you have PHP installed properly. Type the following code in a text editor and save it as test. php in a directory accessible by your Web server:

    <HTML> 
    <?php 
    phpinfo(); 
    ?> 
    </HTML>

    Set the permission of the file to executable by typing at console chmod 775 test. php, and then view it with your browser. You should see a detailed description of the environment variables in PHP similar to the image below. If you don't, then PHP was not installed properly. Try reinstalling it. Make sure there is a section "MySQL" in the php info; if not, MySQL connectivity will not work.

    More Database Articles Articles
    More By Codewalkers

    blog comments powered by Disqus

    DATABASE ARTICLES ARTICLES

    - Completing a Book Inventory Management System
    - Uploading Images for a Book Inventory Manage...
    - Finishing the Add Book Story for a Book Inve...
    - Integration Testing for a Book Inventory Man...
    - User Stories for a Book Inventory Management...
    - Unit Testing a Book Inventory Management Sys...
    - Testing a Book Inventory Management System
    - Implementing Models for a Book Inventory Man...
    - Book Inventory Application: Publishers and B...
    - Handling Publishers in a Book Inventory Mana...
    - Publisher Administration for Book Inventory ...
    - Book Inventory Management
    - Using the SQL Reference Manual
    - Using Oracle SQL Developer with SQL Statemen...
    - Fixing Errors with Oracle SQL Developer


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 8 - Follow our Sitemap