Php Installation On Windows 10



This setup should only be used as PHP development environment on Windows as it has not been tested on production.

Installing PHP7 on Windows 10 and Verifying on CMDIn this video, we will install PHP7 and set an environment variable for it so that we can use it on command. How to download and install PHP 7.4.6 (64 bit) on Windows 10 manually, verify php version with command prompt and run inbuilt PHP development server and then pull phpinfo method in the browser. Tagged with php7.

Download

If you followed the steps from the previous post on PHP installation on Windows using Web Platform Installer, you will now have PHP 7.0 to do your web development.

The problem using Web Platform Installer (WPI) is that most likely you won’t be using the latest version of PHP (at the time of this writing, it’s 7.0.15 and 7.1.1 and WPI only gives you version 7.0.9).

Fortunately, if you want to upgrade to the latest version, you can do it manually in a few simple steps described below.

Before we start, please keep in mind that this installation is for a local PHP server on IIS, not Apache web server.

Steps to Upgrade PHP to 7.1

  1. Open Control Panel, click on Programs and Features, and then Turn Windows features on or off. Under Internet Information Services, World Wide Web Services, Application Development Features, make sure that option CGI is checked. This enables both the CGI and FastCGI services, which is recommended for PHP applications.

  2. Download PHP for Windows. Since we’re using PHP as FastCGI, we’ll use the 64-bit Non-Thread Safe (NTS) version (i.e., php-7.1.1-nts-Win32-VC14-x64.zip).

  3. Extract file php-7.1.1-nts-Win32-VC14-x64.zip to its own folder.

  4. Copy your current PHP7 installation from v7.0 and rename the copy to v7.1.

  5. Copy all files from the PHP7 zip folder (Step 3) to the new renamed v7.1 folder (Step 4).

  6. Edit the php.ini (C:Program FilesPHPv7.1php.ini) to reflect the new version (7.1) under [WebPIChanges] as shown below (see highlighted changes):

    Please note the change in line 1857. Although it’s not related to PHP upgrade, you need to double check that the extension=php_mysql.dll is either commented out or deleted.

    MySQL extension was deprecated on PHP version 5.5 and removed on version 7. If it’s not excluded, you’ll see the following error:

    Line 1872-1873 are for WinCache setting. Just make sure it’s there or else you will also encounter an error.

  7. Open IIS Manager and click on FastCGI Settings.

  8. Double-click on the PHP 7.0 settings and copy all the property values including the Environment Variables (PHP_FCGI_MAX_REQUESTS, PHPRC) and Advanced Settings. We’re just going to reuse all the values from the existing installation instead of starting from scratch.

    Click Cancel button after you’re done.

  9. Now from FastCGI Settings window, click on Add Application… on the Actions pane on the right.

  10. Type in C:Program FilesPHPv7.1php-cgi.exe on the Full Path box.

  11. Enter all values you copied from Step 8, except for PHPRC where you want to update the value to 7.1 (i.e., C:Program FilesPHPv7.1).

    Once completed, just click OK.

  12. Go back to IIS Manager and click on Handler Mappings.

  13. Look for PHP_via_FastCGI and double-click on it.

  14. Locate the new php-cgi.exe and change the value on the Executable (optional): accordingly. Click Yes when there’s a dialog box asking you to create a FastCGI application for this executable.

    Click OK and exit IIS Manager.

Update WinCache Extension for PHP

Once PHP is upgraded to version 7.1 you may run into another issue with your WinCache PHP extension with an error message as follow.

This error was caused by an outdated version of WinCache. PHP 7.1 requires a new WinCache binaries. Look for them in the PECL packages or you can download it directly from this link.

Installation should be straightforward. Just extract the zip file and follow the instructions.

Update Windows Environment Variables

Finally, we need to update the path of the new PHP in Windows Environment Variables.

  1. Click on the Windows start button and type in “system” and click on System Control panel.

  2. In System window, click on Advanced system settings and on System Properties window, make sure you have Advanced tab opened. And you can follow the path shown in the picture to complete the rest of the steps.

  3. Click on Environment Variables… button.

  4. Under System Variables, click on Path and Edit… button.

  5. Click on where the current PHP is located and double-click it or click on Edit button.

  6. Change the value to the location of the new PHP (i.e., C:Program FilesPHPv7.1)

  7. Click OK button on each window to close.

That’s all there is. Now you can test your PHP installation by creating a test.php file with this PHP code.

Run it from your browser (i.e., http://localhost/test.php). If PHP is installed with the correct version, you will see something similar to this:

Compared with previous version of PHP installation on Windows:

Further Reading

How to Install PHP on Windows 10 Using Web Platform Installer
How to Upgrade to PHP 7.2 on IIS (Windows 10)
FastCGI
Difference between PHP thread safe and non thread safe binaries
Using FastCGI to Host PHP Applications on IIS 7
WinCache Extension for PHP

Download

Download PHP For Windows: Binaries and sources Releases
WinCache 2.0.0.8 PHP Extension Direct Download
Microsoft Visual C++ 2015 Redistributable Update 3

If setting up XAMPP on Windows 10 is something which you are still unable to configure, then following the below-given steps would save you a lot of time and efforts. Once it’s installed, it will be a breeze to use it. In this blog post, I will show you how to install XAMPP on Windows 10 with ease.

It’s always a good practice to test your site on the local server before you actually publish it to the real server. And to create a local server environment on your windows machine, you can use XAMPP. XAMPP stands for X- cross-platform, A- Apache, M- MySQL, P- PHP, P- Perl. It is a completely free and open source solution that gives you an incredible local web server to work on. Installing XAMPP sets you free from learning and remembering commands to run Apache, MySQL, etc. It simply gives you a control panel to manage all the inclusive components.

Once you have XAMPP installed on your PC you can install any CMS, including but not limited to WordPress on your Local PC. Since we have already discussed how to move WordPress from localhost to live server so, you don’t have to worry about the later process after installing WordPress locally. Simply test your site thoroughly on XAMPP and make most of it.

How to Install XAMMP on Windows 10

So without ado, let’s get started with the step-by-step guide to how to install XAMPP on Windows 10. And I am very sure by the end of this post, you’ll be having your very own local WordPress testing environment on Windows 10.

Step 1: Download and Install XAMPP

To download and install XAMPP, go to apachefriends downloads page, the official link to download XAMPP from. You will see XAMPP ready to download for cross-platform like Windows, Linux, Mac OS X. Since we are discussing How to install XAMPP on Windows 10, therefore, we will choose the Windows option as shown below.

Step 2: Run the Installer to Install XAMPP

  1. XAMPP Setup Wizard

During the installation process, you may come across warning pop-ups. But you would probably click ‘Yes’ to start the installation process. Soon after you click on the downloaded file, the XAMPP setup wizard will open. Now click on the ‘Next’ Button to proceed.

  1. Select Components

Php Installation On Windows 10

Next, you need to check the components which you want to install and can uncheck or leave as it is which you don’t want to install. You can see there are a few options which are light grey in color. These are the options which are necessary to run the software and will automatically be installed. Now click on the ‘Next’ button to continue.

  1. Select Installation Folder

Now you need to choose the folder where you want to install the XAMPP. You can choose the default location or you can choose any location of your choice and choose the ‘Next’ button to move ahead.

  1. Bitnami for XAMPP

Now will see a window showing you information about Bitnami. Simply click on the ‘Next’ button to move further. However, if you wish to learn more about the Bitnami, then you may check the box saying ‘Learn more about Bitnami for XAMPP.’
Basically Bitnami is for installing open source applications i.e. WordPress, Joomla etc on your newly installed XAMPP.

  1. Ready to Install

Now you’ll see another window with a message “Setup is now ready to begin installing XAMPP on your computer” like shown below. You just have to hit the ‘Next’ button to proceed.

  1. Welcome to XAMPP Wizard

Now just be patient and wait for the installation to complete.

  1. Installation Complete

Once the installation is completed, you will be asked whether you would like to start the control panel now or not, displaying the message “Do you want to start the control panel now?” Check the box and click on the ‘Finish’ button and see if the XAMPP is working fine.

Install Php On Windows 10 Command Line

Step 3: Select your XAMPP Install Language

As soon as you will click on the Finish button in the final step of install XAMPP process, you will be asked to select the preferred language between English and German. It is up to you which language you choose. After that click on the ‘Save’ button to confirm your selected language. As of now, I am choosing the English language.

Php

Step 4: XAMPP is now Installed, run it

If the entire process of XAMPP installation went correctly, then the control panel would open smoothly. Now click on the ‘Start’ button corresponding to Apache and MySQL.

Install Php Windows 10 Iis

That’s it. You have successfully installed XAMPP on Windows 10. Or say you have successfully installed XAMPP locally. Once you start the modules, you should see their status turn to green. Whereas, on the right side, you can see the process ID number and port numbers every module is using. You’re good to go now. Happy XAMPPing!!

Download Php For Windows 10

Wrapping Up
Now you know how easily you can install XAMPP to test and install your WordPress site locally before hitting the live server. Certainly, the biggest advantage of installing XAMPP is that you don’t have to worry about the number of attempts you make or the kind of experiments you perform on your site. You can freely try anything you want without any tension of losing your users. However, if you face any error while installing XAMPP on your Windows machine, then do let me know in the comments below. I will try my level best to resolve the errors. Nonetheless, creating a stunning new website piece of cake if you use TemplateToaster website builder. It is indeed, a dynamic website builder to give you an amazing website without any coding skills. So, try now!!