Nov 7, 2011

Installing PHP on Windows




Installing PHP on Windows

  1. Create a new folder called PHP in C: \ PHP
  2. Copy all the contents of the archives of php-5.2.6-win32.zip to C: \ PHP
  3. On the desktop, double click "My Computer" and select Properties tab
  4. In the dialog box of the properties of the system must select Advanced
  5. 1 Install php526 install PHP on Windows
  6. Click on the button Environment Variables.
  7.  php526 install 2 Install PHP on Windows
  8. In the dialog environment variables under system variables select Path
  9. php526 install 3 Installing PHP on Windows
  10. Click on the Edit button.
  11. In the edition of the variables of the system must add C: \ PHP to the field of variable.
  12. Click the OK button in all dialogs.

configuring php

  1. In the folder C: \ PHP, copy the file php.ini-recommended
  2. Rename the copy of php.ini-recommended to php.ini
  3. Open php.ini in the Windows Notepad.
  4. In the php.ini file, find these lines:
display_errors = Off
and enable the display of errors by changing the value to "On":
display_errors = On
Note: You should not use this option in production environments, this is only for testing and development areas.
  1. In the php.ini file, find this line:
extension_dir = ". /"
and specify the directory where PHP extensions or modules, under the usual value of "ext":
extension_dir = "ext"
  1. In the php.ini file, find these lines:
     ; Extension = php_mysql.dll, extension = php_mysqli.dll
    And to enable MySQL and MySQLi extensions both making the comment the same:
     extension = php_mysql.dllextension = php_mysqli.dll
  2. Now, in Windows Explorer, you can copy the following libraries. Dll:
    C: \ PHP \ libmysql.dll C: \ PHP \ ext \ php_mysql.dll C: \ PHP \ ext \ php_mysqli.dll
  3. Dll libraries are pasted into the folder   C: \ WINDOWS \ system32
Note: In most parts of the installation is not necessary to copy these libraries to the system32 system folder, but in other cases if necessary. Therefore it is always desirable.
  1. Go to Start Menu> All Programs> Apache HTTP Server 2.2.4> Configure Apache Server> Edit the Apache configuration file httpd.conf
  2. Add the following lines to the configuration file, at the end thereof:
     LoadModule php5_module "C: / php/php5apache2_2.dll" AddType application / x-httpd-php. PhpPHPIniDir "C: / PHP"
  3. In httpd.conf, you should find this policy:
     Dir_module> <IfModule DirectoryIndex index.html </ IfModule> That should add index.php as a directory: DirectoryIndex index.php index.html dir_module> <IfModule </ IfModule>
  4. Save the changes and close httpd.conf
  5. Go to All Programs> Apache HTTP Server 2.2.4> Control Apache Server> Restart
Note: You must restart Apache each time you make changes to the php.ini file settings and / or httpd.conf.

verifying the installation of php

  1. Open Notepad and type the following: <? Php phpinfo ();>
  2. Save the file as   info.php in your web server path (C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ htdocs)
  3. Close info.php
  4. Open info.php in your browser (http://localhost/info.php)
info php526 Install PHP on Windows
If PHP is installed correctly, you should see a table of information pertaining to the PHP installation environment.
  1. Open Notepad and type the following:
     <? Php $ mysqli = new mysqli ('localhost', 'root', 'yourpassword', 'test') if (mysqli_connect_errno ()) {printf ("Connect failed:% s', mysqli_connect_error ()); exit ( );} printf ("Host information:% s", $ mysqli-> host_info);
    $ Mysqli-> close ();
    ?>
  1. Save the file as   mysqli.php at the root of your web server (C: \ Program Files \ Apache Software Foundation \ Apache2.2 \ htdocs)
  2. Close mysqli.php
  3. Open your browser mysqli.php (http://localhost/mysqli.php)
If MySQL is enabled, you should see the following output:
php526 mysqli PHP on Windows Install

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Premium Wordpress Themes