Install PHP on XP / IIS 5.1? - php

I am trying to install PHP onto my development box (XP SP3 / IIS 5.1) I've got PHP 5.2.6 stable downloaded (the MSI installer package) and I am getting an error "Cannot find httpd.conf". After that the install seems to breeze by quickly (more quickly than I would have expected) and when I try to execute a simple PHP script from my localhost test directory that I created, I get a slew of missing DLL errors. I have seen posts out there which indicate that its possible and has been done. I dont see any bug reports for this MSI at PHP.NET support. Any ideas?

Not sure if you already have this but I use WAMP from http://www.wampserver.com/en
It's easy and simple to set up, it has an icon in the system tray to show that its active and you can make it go online or available to the outside by clicking the icon and setting it. I used this when I was first learning PHP since it has everything in one, no need to setup any other service like IIS.

Probably the installer didn't configure your server to use PHP properly. Check out Microsoft's page on enabling PHP on IIS or alternatively switch to Apache if that's a viable option.

I'll see if I can remember it correctly:
Unzip PHP zip file into c:\Program Files\php (or run the installer)
Copy php5ts.dll into c:\windows\system32
Copy php.ini.dist into c:\windows and rename it to php.ini
Edit c:\windows\php.ini and look for extension dir - make it point to c:\Program Files\php\extensions (or wherever you put it)
This is where my memory gets fuzzy: Edit your IIS application settings, add a script map for .php files, and set the executable to php5ts.dll
Profit!?!??!?!

Related

On Windows 8 and Internet Information Service 8.5 - how to setup PHP?

Let me begin by saying that I am very new to Microsoft's Internet Information Service. I need to setup IIS on my PC and it should also execute PHP files. So far I got everything installed and running - the latest PHP and enabled IIS service. I can view the Default Webpages (*.html) files ONLY. It will not execute PHP files. If I try to request any PHP files, I get 403 error.
I have been researching online and seems to be more confused about setting up PHP (extension) on IIS. Some websites say you need to configure PHP through its MANAGER. Others say I need to add Role and FastCGImodule through IIS manager. According to Microsoft I need to rename php.ini-development to php.ini and point php to some DLL file.
I am using Windows 8, IIS 8.5 and PHP 5.6. I hope someone could point me in the direction.
You can set this up manually or with the IIS Manager. I would set this up my own, so you know whats going on.
You will need to setup the CGI role feature. This includes FastCGI. Here is some information how to do that: http://www.iis.net/configreference/system.webserver/cgi
Then you will need the PHP package somewhere. Lets say in C:\PHP. You can change that if you want.
You will need the fastCGI settings. You can easily set this up by commandline:
%windir%\system32\inetsrv\appcmd set config /section:system.webServer/fastCGI /+[fullPath='C:\php\php-cgi.exe',activityTimeout='1200',requestTimeout='1200',arguments='-c%20C:\php\php.ini']
This example uses a timeout of 20min.
This will set the handler:
%windir%\system32\inetsrv\appcmd set config /section:handlers /+[name='PHP_FastCGI',path='*.php',verb='*',modules='FastCgiModule',scriptProcessor='"C:\php\php-cgi.exe|-c%20C:\php\php.ini"',responseBufferLimit='0',resourceType='Either']
php.ini setup:
[cgi-fcgi]
fastcgi.impersonate=1
cgi.force_redirect=0
cgi.fix_pathinfo=1
For write access you will need to grant "modify" access for the the IURS.
More Information: http://php.net/manual/de/install.windows.iis7.php
I did try the answer posted to heart, but I kept running into problems. In fact, I also followed the Microsoft step by step PHP setup tutorial to the TEETH. I still couldn't get PHP working on my IIS. Although Microsoft warned against using Windows Platform Installer(WPI), I downloaded WPI and ran the installer. Under frameworks, I found PHP 5.6 and clicked on Add button. Then, clicked on the Install button. It took only about 30 seconds to install. Just to be sure. I checked IIS manager and there it was PHP Manager. After opening PHP manager I noticed that all the settings were there and enabled and it already had 15 different extension enabled. Plus, it also had about 35 extension disabled, but it gives you option to enable them right there.
Now, my PHP files are rendered as expected. I even did phpinfo(); and the browser displayed all the PHP settings and information. :)

Change PHP version in IIS 6

Trying to upgrade from PHP 5.2.5 to 5.2.17 (and then to 5.3.6 once that works) on IIS 6.0, installing the language itself runs just fine and I changed the PHP.ini/ect locations that IIS uses for PHP, everything still works but when I run PHP info on my site it still says it's running PHP 5.2.5. Restarted IIS, restarted the server even, no difference. What do I do to change which version/what location of PHP IIS is using?
When I install PHP 5.3.6 the site no longer works, so I know installing different versions is doing SOMETHING, but I think it might only be changing the PHP.ini my server is using, not the version of PHP.
In addition to installing the windows binary release of PHP I've also tried installing PHP from Microsoft's Web Platform Installer (both 5.3.6 and 5.2.17), after installing neither showed up as the current version in phpinfo either.
If you want to use php 5.3, you must install IIS FastCGI extension and run PHP as cgi script. From php 5.3 isapi is not supported. But everything works fine if you configure it, and as benefit you can use more php version simultaneously. IIS 6 is not a problem. Download PHP non thread safe.
For details see this, for example: http://learn.iis.net/page.aspx/247/using-fastcgi-to-host-php-applications-on-iis-60/
Download the latest VC11 x86 Non Thread Safe version of PHP from http://windows.php.net/download/
Once the zip is downloaded, right click on the zip file and select properties. Make sure you unblock the file.
Rename your current PHP folder to PHPold.
Find your php.ini file and rename it to phpold.ini
Extract the zip file to c:\temp\php.
Copy the php folder from c:\temp to wherever your old PHP folder was.
Go to your new php folder and copy php.ini-production and paste it to where your old php.ini file was
Rename php.ini-production to php.ini
On the server, make sure you have Notepad++ along with the Compare plugin. If you need the compare plugin, use these steps. http://www.davidtan.org/how-to-compare-two-text-files-using-notepad-plus/
In the location that stores your phpold.ini and php.ini, right click on each of those files and open them with Notepad++. On the php.ini, only make changes to the lines with the >> next to them.
Once the changes have been made, make sure you save php.ini.
Go to Services and restart IIS.
Solution has been to move to Apache in my case. IIS 7 has better tools but IIS has proven to be a poor environment for development in this case.

Apache/PHP fails to start on WinXP when activating MySQL extension

I've been incrementally setting up a web server for research and testing purposes. The "server" is running Windows XP and I initially installed Apache Server 2.2 and PHP 5.3. That's been working great for a while. I am now needing to setup MySQL which I downloaded and installed MySQL v5.5. I am able to interact with MySQL via the command-line interface. In the process of setting up phpMyAdmin, I have encountered difficulties getting PHP and Apache to play nice with MySQL. Here's what I've discovered and tried:
In the php.ini file, when I attempt to uncomment either the php_mysql.dll or the php_mysqli.dll extension and restart the Apache server, the server crashes when it starts. The Windows event viewer says Apache failed to start due to "faulting module php5ts.dll".
The extension_dir parameter is set to ".\ext" and the php_mysql.dll and php_mysqli.dll files are in that directory.
I have also tried copying the libmysql.dll file from the lib folder of the MySQL directory to the Windows\System32 directory (with no change in behavior).
I'm at a bit of a loss to figure out what the next step is. Any suggestions?
The extension it's looking for is an extension output by php at compile time based on your configured build options. It is not looking for the header files from mysql itself.
Also, ".\ext" is a relative path that may or may not be valid in your installation. You may need to re-compile php to include mysql and mysqli (you should also compile PDO support) into your php build (Or whatever the windows equivalent of re-compiling is).
Also, you should make extension_dir an absolute path not relative.

Installing PHP extensions on Windows

I am using a Windows XP Home Edition. I need to install a few extensions to PHP -- memcache, APC, .etc. And I would very much like to use PECL to make this happen. The problem is PECL takes it for granted that I will have certain programs on my computer. On another post, I read, for instance, that you need to have Microsoft Visual Studio C++ installed on your machine. However, the new version of Visual Studio, which I downloaded, does not have msdev.exe and instead uses vcbuild.exe, which has a completely different api and fails to compile the .dsp files that come with these modules.
So I tried to find a script that would upgrade the dsp to work with vcbuild.exe...and it turns out vcbuild.exe can do that, but of course that didn't pan out.
Another thing I tried was to find a make script for Windows (nmake2make). But there was no make file in the module's root folder.
I tried also downloading Cygwin and MinGW in hopes of finding a build script that would work as simply as in *nix operating systems, but to no avail.
How else do I use install PHP extensions on a Windows machine? Can anyone help me out of this predicament?
For all peoples coming here to download the dll extension files.
This is the link to the PHP extension download link http://windows.php.net/download/
And this is a list of PHP extensions to download: http://pecl.php.net/package-search.php
For core extensions, or if you cant find any on pecl.php.net, download PHP from a zip http://windows.php.net/download/ and look inside of /ext and copy them to your local php /ext folder.
The only way I can think of is: manually. Yeah, I know, but this is pretty easy comparatively.
If you have the compiler, then you can at least compile an extension if you have the source. Otherwise you're stuck with trying to locate a binary distribution (like me).
Here's what you do, from what I understand:
Put the extension library folder under PHP's install path. On my computer this is C:\xampp\php\ext. Search in your PHP.ini for "extension_dir" to find what yours is.
Edit php.ini to load the extension.
Find ; Dynamic Extensions ;.
Add line extension=my_lib.dll
This should do it. Otherwise you should probably search for an in-depth guide on manual installation.
For memcache you will need the memcache server located here -> http://code.jellycan.com/memcached/ and download the win32 binary
Never used APC :P I use eAccelerator0953_5.2.6 to cache the code

install php on server (iis6) when php already exists due to backup exec

I need to install or use php on a windows 2003 server that already has php 5.2.0.0 installed due (I think) to setting up symantec backup exec. I don't want to interfere with backup exec's php.ini settings - and would rather be able to control my own configuration of php.
searching for php shows that php.exe and other php files are currently installed in
c:\program files\symantec\backup exec\
I'm almost certain that installing the current version of php 5.2.8 to c:\php would be disastrous or calamitous in some way.
There is no PHPRC entry in the server properties > environment variables and I'm pretty sure that the php.exe location is not included in the PATH variable. ...unless the actuall install location is different from the c:\program files\symantec\backup exec\ dir.
Any suggestions on how to proceed?
I'm almost certain that installing the current version of php 5.2.8 to c:\php would be disastrous or calamitous in some way.
What makes you say that :) I've run separate PHP versions on the same machine side by side and not run into bother.
AFAIK the Symantec install should not conflict with your own installation, nor should the separate php.ini files conflict with each other.
[Response to comment]
First thing to note is that I have no experience of Backup Exec or what it uses PHP for. I'm guessing it uses it for its own internal stuff and doesn't spread itself over the OS. Test this by searching for php.ini and php DLLs on the file system. I'm betting it's all quite self contained. PHP searches for the config file as noted here: PHP Site . As you note, BE hasn't set the PHPRC variable. Check it hasn't used those Registry entries either. On a different tack, has BE installed an admin site already on IIS? If so, check the IIS Web Service Extensions to make sure it hasn't already registered the PHP ISAPI dll or PHP CGI exe. IF not, I think you should be okay for your new install.
To be on the safe side, do a manual PHP install as illustrated here: PHP Site. That way, you know exactly what you have installed, and can easily remove the files again if they cause a problem. I can't imagine a problem here that would require you to reinstall BE.

Categories