Searching...
Tuesday 4 June 2013

Installing IIS and PHP on Windows

IIS php windows


Most developers prefer to develop applications on a local workstation/laptop or on a dedicated development server, you’ll probably need to know how to at least install and configure PHP and a web server (apache and ms IIS). Asking "Why should i learn to install php and a web server" is the same as asking "Why should a soldier need to load/handle a gun?". It is something you will never regret about.
In this lecture you will be guided to INSTALLING PHP AND IIS ON WINDOW PLATFORMS

To install PHP and IIS on your Windows 7, Vista, Server 2003, or Server 2008 machines, head over to http://php.iis.net and click the giant Install PHP button. Presuming you haven’t already installed the Microsoft Web Platform Installer, you’ll next be prompted to do so. Per usual, you’ll need administrative privileges in order to run this installer. Once downloaded, you’ll be prompted to install PHP.  Click the Install button and then read and agree to the license terms to complete the process.

Believe it or not, once the installation process is complete, PHP has been successfully configured to run on your machine.

At the time of this writing the Web Platform Installer console is unable to uninstall PHP, meaning you’ll need to use Windows’ native program management tool to do so manually. On Windows 7, this tool can be accessed by clicking the Uninstall a program option within the control panel.


TESTING YOUR INSTALLATION

The best way to verify your PHP installation is by attempting to execute a PHP script. Open a text editor and add the following lines to a new file:

<?php
phpinfo();
?>

Save this file as phpinfo.php. If you’re running Apache, save it to the htdocs directory. If you’re running IIS, save the file to C:Inetpubwwwroot  Now open a browser and access this file by entering the following URL: http://localhost/phpinfo.php.

Please note that you cannot just open the script by navigating through your browser’s File | Open feature, because in doing so this script will not be passed through the web server and therefore will not be parsed.
If all goes well, you should see output similar to that shown in Figure.

Output from PHP’s phpinfo() function
Figure. Output from PHP’s phpinfo() function


If you’re attempting to run this script on a web hosting provider’s server, and you receive an error message stating phpinfo() has been disabled for security reasons, you’ll need to create another test script. Try executing this one instead, which should produce some simple output:

<?php
echo "A simple but effective PHP test!";
?>

NOTE: This installation does NOT enable mcrypt by default.In PHPMyAdmin you will receive the following PHPMyAdmin Error "Cannot load mcrypt extension. Please check your PHP configuration"

0 comments:

Post a Comment

 
Back to top!