Manually Installing Php on any system

This section contains instructions for manually installing and configuring PHP on Microsoft Windows. For the instructions on how to use PHP installer to setup and configure PHP and a web server on Windows refer to Windows Installer (PHP 5.2 and later).

Selecting and downloading the PHP distribution package

Download the PHP zip binary distribution from » PHP for Windows: Binaries and Sources. There are several different versions of the zip package – chose the version that is suitable for the web server being used:

If PHP is used with IIS then choose PHP 5.3 VC9 Non Thread Safe or PHP 5.2 VC6 Non Thread Safe;

If PHP is used with IIS7 or greater and PHP 5.3+, then the VC9 binaries of PHP should be used.

If PHP is used with Apache 1 or Apache 2 then choose PHP 5.3 VC6 or PHP 5.2 VC6.


VC9 Versions are compiled with the Visual Studio 2008 compiler and have improvements in performance and stability. The VC9 versions require you to have the » Microsoft 2008 C++ Runtime (x86) or the » Microsoft 2008 C++ Runtime (x64) installed.

The PHP package structure and content

Unpack the content of the zip archive into a directory of your choice, for example C:\PHP\. The directory and file structure extracted from the zip will look as below:

Example #1 PHP 5 package structure

| |
| |-php5ts.lib — php5.lib in non thread safe version
+–ext — extension DLLs for PHP
| |
| |-php_bz2.dll
| |
| |-php_cpdf.dll
| |
| |-…
+–extras — empty
+–pear — initial copy of PEAR
|-go-pear.bat — PEAR setup script
|-php-cgi.exe — CGI executable
|-php-win.exe — executes scripts without an opened command prompt
|-php.exe — Command line PHP executable (CLI)
|-php.ini-development — default php.ini settings
|-php.ini-production — recommended php.ini settings
|-php5apache2_2.dll — does not exist in non thread safe version
|-php5apache2_2_filter.dll — does not exist in non thread safe version
|-php5ts.dll — core PHP DLL ( php5.dll in non thread safe version)

Below is the list of the modules and executables included in the PHP zip distribution:

go-pear.bat – the PEAR setup script. Refer to » Installation (PEAR) for more details.

php-cgi.exe – CGI executable that can be used when running PHP on IIS via CGI or FastCGI.

php-win.exe – the PHP executable for executing PHP scripts without using a command line window (for example PHP applications that use Windows GUI).

php.exe – the PHP executable for executing PHP scripts within a command line interface (CLI).

php5apache2_2.dll – Apache 2.2.X module.

php5apache2_2_filter.dll – Apache 2.2.X filter.

Changing the php.ini file

After the php package content has been extracted, copy the php.ini-production into php.ini in the same folder. If necessary, it is also possible to place the php.ini into any other location of your choice but that will require additional configuration steps as described in PHP Configuration.

The php.ini file tells PHP how to configure itself, and how to work with the environment that it runs in. Here are a number of settings for the php.ini file that help PHP work better with Windows. Some of these are optional. There are many other directives that may be relevant to your environment – refer to the list of php.ini directives for more information.

Required directives:

extension_dir = – The extension_dir needs to point to the directory where PHP extensions files are stored. The path can be absolute (i.e. “C:\PHP\ext”) or relative (i.e. “.\ext”). Extensions that are listed lower in the php.ini file need to be located in the extension_dir.

extension = xxxxx.dll – For each extension you wish to enable, you need a corresponding “extension=” directive that tells PHP which extensions in the extension_dir to load at startup time.

log_errors = On – PHP has an error logging facility that can be used to send errors to a file, or to a service (i.e. syslog) and works in conjunction with the error_log directive below. When running under IIS, the log_errors should be enabled, with a valid error_log.

error_log = – The error_log needs to specify the absolute, or relative path to the file where PHP errors should be logged. This file needs to be writable for the web server. The most common places for this file are in various TEMP directories, for example “C:\inetpub\temp\php-errors.log”.

cgi.force_redirect = 0 – This directive is required for running under IIS. It is a directory security facility required by many other web servers. However, enabling it under IIS will cause the PHP engine to fail on Windows.

cgi.fix_pathinfo = 1 – This lets PHP access real path info following the CGI Spec. The IIS FastCGI implementation needs this 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.

fastcgi.logging = 0 – FastCGI logging should be disabled on IIS. If it is left enabled, then any messages of any class are treated by FastCGI as error conditions which will cause IIS to generate an HTTP 500 exception.

Optional directives

max_execution_time = ## – This directive tells PHP the maximum amount of time that it can spend executing any given script. The default for this is 30 seconds. Increase the value of this directive if PHP application take long time to execute.

memory_limit = ###M – The amount of memory available for the PHP process, in Megabytes. The default is 128, which is fine for most PHP applications. Some of the more complex ones might need more.

display_errors = Off – This directive tells PHP whether to include any error messages in the stream that it returns to the Web server. If this is set to “On”, then PHP will send whichever classes of errors that you define with the error_reporting directive back to web server as part of the error stream. For security reasons it is recommended to set it to “Off” on production servers in order not to reveal any security sensitive information that is often included in the error messages.

open_basedir = , e.g. openbasedir=”C:\inetpub\wwwroot;C:\inetpub\temp”. This directive specified the directory paths where PHP is allowed to perform file system operations. Any file operation outside of the specified paths will result in an error. This directive is especially useful for locking down the PHP installation in shared hosting environments to prevent PHP scripts from accessing any files outside of the web site’s root directory.

upload_max_filesize = ###M and post_max_size = ###M – The maximum allowed size of an uploaded file and post data respectively. The values of these directives should be increased if PHP applications need to perform large uploads, such as for example photos or video files.

PHP is now setup on your system. The next step is to choose a web server, and enable it to run PHP. Choose a web server from the table of contents.

In addition to running PHP via a web server, PHP can run from the command line just like a .BAT script. See Command Line PHP on Microsoft Windows for further details.

33 responses to this post.

  1. People would probably get more exercise if they didn’t insist on only parking in the spots closest to the door.

  2. i am sorry donot understand your irrelevant post but any ways thanks for post.

  3. Hello. Great job. I did not expect this. This is a remarkable story. Thanks!

  4. Hello Webmaster, I noticed that is ranking pretty low on Google and has a low Google PageRank. Now the Google PageRank is how Google is able to see how relevant your webpage is compared to all the other webpages online, if you cannot rank high at the top of Google, then you will NOT get the traffic you need. Now usually trying to get to the top of Google costs hundreds if not thousands of dollars and very highly optimized targeted marketing campaigns that takes a team of experts months to achieve. However, we can show you how to get to the top of Google with no out of pocket expenses (free traffic), no stupid ninja tricks, no silly mind control techniques, and this will be all white hat with no blackhat software or tactics that could possibly land you on bad terms with Google and put you in the dreaded “Google Sandbox”. We’ll show you how to easily capture all the targeted traffic you need, for free, multiple ways to land fast (not months) first-page rankings in Google and other major search engines (Bing, Yahoo, Ask, etc), even show you strategies on how to earn daily commissions just try Ranking Top of Google, please check out our 5 minute video.

  5. The original Haunting was great , very creepy minumal effects to great effect.What isnt shown is always scarier than what is shown the imagination is the greatest effects company out there !!

  6. Hello my loved one! I want to say that this post is amazing, great written and come with approximately all significant infos. I’d like to peer extra posts like this .

  7. I together with my friends have been studying the excellent pointers found on your web page and then at once got an awful suspicion I never thanked the website owner for them. All the ladies appeared to be absolutely passionate to see them and already have pretty much been using those things. I appreciate you for really being simply considerate as well as for selecting varieties of terrific things most people are really desirous to be informed on. Our honest regret for not expressing appreciation to earlier.

  8. Just a quick note to show appreciation for the many ideas that truly clear many of my own doubts on this issue. For many days, I have already been visiting your site and I have always been gaining new stuff, especially from this content. In fact, words could not express how much my spouse and i thank you for the step-by-step recommendations you provide here and then I no longer live in the world of ignorance as far as that topic is concerned. I will be truly grateful for the expert ideas along with support.

  9. Perfect piece of function you’ve got done, this website is truly cool with superb details.

  10. This article has inspired me to start writing on my own blog

  11. I see something really interesting about your web site so I saved to fav.

  12. Hello Web Admin, I noticed that your On-Page SEO is is missing a few factors, for one you do not use all three H tags in your post, also I notice that you are not using bold or italics properly in your SEO optimization. On-Page SEO means more now than ever since the new Google update: Panda. No longer are backlinks and simply pinging or sending out a RSS feed the key to getting Google PageRank or Alexa Rankings, You now NEED On-Page SEO. So what is good On-Page SEO?First your keyword must appear in the title.Then it must appear in the URL.You have to optimize your keyword and make sure that it has a nice keyword density of 3-5% in your article with relevant LSI (Latent Semantic Indexing). Then you should spread all H1,H2,H3 tags in your article.Your Keyword should appear in your first paragraph and in the last sentence of the page. You should have relevant usage of Bold and italics of your keyword.There should be one internal link to a page on your blog and you should have one image with an alt tag that has your keyword….wait there’s even more Now what if i told you there was a simple WordPress plugin that does all the On-Page SEO, and automatically for you? That’s right AUTOMATICALLY, just watch this 4minute video for more information at. WordPress Seo Plugin

  13. If you could email me with a few suggestions on just how you made your blog look this great, I would be thankful.

  14. You are quite welcome! Thanks for writing the book!

  15. Anyone have a work around towards the depreciated command? It works once i do layout for epub docs, however it does not validate.

  16. Pinterest has skyrocketed to become the fifth biggest social site, ahead of Google+ and LinkedIn. Browse the Whole Article… 0.000000 0.000000 Share this:PrintEmailLike this:LikeBe the first to such as this

  17. Terrific list, many thanks for putting it together

  18. You ought to really moderate the comments at this site

  19. Jesus Christ theres a lot of spammy comments on this web site. Have you at any time thought about attempting to remove them or putting in a extension?

  20. Can you email me with a few pointers about how you made your site look like this, I would be appreciative.

  21. Have you thought about adding some differing opinions to the article? I think it will really enhance everyones understanding.

  22. It seems to me that this site doesnt load up on a Motorola Droid. Are other folks getting the exact same problem? I enjoy this webpage and dont want to have to skip it whenever Im gone from my computer.

  23. Whenever I originally left a comment I clicked the Notify me any time new comments are added checkbox and now every time a comment is added I get four messages with the exact same comment.

  24. Jesus Christ there is a lot of spammy comments on this web site. Have you at any time believed about attempting to eliminate them or putting in a plugin?

  25. This really solved my problem, thank you!

  26. This is really a excellent weblog, would you be interested in going through an interview about just how you made it? If so e-mail myself!

  27. I experimented with taking a look at your site with my iphone and the format does not seem to be correct. Might wanna check it out on WAP as well as it seems most cellphone layouts are not really working with your web page.

  28. I adore this website layout ! How did you make it. It is rather good!

  29. Heya, I just hopped over to your web site via StumbleUpon. Not somthing I might usually read, but I appreciated your thoughts none the less. Thanks for creating some thing worth reading through.

  30. Heya, I just hopped over to your web-site through StumbleUpon. Not somthing I might generally browse, but I appreciated your thoughts none the less. Thank you for making some thing well worth browsing.

  31. Have you considered including a few social bookmarking buttons to these blogs. At least for facebook.

  32. I have got 1 recommendation for your site. It looks like at this time there are a number of cascading stylesheet troubles while opening a selection of web pages within google chrome as well as firefox. It is running alright in internet explorer. Probably you can double check that.

  33. I Am Going To have to come back again when my course load lets up – nevertheless I am getting your Feed so i can read your blog offline. Cheers.

Comments are closed.

%d bloggers like this: