5

I am developing a RESTful web application in PHP. What I have got is:

  1. on the test server, Windows 7 / Apache 2.2 / PHP 5.2.9 (mod_php)
  2. on the production server, Windows Server 2003 / IIS6 / PHP 5.2.4 (php5isapi.dll)

While the test environment has got no problem, the production server fails to send any RESTful request with pathinfo (i.e., pages like e.g. /mypath/app.php/controller/id, where the handling script is /mypath/app.php) and gives a nice blank page with the message:

No input file specified. 

Using firebug, I can see the response headers are:

HTTP/1.1 404 Undescribed
Proxy-Connection: close
Connection: close
Via: 1.1 XXXXX
Date: Thu, 23 Jun 2011 14:51:18 GMT
Content-Type: text/html
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET, PHP/5.2.4

Where XXXXX is the name of the proxy.

I googled around and it seems like neither SO nor the rest of the web can give practical solutions to this problem. Any clue?

Since the production server needs to keep up, reinstalling PHP and/or IIS is not an option. What I can do is modify IIS/PHP configuration, and restart IIS.

Thanks in advance,

Paolo

Paolo Stefan
  • 10,112
  • 5
  • 45
  • 64

3 Answers3

3

@hakre posted a good answer, but it was another thing that solved this issue, which I report briefly to save hours of pain to others...

I got rid of the problem by:

  • editing php.ini on the production server, commenting out the doc_root=... line;
  • restarted IIS;
  • launched services.msc on the production server, restarted the "World Wide Web Publishing Service";

now, all pages work just fine reporting PATH_INFO correctly.

Thanks for the answers anyway!

If anyone cares, this page illuminated me.

Paolo Stefan
  • 10,112
  • 5
  • 45
  • 64
2

Un-check the Verify that file exists check-box.

That's an option in the Internet Information Services Manager you can find in the Web Sites Properties Home Directory Configuration for the .php Application Mapping.

Edit the mapping for the website in question and disable the file existance check. Then pathinfo should work as expected.

More Info

Salman A
  • 262,204
  • 82
  • 430
  • 521
hakre
  • 193,403
  • 52
  • 435
  • 836
  • Thanks for the answer, I tried doing so, restarted IIS, also unchecked "Cache ISAPI extensions", restarted again, but nothing changed. I cannot even get a simple page, say /phpinfo.php/pathinfo_test to be recognized. Same error: 404 Undescribed header. – Paolo Stefan Jun 28 '11 at 10:40
1

try rewrite support using ISAPI_REWRITE(http://www.isapirewrite.com/)

hanguofeng
  • 49
  • 2
  • As I stated in my question I cannot install additional libraries on the production server. Moreover, the one you mention is a commercial product so this is not a viable solution. – Paolo Stefan Jun 23 '11 at 15:40
  • so ,try to configure the 404 document and makes everyone request to that file and process in that file. – hanguofeng Jun 23 '11 at 15:51