Developer Blog

You are currently browsing the archives for the PHP in General category.


Archive for the 'PHP in General' Category

Detailed Step-wise Instructions to Setup PHP Development Environment on Windows XP PC

Wednesday, April 25th, 2007

Software must be installed in the following order:

  1. MySQL 4.1.22
  2. PHP 5.2.2
  3. Apache HTTP Server 2.2.2
  4. phpMyAdmin 2.6.4

Download MySQL 4.1.22 from http://dev.mysql.com/downloads/mysql/4.1.html#win32

Installing MySQL

Step I: Click Next

MySQL Installation

Step II: Select Setup Type and click Next

MySQL Installation

Step III: Click Install

MySQL Installation

Step IV: Select account type

MySQL Installation

Step V: Click Finish to exit and select Configure the MySQL Server now to configure MySQL

MySQL Installation

Step VI: Click Next to continue

MySQL Installation

Step VII: Select configuration type and click Next to continue

MySQL Installation

Step VIII: Select server type and click Next to continue

MySQL Installation

Step IX: Select database usage

MySQL Installation

Step X: Choose the drive and directory for the InnoDB datafile and click Next to continue

MySQL Installation

Step XI: Set the approximate number of concurrent connections to the server and click Next to continue

MySQL Installation

Step XII: Set the networking options and click Next

MySQL Installation

Step XIII: Select the default charset and click Next

MySQL Installation

Step XIV: Set the Windows options and click Next

MySQL Installation

Step XV: Enter the root password and click Next

MySQL Installation

Step XVI: Click Finish to close the Wizard

MySQL Installation

Download PHP 5.2.2 from http://www.php.net/downloads.php

Installing PHP

  1. Create a directory php on your computer under “C:\”
  2. Unzip the downloaded contents and put it all in “C:\php”

Configuring PHP

  1. After the contents have been unzipped,
    1. Copy php5apache2.dll, php5ts.dll and libmysql.dll (available under “C:\php”) into your “C:\WINDOWS\system”
    2. Copy php5ts.dll (available under “C:\php”) into your “C:\WINDOWS”
  2. Rename php.ini-recommended (available under “C:\php”) to php.ini and open it using an ASCII text editor such as Notepad
    1. In line no. 513, change doc_root = to doc_root = “your directory”, the directory out of which you will serve your PHP pages.
    2. In line no. 520, change extension_dir = to extension_dir = “C:\php\ext”, the directory in which the loadable extensions (modules) reside.
    3. In line no. 651, uncomment extension=php_mysql.dll

Download Apache HTTP Server 2.2.2 from http://archive.apache.org/dist/httpd/binaries/win32/apache_2.2.2-win32-x86-no_ssl.msi

Installing Apache

Step I: Click Next

Apache Installation

Step II: Select “I accept the terms in the license agreement” and click Next

Apache Installation

Step III: Enter server information and click Next

Apache Installation

Step IV: Select setup type and click Next

Apache Installation

Step V: Select folder to install and click Next

Apache Installation

Step VI: Click Install to begin installation

Apache Installation

Step VII: Click Finish to exit the wizard

Apache Installation

Configuring Apache

  1. Under “C:\Program Files\Apache Software Foundation\Apache2.2\conf” open httpd file (text document) using an ASCII text editor such as Notepad
    1. In line no. 149, change DocumentRoot “” to DocumentRoot “your directory”, the directory out of which you will serve your documents.
    2. In line no. 177, change Directory “” to Directory “directory already set in DocumentRoot”
    3. Add the following code at the end of the file
    4. LoadFile “C:/php/php5ts.dll”
      LoadModule php5_module “C:/php/php5apache2_2.dll”
      PHPIniDir “C:/php”
      AddType text/html .php .phps
      AddHandler application/x-httpd-php .php
      AddHandler application/x-httpd-php-source .phps

    5. In line no. 212, add DirectoryIndex index.html index.php to make sure that index.php or index.html will be picked up automatically by the server at start-up.

Download phpMyAdmin 2.6.4 from http://www.oldapps.com/download.php?oldappsid=phpMyAdmin-2.6.4-pl4.zip 

Installing phpMyAdmin

  1. Create a directory phpMyAdmin in your root directory
  2. Unzip the downloaded contents put it all in phpMyAdmin directory

Configuring phpMyAdmin

  1. Under phpMyAdmin folder open config.inc.php file using an ASCII text editor such as Notepad.
    1. In line no. 36, change $cfg[’PmaAbsoluteUri’] = ‘’; to $cfg[’PmaAbsoluteUri’] = ‘http://localhost/phpMyAdmin/’;
    2. In line no. 75, change $cfg[’Servers’][$i][’password’]= ‘’; to $cfg[’Servers’][$i][’password’]= ‘Your Database Password’; i.e., MySQL password

Add “C:\Program Files\MySQL\MySQL Server 4.1\bin;C:\php” to the Variable value

Steps to go to Variable value

  1. Right click My Computer icon
  2. Click Properties from the list shown
  3. Click Advanced tab
  4. Click Environment Variables
  5. Click Path and then Edit under the list of System variables shown
  6. Then add “C:\Program Files\MySQL\MySQL Server 4.1\bin;C:\php” in Variable value and click Ok

Before testing restart your computer. Create a PHP file with phpinfo(); as a function. Save the file as “phpinfo.php” into your root directory. Restart your Apache server so that it can read the new configuration directives you placed into httpd file (text document). Open your browser and type “http://localhost/phpinfo.php”. You should see information about your PHP setup.

Applications helpful to install are

  1. FF 2.0 .Download from http://www.firefox2.com/en/
  2. OpenOffice 2.2 .Download from http://download.openoffice.org/index.html
  3. FileZilla .Download from http://sourceforge.net/projects/filezilla/
  4. Putty SSH 0.59 .Download from http://www.softpedia.com/progDownload/PuTTY-Download-1001.html
  5. Crimson Editor 3.70 .Download from http://www.crimsoneditor.com/english/download.html

    Security in PHP Applications

    Sunday, November 5th, 2006

    Some of the important links are:

    1. http://phpsec.org/ – PHP Security Consortium
    2. PHP Security Mistakes
    3. PHP Security
    4. Top 7 security Blunder while using PHP

    First one is the most important one.

    Programming Mistakes And Avoid Them

    Sunday, November 5th, 2006

    Three important articles:

    1. http://www.zend.com/zend/art/mistake.php
    2. http://www.zend.com/zend/art/mistake1.php
    3. http://www.zend.com/zend/art/mistake2.php

     

    The PHP Development Tools

    Sunday, November 5th, 2006

    UML Design:
    There are two excellent freewares:Dia: http://www.gnome.org/projects/dia/This program helps in drawing class diagrams and has an extension to convert the class diagram into PHP code. However, the drawing functionality of this tool is very much limited to class diagrams.
    The other is AgroUML: http://argouml.tigris.org/

    Database Design and Administration:
    DB Designer: http://www.fabforce.net/dbdesigner4/
    This tool is indispensable for database modeling and maintenance. The database structure and schema can be designed and exported into MySQL DB. The existing database tables can be imported into this tool too. The saving format is XML.
    Other is the very popular PHPMyAdmin. The latest version offers many good features like stability in import and export functions and documentation and indexing utilities.
    MySQL AB also offers an utility for MySQL database administration; but it’s not stable as it’s an ALPHA release. The features looks promising however!

    Unit Testing in PHP:
    http://phpunit.sourceforge.net/
    Another hyperlink provides comprehensive details on the unit testing with PHP source code: Simple Test

    Documentation:
    PHP Documentator: http://www.phpdoc.org/
    This tool provides documentation tool for PHP source codes. This is also used to document Pear classes.
    A browser framework called PHPOBrowser (http://gogogadgetscott.info/computers/scripts/phpob.php) is used to scan the PHP classes and other source code in an aplication.

    Editors:
    There is studio application to develop large PHP applications. The leading one among them is Zend studio. Apart from this, there are good text editors like Crimson Editor (http://www.crimsoneditor.com/) and Vim - a GUI variant of most powerful text editor (http://www.vim.org/).

    Ion Cube PHP Accelerator: http://www.php-accelerator.co.uk/
    This tool is used for improving performance of PHP systems.

    Bug Tracking: Mantis (http://www.mantisbt.org/)

    Job Scheduler: http://www.thedemosite.co.uk/phpjobscheduler/
    Cron job handler through PHP Script

    NOTE: The software, documentation for each of the above is available on the corresponding Web site.

    Define World Wide Web

    Sunday, November 5th, 2006

    World Wide Web pertains to the hyper-world of electronic and optical communications where a set of commonly accepted protocols regulate the data transfer and interpretation. As of any other way of communications, the user perspective inspires the technological innovations, and similarly, the technical advancements greatly influence the user behaviour. This Web site makes effort to enact the frontier threads of this evolving field to provide the perspective of usability and innovations.

    Get Download Files Review Project Dashboard Know Plan And Wishlist