Apr 04, 2016 In this tutorial, you’ll learn how you can make your own WAMP server by installing Apache, PHP and MySQL server manually on Windows 10. Learn to install Apache, PHP and MYSQL on Windows 10 Machine step by step. In this tutorial, you’ll learn how you can make your own WAMP server by installing Apache, PHP and MySQL server manually on Windows 10. Learn to install Apache, PHP and MYSQL on Windows 10 Machine step by step. This is Drupal and PHP running on IIS 10 on Windows 10! Further considerations. Just like any other application running on IIS, you want to take some things into account when running PHP applications on IIS: Isolate applications from each other by running them in separate application pools. Download Windows 10 Disc Image (ISO File) You’ve been routed to this page because the operating system you’re using won’t support the Windows 10 media creation. In this article, we will discuss “How to Setup Apache, PHP & MySql on Windows 10″. When you are planning to install Apache, PHP & MySQL on Windows 10 machine, then We have two options to do this as given below. How to Install PHP on Windows 10 Using Web Platform Installer If you need to install a PHP on your local Windows machine with Internet Information Services (IIS), Microsoft has already provided a way where you can do it fairly quickly using WPI. Keep in mind though, this setup has not been tested for.
We’ve previously shown you how to get a working local installation of Apache on your Windows PC. In this article, we’ll show how to install PHP 5 as an Apache 2.2 module.
Why PHP?
PHP remains the most widespread and popular server-side programming language on the web. It is installed by most web hosts, has a simple learning curve, close ties with the MySQL database, and an excellent collection of libraries to cut your development time. PHP may not be perfect, but it should certainly be considered for your next web application. Both Yahoo and Facebook use it with great success.
Why Install PHP Locally?
Installing PHP on your development PC allows you to safely create and test a web application without affecting the data or systems on your live website. This article describes PHP installation as a module within the Windows version of Apache 2.2. Mac and Linux users will probably have it installed already.
All-in-One packages
Download Php On Windows 10
There are some excellent all-in-one Windows distributions that contain Apache, PHP, MySQL and other applications in a single installation file, e.g. XAMPP (including a Mac version), WampServer and Web.Developer. There is nothing wrong with using these packages, although manually installing Apache and PHP will help you learn more about the system and its configuration options.
The PHP Installer
Although an installer is available from php.net, I would recommend the manual installation if you already have a web server configured and running.
Manual Installation
Manual installation offers several benefits:
- backing up, reinstalling, or moving the web server can be achieved in seconds (see 8 Tips for Surviving PC Failure) and
- you have more control over PHP and Apache configuration.
Step 1: Download the files
Download the latest PHP 5 ZIP package from www.php.net/downloads.php
As always, virus scan the file and check its MD5 checksum using a tool such as fsum.
Step 2: Extract the files
We will install the PHP files to
C:php
, so create that folder and extract the contents of the ZIP file into it.PHP can be installed anywhere on your system, but you will need to change the paths referenced in the following steps.
Step 3: Configure php.ini
Copy
C:phpphp.ini-development
to C:phpphp.ini
. There are several lines you will need to change in a text editor (use search to find the current setting). Where applicable, you will need to remove the leading semicolon to uncomment these setting.Define the extension directory:
Enable extensions. This will depend on the libraries you want to use, but the following extensions should be suitable for the majority of applications:
If you want to send emails using the PHP
mail()
function, enter the details of an SMTP server (your ISP’s server should be suitable):How To Install Php On Windows 10 Step By Step
Step 4: Add C:php
to the path environment variable
To ensure Windows can find PHP, you need to change the path environment variable. Open Settings, type ‘environment variables’ into the search field and open the result. Select the “Advanced” tab, and click the “Environment Variables” button.
Scroll down the System variables list and click on “Path” followed by the “Edit” button. Click “Edit text” and add
;C:php
to the end of the Variable value line (remember the semicolon).Now click OK until you’re out. You might need to reboot at this stage.
Step 5: Configure PHP as an Apache module
Ensure Apache is not running (use
net stop Apache2.2
from the command line) and open its confhttpd.conf
configuration file in an editor. The following lines should be changed:On line 239, add index.php as a default file name:
At the bottom of the file, add the following lines (change the PHP file locations if necessary):
Save the configuration file and test it from the command line (Start > Run > cmd):
Step 6: Test a PHP file
Create a file named
index.php
in Apache’s web page root (either htdocs or D:WebPages) and add this code:Ensure Apache has started successfully, open a web browser and enter the address http://localhost/. If all goes well, a “PHP version” page should appear showing all the configuration settings.
See also:
- Book: PHP & MySQL: Novice to Ninja, 6th Edition.
- Book: Jump Start PHP Environment, as well as many more books in our library.
Best of luck!
-->by Tali Smith
The fastest and easiest way to install PHP on Internet Information Services (IIS) is by using the Microsoft® Web Platform Installer (Web PI). Web PI completely automates setting up IIS, FastCGI, and the latest version of PHP from the php.net Web site. With Web PI, you can navigate to the 'Web Platform' tab and select 'PHP' under 'Framework and Runtimes' customize link. Alternately, use the instructions that follow as guidance for installing PHP with Windows® Installer or using a compressed (Zip) file installation.
There are two builds for each PHP version: one is thread-safe, and one is not (referred to as the non-thread-safe [NTS] version). The thread-safe version is designed for environments where the Web server core can keep the PHP engine in memory, running multiple treads of execution for different Web requests simultaneously. The architecture of IIS and the FastCGI extension provide an isolation model that keeps requests separate, removing the need for a thread-safe version. The NTS version does not have any of the code that allows PHP to manage multiple threads. As a result, there is a performance improvement on IIS when using the NTS version when compared to the tread-safe version because the NTS version avoids unnecessary thread-safety checks (FastCGI ensures a single-threaded execution environment).
Install PHP
There are two main ways to install PHP on a Windows®-based computer: download the Windows Installer or use the Windows Zip file from the PHP Web site. Either method will get PHP working, but both have some extra steps that are needed to make PHP work well.
Windows Installer
The Windows Installer version can get a complete PHP environment up and running, but the installation of extensions can be confusing. By default, no extensions are installed, and this can adversely affect the usefulness of the PHP installation. Alternately, all of the extensions can be installed; this results in an unstable system because some of the extensions can conflict with others. It is generally easier to use the Zip file installation.
Zip File Installation
To use the Zip file installation, follow the instructions in Using FastCGI to Host PHP Applications on IIS 7.0 and Above. The Zip file installation installs many of the extensions that are available for the Windows Installer version; however, none of the extensions are enabled until their entries in the Php.ini file are set up.
- Download the latest non-thread-safe Zip file package with binaries of PHP. Under Windows Binaries, click on the most current PHP non-thread-safe Zip package to download the PHP files.
- Unpack the files to a directory of your choice (for example,
C:PHP
) on your IIS server. - Rename the Php.ini-recommended to php.ini.
- Open the Php.ini file in a text editor, then uncomment and modify settings as follows:
- Set fastcgi.impersonate = 1.
FastCGI under IIS supports the ability to impersonate security tokens of the calling client. This allows IIS to define the security context that the request runs under. - Set cgi.fix_pathinfo = 0
The cgi.fix_pathinfo provides PATH_INFO/PATH_TRANSLATED support for Common Gateway Interface (CGI). Setting this to 1 will cause PHP CGI to fix its paths to conform to the specification. - Set cgi.force_redirect = 0.
- Set open_basedir to point to a folder or network path where the content of the Web site(s) is located.
- Set extension_dir to point to a location where PHP extensions reside. For PHP 5.2.X, this is typically extension_dir = './ext'.
- Set error_log='C:php_errors.log'
This can help with troubleshooting. - Enable the required PHP extension by un-commenting corresponding lines. More information follows in the section, Extensions.
Figure 1 Windows extensions
- Set fastcgi.impersonate = 1.
- Click on Start, Settings, Control Panel, and then double-click on the System icon (using the class view).
- Click on the Advanced system settings link in the left column.
- From the System Properties window, click on the Advanced tab, and then click on the Environment Variables button at the bottom.
- Select the Path variable from the System Variables section, and then click on Edit. Add:
c:php
to your system path.
Figure 2: Edit System Variable - Click OK until you have exited the System Properties window.
- Start IIS Manager by clicking on Start, Programs, Administrative Tools, and then Internet Information Services (IIS) Manager.
- From the IIS Manager, click on the hostname of your server in the Connections panel on the left.
- Double-click on the Handler Mappings icon.
Figure 3: Internet Information Services (IIS) Manager - From the Handler MappingsActions panel, click on Add Module Mapping.
Figure 4: Handler Mappings - Type the following information into the appropriate text boxes, and then click OK.
- Request path: *.php
- Module : FastCGImodule
- Executable: C:phpphp-cgi.exe
- Name: FastCGI
Figure 5: Add Script Map - Click OK, and then c lick Yes.
- In the left panel, click on your server's hostname, and then double-click on the Default Document icon.
- From the Actions panel on the right, click Add.
- Enter index.php as the new default document name, and then click OK.
- Enter default.php as the new default document name, and then click OK.
- In the left panel, click on your server's hostname.
- In the Actions panel on the right, click Restart.
- Create a new text document, and save it as
c:inetpubwwwrootphpinfo.php
with the following content: - You should now see the PHP information page at
http://localhost/phpinfo.php
.
Figure 6: PHP information page
Extensions
It is important to determine which extensions are needed by the applications that will be running and then to limit the installed extensions to only those. For a typical open-source application installation, for example, the following extensions are installed:
- Database Extensions — Most open-source applications that use MySQL for a database engine use either the php_mysql or the php_mysqli extensions. For new development work, either of these extensions work well, or consider using the PDO versions of the MySQL driver (PDO is a PHP extension providing aUsing FastCGI to Host PHP Applications on IIS 7.0 and Above' by Ruslan Yakushev, published on December 5, 2007.
See also
- PHP on Windows Training Kit.
- Installing PHP on Windows Server 2008.
- PHP on IIS7.
- Deploying IIS 7.5 + FASTCGI + PHP on Server Core.