Avatar of PeterJanssens
PeterJanssens asked on

PHP Windows - "no input file specified error" - virtual directory

I install PHP on Windows Server 2003.
Everything works fine with pages under the root dir (d:\inetpub).
But I get the error "non input file specified error" when trying to execute PHP in a virtual directory.
Somebody made the remark to change from CGI to ISAPI version? Is this the solution? ISAPI is still considered as risky, as mentionned in the install instructions.

Thx in advance, Peter.
PHPWeb Languages and Standards

Avatar of undefined
Last Comment
Richard Quadling

8/22/2022 - Mon
Richard Quadling

The ISAPI version allows persistent database connections which is a good thing if your app has a LOT of DB scripts.

The CGI version does have the constant loading/unloading overhead to deal with, but is a separate thread.

Personally, IIS is the issue. Drop IIS and use Apache or Sambar Server. Both are free. I use Sambar (and have done for MANY years). The only stability issue is with poorly written PHP code. And only during testing. Once testing is complete, I use PHP and Delphi based ISAPI dlls quite happily.

Our customer support team can install Sambar Server, PHP and our webapp in about 10 minutes. Getting IIS up and going is a real pain, especially when they have someone on site who has played with it and not sure what they've done.

To answer your question though, I suspect that the virtual directory needs to be told that php files are to be handled by the PHP executable or ISAPI filter.

Richard.
ASKER
PeterJanssens

I changed CGI version to ISAPI version, and the problem was solved, although I do not know why.
ASKER CERTIFIED SOLUTION
Richard Quadling

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
John-Doe

It is the setting for doc_root php.ini that causes it.

If you set it to be doc_root php.ini = "[Drive-Letter]:\YourWebPath\" or comment it ;doc_root php.ini = it solves the problem..
(Yes and ofcourse restartt IIS - that are easiest done with cmd line -> iisreset /RESTART  )

Br
  -JD
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
John-Doe

Hmm,.. sorry - slip of the pen:

  doc_root IN THE php.ini file and set it to be doc_root = ... IN THE php.ini file works a bit better..

:P

And also: read documentation regarding security..

Br
 -JD
Promethyl

This solution helped me as well. (Removing the line, not fixing the pathing. Do you have to escale the backslashes?)
jsm11482

Commenting out the doc_root worked for me! Thanks!
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
malboteju

I am running w2k8 R2 and am having the same issue tried commenting out the php.ini doc_root no lock any pointers ???
Richard Quadling

Wow. What a long time ago and how things have changed.

Now, IIS7+FastCGI+PHP using FastCGI is the way to go.

Very reliable. Officially supported by Microsoft (for those that must have that).

All in all, a much better setup than ISAPI or standard CGI.

And with Microsoft's Web Platform Installer being able to install FastCGI _AND_ PHP all from IIS, it really couldn't be easier for Windows users.