Solved

Install PHP on Windows 2003 IIs x64

Posted on 2009-03-30
23
2,414 Views
Last Modified: 2013-12-13
Hi

This a simple question.

How to configure the PHP in the Windows 2003?? And a x64 server is an extra :)

To run this i know that i need to run

CSCRIPT ADSUTIL.VBS SET W3SVC/AppPools/Enable32bitAppOnWin64 1

But the issue here is run the php.

I have follow all the steps that i find in the Internet, but still i cant get this to work

I create a web extension with the php.exe file, and  nothing. I have change the php.ini, and still cant get this to work

I have a server with this, then the server dead, now i create a new one and cant get the php to work.

After i change some settings, and create a file teste.php with:

<?php
// Show all information
phpinfo();
?>
and in the browser localhost/teste.php

I cant get nothing, no error, but still no information.

I am missing something, but i cant figure out what

Thank you

Jail
0
Comment
Question by:Luciano Patrão
  • 13
  • 6
  • 4
23 Comments
 
LVL 50

Expert Comment

by:Steve Bink
ID: 24028664
What other configuration have you done?  Did you restart after enabling 32-bit apps?  Have you added php.exe or the ISAPI dll as a filter?  Have you made sure the IIS service user has adequate permissions to your PHP directory?  Have you added the PHP directory to your path?  Have you set the force_redirect option to 0 in php.ini?  Have you set your document root properly in php.ini?  Have you added PHP as a valid web service extension?

Most importantly, have you read and followed the instructions in both of these pages:

http://www.php.net/manual/en/install.windows.manual.php
http://www.php.net/manual/en/install.windows.iis.php
0
 
LVL 22

Author Comment

by:Luciano Patrão
ID: 24029684
Hi

Thank for the reply

I will try to answer all your questions
 
-  What other configuration have you done?  

I have tried severak. But the last was FastCGI

I have fastCGI, and the webPI for the configurations, and no luck

-  Did you restart after enabling 32-bit apps?  

Nope. This i neve did. I always enable and try to run php. Do you thing this may be a diffenrece?

-  Have you added php.exe or the ISAPI dll as a filter?  

I have tried with both ways.

-  Have you made sure the IIS service user has adequate permissions to your PHP directory?  

No i did not confirm that. But since this was a instaltion with webpi, or just msi, i think i do not need.

-- Have you added the PHP directory to your path?

YEs

-- Have you set the force_redirect option to 0 in php.ini?  

Yes

-  Have you set your document root properly in php.ini?  Have you added PHP as a valid web service extension?

YES i have tried to use dll, or exe as the web service extension.

I think the problem in where is the x64 server. I am not a php expert, but i have done this before, but never in a x64. Since i have no restart the server after enabling the 32 bit, maybe this was the reason.

Jail
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 24031621
Restarting can't hurt, and it's always a good idea to restart services when you make a configuration change.  IIRC, setting an environment variable (like PATH) does not take effect until the system is rebooted...don't quote me on that, though.  

Checking the permissions on the .exe/.dll folder can't hurt either.  Remember that you will need to allow permission to the same user listed on the application pool's identity tab.  By default, that should be "Network Service".  You can also try the IUSR account, but I'm pretty sure you need the application pool user.

Does a normal .htm file work as expected in the same directory?

Do your event logs show any events when you try to browse to a PHP page?
0
 
LVL 22

Author Comment

by:Luciano Patrão
ID: 24035569
Hi

Yes html pages work. I have some sites that just use html, and they are all working.

I have some changes. Add the I_USR to the php folder

If i use cgi.exe or just the php.exe as a filter i get

The HTTP Filter DLL C:\PHP\php-cgi.exe failed to load.  The data is the error.

and

Could not load all ISAPI filters for site/service.  Therefore startup aborted.

If i use dll, i get

The script started from the URL '/index.php' with parameters 'option=com_rss&feed=RSS2.0&no_html=1' has not responded within the configured timeout period.  The HTTP server is terminating the script.

and

The HTTP Filter DLL C:\PHP\php5.dll failed to load.  The data is the error.

Since this a Virtual Server, i will create another Windows 2003 server, now only with 32 bit.

And see if the problem is the server is 64 bit

Jail
0
 
LVL 40

Expert Comment

by:RQuadling
ID: 24044351
What version of PHP are you using?

http://windows.php.net/snapshots/ contains 32/64 thread-safe/non-thread-safe versions.

 
0
 
LVL 22

Author Comment

by:Luciano Patrão
ID: 24044801
Hi

What is the difference between the safe and the non safe?

Jail
0
 
LVL 40

Expert Comment

by:RQuadling
ID: 24047338
0
 
LVL 22

Author Comment

by:Luciano Patrão
ID: 24056152
Hi

First the msi files from the http://windows.php.net/snapshots, dont work.

I have download the 64 bit with zip option, and manually install.

But i get the problems :(

If i use the filters, i get in the event viewer

Could not load all ISAPI filters for site/service.  Therefore startup aborted.
The HTTP Filter DLL C:\PHP\php5.dll failed to load.  The data is the error.

If i remove the filter, and just use php extension, if i ass the .exe, i get nothing. Just a page error. A¬ny of the exe, if i use the php5.dll file i get "The specified procedure could not be found. "

I have made the path changes, the permissions change, the ini changes, and still this PHP dont work :(

I am still trying in the 64 bit server.

Any ideas?

Jail
0
 
LVL 40

Expert Comment

by:RQuadling
ID: 24057756
There is no ISAPI anymore for PHP 5.4 You have to use FastCGI. Which is why I've moved to IIS7 now.
0
 
LVL 40

Expert Comment

by:RQuadling
ID: 24057764
0
 
LVL 22

Author Comment

by:Luciano Patrão
ID: 24058100
Hi

But i am in Windows 2003, and IIs 6

Cant move to 2008.

I have installed the FasCGI in this server.

Since i have FastCGI, i dont use filters?? Is that right?

And in my Web extension file i use php5.dll, or other exe? In my installations i have php.exe, php-win.exe an php-cgi.exe. Withc this must i use in the extensions(if i need to use this), and witch i use in the Aplications Extension?

This php installation is driving me crazy :(

I will upload my php.ini just to confirm my settings

Jail
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 22

Author Comment

by:Luciano Patrão
ID: 24058103
Hi

Cant upload the ini file? Even if I zipped?

Jail
0
 
LVL 22

Author Comment

by:Luciano Patrão
ID: 24058155
Hi

I have renamed the ini to txt

Jail
php.zip
0
 
LVL 40

Accepted Solution

by:
RQuadling earned 250 total points
ID: 24058988
For the fast cgi, you use php-cgi.exe

I don't know about the front end stuff of IIS yet, so the terminology is all very "Microsoft" and not Sambar/Apache/etc.

0
 
LVL 22

Author Comment

by:Luciano Patrão
ID: 24062471
Hi

Still doesn't work :(

Jail
0
 
LVL 40

Expert Comment

by:RQuadling
ID: 24064609
And what do you get to see? I've only just started using IIS7 with PHP. IIS6 is a complete unknown to me.
0
 
LVL 50

Assisted Solution

by:Steve Bink
Steve Bink earned 250 total points
ID: 24065866
When you add PHP to a web site in IIS6, do not add it through the 'ISAPI Filters' tab.  You'll need to create an application root for the site.  For PHP, this should be done from the document root of the web site.  I'm not sure what kind of consequences exist for using a subdirectory instead of the document root.  Right-click the site in IIS6, select 'Properties', switch to the 'Home Directory' tab, and create the application if it has not been done already.  If you'd like to run the site in its own application pool, be sure to create the pool first and it will appear in the "Application Pool" dropdown.  Give the application a name, and set the "Execute Permissions" dropdown to at least "Scripts Only".  Now click the "Configuration" button.

The new dialog, titled "Application Configuration", should start on the "Mappings" tab, which is where you add the PHP extensions to your site.  Check the list in the top box to make sure they do not already exist.  If they do, either edit the existing entry, or delete it and remake it.  When creating the entry, the first textbox, "Executable", should point to the .exe or .dll you intend to use for script processing.  If you want the FastCGI model, point it to php-cgi.exe.  If you want the ISAPI model, point it to php5isapi.dll.  You can set the "Verbs" option to "All verbs" unless you have a reason not to.  At a minimum, you should be allowing the GET, POST, and HEAD verbs.  Since PHP is a script engine, make sure the "Script Engine" box is checked.  Finally, check the "Verify that file exists" box.  This forces IIS to check for 404 and permissions issues before calling the interpreter, thus preventing some rather unfriendly errors such as no HTML headers being sent.

That sets up the site.  Now you need to make sure the proper permissions are in place.  In IIS, go to "Application Pools", and find the pool you used for the site.  Right-click it, and select "Properties".  On the "Identity" tab, you'll either see it using a system account (the top option, which defaults to "NETWORK SERVICE"), or you can make it use a local user account of your choosing.  IMPORTANT: if you choose "Configurable", you MUST provide a password even if you use a system account.  A blank password will not work unless the user's password is really blank.  Generally speaking, the default setup of IIS gives NETWORK SERVICE the proper permissions in the appropriate c:\inetpub directories.  You should only need to change this if you want to isolate how the site runs, or change the directories from which the site pulls resources.  Once you know the user it will be using, go to your document root in Windows Explorer and make sure that user has MINIMUM read/execute permissions on it.  Push inheritance down for the entire directory tree from the document root.  Any directories holding files that must be written by your application will need modify access allowed for the same user.

Finally, you'll need to make sure that PHP is enabled in the Web Service Extensions section of IIS.  In that section, add an entry for "PHP", and make sure all the calling methods you need are listed.  For example, in a shared server environment, I list both php-cgi.exe and php5isapi.dll, since some sites prefer one over the other.  As long as the method you registered with the site is also allowed here, you should be good to go.  If your entries already exist, go into the properties to ensure the individual file is not prohibited.  It can appear as "Allowed" on the main list, while the individual file is not.

Just to be safe, restart.

Assuming you have set IIS to run 32-bit, and your PHP force_redirect option is set properly, you should now be able to see PHP pages from your server.

0
 
LVL 22

Author Comment

by:Luciano Patrão
ID: 24070037
Hi

routinet thanking for the message, and step by step

I have already follow that steps, i have double check that, and all is the same :(

Still get Error 404 de HTTP, running a php test page.

<?php
phpinfo();
?>

Do you thing the problem is the php.ini? Is the only thing that i can remember, since all the other configuration is like that.

PS: I am running now in a 32bit Server

Jail
0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 24070315
That's the strange thing.  If it was just that PHP wasn't working, you would get a 500 error (Internal Server Error), or an application error.  A 404 means it is not finding the page.  That could be permissions, or just something simple like a typo in the name.  Double-check all the permissions.  If you still can't find anything, download http://live.sysinternals.com/procmon.exe and find out what is actually being requested/denied.
0
 
LVL 22

Author Comment

by:Luciano Patrão
ID: 24071333
Hi

In the 32 bit server the problem is resolved. In the php.ini, after I remove the

doc_root = c:\inetpub\wwwroot // for IIS/PWS

The problem was revolved.

Now i am tring to make it work in the 64 bit server. Since i do not want to server(one with webmail, and other with the other sites), i will try in this server.

I have made the same changes, but until now did not work.

My last option is to leave the 32 bit server working.

Jail
0
 
LVL 22

Author Comment

by:Luciano Patrão
ID: 24083300
Hi

In the 64 bit server php is running.

The same problem, remove the doc_root, from the php.ini and all work.

So much time, and the doc_root was the problem :(

Jail
0
 
LVL 22

Author Comment

by:Luciano Patrão
ID: 24112859
Hi

Ok the problem is resolved and i will close this question.

Since anyone give the right answer i will split the points just for your suport.

I think i dont like in this question/answer, is when we suport a user to try to help, and then he just close/delete the question, just because he found the solution, or the problem is resolved with other solution.

I think in most cases the Expert deserve the points, just to put the user in the right track, or just for the support. Not in all the cases, but in most of them.

But that is just me, and my opinion.

Regarding my problem, i just need one little support on an issue.

How can i disable the error_reporting in the php.ini??

I have tried several ways, but none of them work. And then the php page give time out, or

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.

My last change was to error_reporting(E_ERROR | E_WARNING | E_PARSE)

And still no work, and some error.

If i comment the  error_reporting, is ok but too i get too many

Strict Standards: Non-static method JLoader::import() should not be called statically

Is there any other way to disable this type of report?

Thank you

Jail
0
 
LVL 22

Author Comment

by:Luciano Patrão
ID: 24113428
Hi

Problem resolved.

error_reporting = E_ALL & ~E_NOTICE

Not error_reporting(E_ALL & ~E_NOTICE)

Thank you both for the support

Jail
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now