2

I'm running a site under IIS with PHP running in CGI mode. PHP was installed to a pre-existing site so a handler was setup for .html files to be parsed by PHP as well as .php files.

When a non-existent page with a .php extension is requested, a 404 is thrown and user is redirected to the custom 404 page, however when a non-existent page with a .html extension is requested the "No input file specified." error is shown.

I've searched this error and found potential solutions for similar issues but nothing that solves this particular boggle. Any ideas or pokes in the right direction would be much appreciated!

Rich Jenks
  • 1,723
  • 5
  • 19
  • 32

2 Answers2

4

Try the Invoke handler only if request is mapped to file option for the handler under request restrictions.

Matt Whipple
  • 7,034
  • 1
  • 23
  • 34
  • 3
    IIS 7 > Site > Handler Mappings > Edit handler > Request Restrictions > Mapping tab > Check "Invoke Handler only if request is mapped to:" > Select "File or folder" – Rich Jenks Sep 23 '14 at 13:53
  • Also take care with open_basedir directive on your main php.ini config file. If you are using it, make sure to include all physical paths to your desired files. In development environment you can safely comment it with ;open_basedir – Alejandro Quiroz Jan 06 '17 at 21:45
  • 2
    This doesn't work for me. It was already same but I still get this error. – Riz Dec 01 '18 at 19:35
1

First. Open "PHP Manager" and check warnings in yellow there. Follow advice there. There is a helpful page to resolve such issues from Microsoft at https://www.iis.net/learn/application-frameworks/install-and-configure-php-on-iis/using-php-manager-for-iis-to-setup-and-configure-php

Second. Check permissions to the folder of the app. User running AppPool should be given an access.

Hope it helps someone wandered here!

Artyom
  • 3,507
  • 2
  • 34
  • 67
  • Worked for me. Some of those recommended options change what data php fastcgi is provided in regards to url. – przemo_li Mar 05 '21 at 12:12