PHP error: “No input file specified.” in IIS 10.0, PHP 5.6 on local development server

iisPHP

I've got an issue with my development server. Running Win 10 Pro, IIS 10.0.16299, PHP 5.6 (installed to C:\Program Files (x86)\PHP\v5.6). This is a recent issue; PHP used to work just fine, but then it just stopped working.

All my PHP apps are now returning the error, "No input file specified". These apps are within "Default Web Site," but are located elsewhere (with my work stuff). They are configured in IIS, and sharing should be set up properly (since everything used to work).

Here's what I've tried, per all of the information I've found online. Nothing's worked, however:

  • Uninstalled and reinstalled IIS from Control Panel | Programs and Features | Turn Windows Features on and off. After reinstalling, added FastCGI handler to IIS, pointing to C:\Program Files (x86)\PHP\v5.6\php-cgi.exe. Also double-checked that the PATH includes the PHP directory.
  • Replaced php.ini (in the 5.6 directory) with the development copy, and updated these lines to the following:

    doc_root = "C:\inetpub\wwwroot"
    
    cgi.force_redirect = 0
    

    …and ran iisreset (per https://support.qualityunit.com/428346-I-see-error-No-input-file-specified-on-IIS-server).

  • Scanned my disk for errors, ran a full virus scan, checked my hosts file to make sure nothing's amiss.

I've also read over the info in this question, but I'm afraid a lot of it went over my head. I'm a programmer who occasionally works in PHP, I'm afraid, not a system administrator.

One other note: While my php apps all return this error, the C:\inetpub\wwwroot\phpinfo.php file does not (this file has one line of code: phpinfo();). That file works.

Update

When I put a "hello world" php file in the C:\inetpub\wwwroot directory, it works. But the same file causes the problem error in my website: C:\Users\Katie\Documents\Work\Website Working Copy\. This directory is mapped to a web application within "Default Web Site" in IIS. IUSR and IIS_IUSRS have permissions to this folder. Is there anything from phpinfo() that, if I shared it, might shed light on why this is happening?

Update

I've completely replaced the PHP installation with the newest non-thread-safe version of PHP 5.6.

This is the php.ini file now in C:\Program Files (x86)\PHP\v5.6 (minus all of the commented stuff):

[PHP]

engine = On
short_open_tag = Off
asp_tags = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = 17
open_basedir = "C:\inetpub\wwwroot"
disable_functions =
disable_classes =
zend.enable_gc = On
expose_php = On

; Resource Limits ;
max_execution_time = 30
max_input_time = 60
memory_limit = 128M

; Error handling and logging ;
error_reporting = E_ALL
display_errors = On
display_startup_errors = On
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
track_errors = On
html_errors = On
error_log = "php_errors.log"

; Data Handling ;
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 8M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"

; Paths and Directories ;
doc_root =      ; Have also tried doc_root = "C:\inetpub\wwwroot" -- no change
user_dir =
extension_dir = "ext"
enable_dl = Off
cgi.force_redirect = 0
cgi.fix_pathinfo=1
fastcgi.impersonate = 1
fastcgi.logging = 0

; File Uploads ;
file_uploads = On
upload_max_filesize = 2M
max_file_uploads = 20

; Fopen wrappers ;
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60

; Dynamic Extensions ;
extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_intl.dll
extension=php_imap.dll
extension=php_interbase.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll      ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client
extension=php_openssl.dll
extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
extension=php_pdo_oci.dll
extension=php_pdo_odbc.dll
extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
extension=php_pgsql.dll
extension=php_shmop.dll

; Module Settings ;

[CLI Server]
cli_server.color = On

[Date]
date.timezone = "America/Chicago"

[filter]

[iconv]

[intl]

[sqlite3]

[Pcre]

[Pdo]

[Pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=

[Phar]

[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = On

[SQL]
sql.safe_mode = Off

[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1

[Interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
ibase.dateformat = "%Y-%m-%d"
ibase.timeformat = "%H:%M:%S"

[MySQL]
mysql.allow_local_infile = On
mysql.allow_persistent = On
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off

[MySQLi]

mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off

[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = On

[OCI8]

[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0

[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10

[bcmath]
bcmath.scale = 0

[browscap]

[Session]
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatibility_mode = Off
mssql.secure_connection = Off

[Assertion]

[COM]

[mbstring]

[gd]

[exif]

[Tidy]
tidy.clean_output = Off

[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5

[sysvshm]

[ldap]
ldap.max_links = -1

[mcrypt]

[dba]

[opcache]

[curl]

[openssl]

I have a test PHP file as follows:

<html>
<head>
    <title>PHP Test</title>
</head>
<body>
    <?php echo '<p>Hello World</p>'; ?> 
</body>
</html>

So, to reiterate, the issue is that, when this file is in C:\inetpub\wwwroot\, and access through http://mymachinename/temphello.php, it works correctly. But when it's in one of the virtual directories (actually, applications) I've set up through IIS underneath "Default Web Site," and access through http://mymachinename/applicationname/temphello.php, it returns, "No input file specified."

I need PHP to work, regardless of where the virtual directory is located. I know this is possible, because it worked for years, until last week when it mysteriously stopped working as soon as I cleared my application cache.

Update

Commenting out doc_root in the php.ini file turned out to be a step in the right direction. It now works in virtual directories that are located in my Documents folder. But I'm still getting the error in my development websites, which are located in my OneDrive folder. I suppose I could make copies in my Documents and use those for development, but I'd really like to avoid that, if there's something I'm missing.

Best Answer

After much beating my head against the wall, I finally found that it was all due to a bug with PHP and OneDrive. https://bugs.php.net/bug.php?id=75384

Upgraded PHP to the latest version, and also turned off the OneDrive setting, "Save space and download files as you use them." Rebooted, and it finally worked.

Related Topic