|Hardware Problems | Software Problems|
PHP Gives "No input file specified" Error With IIS
Problem: When running a PHP script with IIS a "No input file specified" error is shown.
Operating System: Windows 2000 Professional with service pack 4.
Background: A website I was making that uses PHP would only show "No input file specified" whenever I tried to open a PHP page in my browser. This problem only occurred with one website, all other websites that used PHP functioned properly.
Resolution Steps: I first looked in the IIS management console (Start => Settings => Control Panel => Administrative Tools => Internet Services Manager) and compared the settings for the troublesome site with a known good site. All of the settings were identical.
Some research then lead me to look at the php.ini file and in particular the doc_root setting. I had the following setting:
The comments above this setting say:
I'm using PHP in ISAPI mode on my development workstation, not CGI, so I tried commenting out the setting so it looked like this:
and then I restarted IIS by opening a command prompt (Start => Programs => Accessories => Command Prompt) and type the command:
This fixed the problem!
Recommended Reading For PHP Programmers: Programming PHP
Send Feedback to Murray
Copyright © 2001-2017 Murray Moffatt
Did you find my site useful? You can show your thanks
by making your next Amazon purchase through this website.
It won't cost you any extra and Amazon will pay me a small commission.