How To Install Php On Windows
Install PHP on Windows
Obtaining PHP
- Download latest version of PHP from http://www.php.net/downloads.php.
- You tin likewise download the .msi package i.e. windows installer of PHP from sourceforge.internet
Prerequisite and running on your Windows organization, else you lot will not be able to run PHP Scripts.
Alternatively, y'all tin install WAMP server or AMPPS server to install PHP, MySQL, and Apache Spider web Server on your Windows machine.
Options for installing PHP on Windows
- You can install php on windows manually.
- Yous can run the .msi package, i.due east. windows installer for php to install php.
- Besides full installation, yous can install php extensions on an existing installation of PHP.
- You lot tin upgrade to a higher version of PHP from an existing version.
Install PHP on Windows manually
You take to download zipped binary version of PHP from http://www.php.net/downloads.php.
Extract the downloaded file to php binder which must be created at the root of any of your windows drives (e.yard. c:\php or d:\php).
Enter php binder and rename the file php.ini-recommonded to php.ini.
Open the file php.ini with whatsoever text editor and observe extension_dir within the file.
Change the extension directory, i.e. if you have installed php in php binder of D drive, setting will exist extension_dir=D:\php.
Now you open Environment Variables (MyComputer -> System Properties -> Environment Variables), nether system variables, select Path and click Edit,
in the Variable value, get to the end of the list and put a semicolon, then add together D:\php;D:\php\ext bold D:\php is the location of your php installation.
Then Click on New nether system variable and add PHPRC confronting Variable name and D:\php confronting Variable value.
Restart your system.
Install PHP on Windows using Windows installer
Merely run the .msi Windows installer file and follow the installation wizard.
Testing if PHP is installed properly
Create a php file containing code <?php echo phpinfo(); ?> and save information technology as test.php.
Run this file on your web server and if yous get an output like this:

then you lot have installed PHP properly.
Install PHP extensions on Windows
What is a PHP extension?
A PHP extension is a piece of code which is not part of the core PHP and y'all need it to explore certain functionalities of PHP (e.g. for using mysql yous need mysql extension of PHP).
Many extensions are available out of the box in the PHP installer downloaded from php.cyberspace or in the .msi bundle. Merely many demand to be obtained separately from php.net.
In Windows, extensions come in the form of a .dll file which you can download from php.net.
How do y'all configure an extension on Windows?
Y'all need to change the setting of extension dir in php.ini file. For example, If you are using PHP 5.0.3, and you take installed php in c:\php, then yous accept to set extension_dir = C:\php\ext in your php.ini file.
After downloading the files needed, you have to open php.ini and enable a line pointing to an extension in question.
For enabling extensions, you have to uncomment a line in your php.ini file. For example, for enabling mysql extension, yous have to change; extension = php_mysql.dll to extension = php_mysql.dll in your php.ini file.
You as well need to restart your spider web server and php in order to complete the installation of a specific extension.
Sample php.ini
Previous: PHP Home
Side by side: Install php on Linux
Source: https://www.w3resource.com/php/installation/install-php-on-windows.php
Posted by: hallmorbigh.blogspot.com
0 Response to "How To Install Php On Windows"
Post a Comment