3

I have a peculiar situation that is only happening on the root domain and NOT subdomains.

For example, CraftCMS (2.6.3019) running on Apache with php-fpm works fine on dev.some-domain.tld and test.some-domain.tld, but for www.some-domain.tld it fails with:

In browser:

No input file specified

In cPanel Apache log (/usr/local/apache/error_log):

[Fri Aug 03 13:59:12.42352 2018] [proxy_fcgi:error] [pid 31552:tid 132443556343644] [client xxx.xxx.xxx.xxx:55292] AH01071: Got error 'Unable to open primary script: /home/USERNAME/public_html/production/current/html/index.php (No such file or directory)\n'

For identical installations for other subdomains, everything loads up and works great. There is no difference in .htaccess or otherwise.

The only differential that we can figure must be something with how Apache's handling the root document location or permissions for the root domain... but we're not seeing anything.

For good measure, here's the .htaccess contents (that are identical on the working subdomains and this failing root domain):

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 year"
</IfModule>

<IfModule mod_php5.c>
    php_flag zlib.output_compression on
</IfModule>

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
    Header append Vary User-Agent env=!dont-vary
</IfModule>

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
    RewriteCond %{HTTPS} !=on
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
</IfModule>

I thought that perhaps it was the cgi.fix_pathinfo=1 setting for the php.ini, but that also didn't resolve this.

cPanel support is saying it is absolutely a code issue, but we're pretty much convinced it's an Apache / cPanel issue. It would be nice to have some input on this since this particular incident of No input file specified does not seem to match the others already found here and elsewhere on the web.

4

It turned out that the problem was from customizing the domain's document root in the userdata files and then the PHP-FPM configuration had not been rebuilt and the service not restarted. The following resolved the issue:

/scripts/php_fpm_config --rebuild
/scripts/restartsrv_apache_php_fpm

It's interesting since there are a broad variety of issue that seem to cause this No input file specified issue, but they all mostly revolve around Apache config issues.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.