Register   |   Login   |   February 07, 2012    |   Knowledge Base  >  Knowledge Base Systems  >  Servers  >  PHP Issues on windows
search:     

Phone: 480-722-1227
Toll Free: 888-722-1227

PHP Issues on windows
Last Post 24 Aug 2007 02:19 PM by Vigilant CIO. 3 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
SuperUser AccountUser is Offline
Basic Member
Basic Member
Posts:105

--
08 Nov 2006 11:08 PM  
PHP installation problems.
after running the php installer, it typically will not run because it puts the php.ini in the sys directory, which the web server user does not generally have access.
Solution;
-move/copy ini to php folder
-in iis>webservice extentions> add one that allows the php-cgi.exe to run or enable all unkown(poses a security issue)
http://www.php.net/
SuperUser AccountUser is Offline
Basic Member
Basic Member
Posts:105

--
08 Nov 2006 11:09 PM  
Another issues that must be resolved for php to run;
the accounst that run the website must have acccess to the php folder (RW). It is usually the network service account or a user name in commercial hosted account...
SuperUser AccountUser is Offline
Basic Member
Basic Member
Posts:105

--
08 Nov 2006 11:09 PM  
Detailed procedure;

http://www.peterguy.com/php/install_iis6.html


How to install PHP 5.x on Windows Server 2003 with IIS 6


http://www.peterguy.com/php/install_IIS6.html

A detailed and hopefully helpful step-by-step guide, based on my experience.

Last updated 8:27 PM 11/29/2005

questions/props/corrections/etc... > http://php.net.

Unzip it somewhere on your hard drive.

You can pick any drive, and any folder, but the recommendation is to put all the PHP stuff in a folder just off of the root drive (avoid whitespace), like C:\PHP, and this guide will follow that recommendation.



Download the "Collection of PECL modules for PHP 5.0.3" zip file and extract the contents of that file into C:\PHP\ext. It contains more extensions.


1.2 Rename/copy php.ini-recommended to php.ini


In your PHP directory, you'll find a couple of php.ini-* files. They are pre-configured settings for a PHP install that you can use as an initial setup. php.ini-recommended is the most secure, hence, the recommended one; just rename it to php.ini.


2. http://www.garykeith.com/browsers/downloads.asp to the extras directory under your PHP install directory (C:\PHP\extras\browscap.ini, for example), and change the
browscap

variable in php.ini to be the full path to the file (
browscap=C:\PHP\extras\browscap.ini

).


2.3 Create a session state directory and point the
session.save_path

php.ini variable to it.


This is another optional but recommended step. PHP does not need sessions, but it's something that will most likely be useful.

Create a session directory somewhere on the server. I created C:\PHP\Sessions. This directory will hold many small files with session variable information for PHP. They probably won't take up a whole lot of room, but if you need to keep your data off your system drive, then you can put the folder anywhere else.

Now change the value of the
session.save_path

variable in php.ini to be the full path to that directory (
session.save_path=C:\PHP\Sessions

).


2.4 Setup the PHP extensions.


If you want to install extensions (For information on extensions, visit http://ca3.php.net/manual/en/instal...nsions.php), then you need to go through a couple of steps.



You need to point PHP to the directory that holds the extension libraries, you need to rearrange the list of extensions so that they'll load w/out throwing errors, and you need to uncomment the desired extensions.

  • Point PHP to the correct directory:

    Set
    extension_dir

    in php.ini to "C:\PHP\ext"

  • Massage the list of extensions so that most of them will load w/out throwing errors.

    The easiest thing to do is replace all the "extension=" lines in php.ini with the following (be sure to scroll down so you get everything):



  • Uncomment the ones you want to use.


Some notes on using extensions:

  • I left uncommented all the ones that I got to work on my system with no additional software.

  • If you have not downloaded and extracted the "Collection of PECL modules for PHP 5.0.3" archive, not all of the uncommented ones will work.

  • Most of the ones that won't load rely on other software being present, like oracle, informix and sybase.

  • php_mcrypt.dll requires the mcrypt library, the source code for which can be found http://www.visualwin.com/PHP/ for quite a few pictures detailing the process.

    That is actually the website I used the most when figuring this all out.

    I know, this isn't really a troubleshooting tip, but I don't have anywhere else to put it now.


5.7 I'm installing on a 64-bit box and all I get is a 500 error page!


This just in, from Ryan Hubbard:

On 64 bit IIS loads all extensions in 64 bit mode by default. Since php5isapi.dll is 32 it freaks out but doesn’t give an errors just a 500 error on php pages. So in order to get it to work on IIS 6 64-bit you need to run the following at the command line.

cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1

This enables both 64 and 32 bit extensions.

<!-- Footer -->

Many thanks to:

Andrew Champion (remove "YourPants" to e-mail) for providing the extension ordering tip, kickstarting me toward HTML-formatted goodness, and helping me test parts of this guide.

Cody of http://apparitiondesigns.com/">apparition.Designs for expanding on a couple of steps, providing the major framework for this HTML-formatted guide and helping me test several steps.

http://dossett.org/">Doug Dossett for providing the Application Pool user permission tip

Rob Smith (remove "TheRoadBlock" to e-mail) for providing the tip on checking the loading of extensions via RDC.

All those out there who posted instructions, answered questions, and generally helped me along the path to PHP knowledge (not to imply that I've gotten there yet :-P ).




Vigilant CIOUser is Offline
Basic Member
Basic Member
Posts:360

--
24 Aug 2007 02:19 PM  
I have notice that when php website are set-up to use a custom user on W2k3, they run into a security problem. Changing the app pool identity to run under the network service acount seems to resolve the issue
You are not authorized to post a reply.

Active Forums 4.2
Copyright 2006 - 2011 Vigilant Support   |  Privacy Statement  |  Terms Of Use