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.
If you are looking for information about older systems, such as Windows XP, 2003, 98 or Apache 1.x, see the Legacy Info section. The Official releases of PHP on Windows are recommended for production use. However, you are welcome to build PHP from Source. You will need a Visual Studio environment. This site is dedicated to supporting PHP on Microsoft Windows. It also supports ports of PHP extensions or features as well as providing special builds for the various Windows architectures. If you like to build your own PHP binaries, instructions can be found on the Wiki. Aug 21, 2015 I just upgraded to Windows 10. When I upgraded I just wanted to setup a small PHP website. I enabled IIS, CGI and all stuff needed for getting PHP working. PHP is working fine, however, I was trying to install PHP manager on Windows 10 but I am not having success. I found that some people had issues because.NET 3.5 was not installed.
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.
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.
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.
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 offers several benefits:
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.
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.
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. Avery design pro software for windows 10.
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):
C:php
to the path environment variableTo 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. Free raster to vector software.
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):
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:
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).
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.
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.
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.
C:PHP
) on your IIS server.Open the Php.ini file in a text editor, then uncomment and modify settings as follows:
Enable the required PHP extension by un-commenting corresponding lines. More information follows in the section, Extensions.
Figure 1 Windows extensions
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
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.
Figure 5: Add Script Map
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
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: