'No input file specified
I'm running Anchor CMS and I just upgraded to version 0.8. When I try and run the installer I get a 'No input file specified' error. I believe it's more than likely a .htaccess problem but I'm not sure what the correct settings should be.
My site can be found here.
My .htaccess is set to:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase {base}
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule ^(.*)$ {index} [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 index.php
</IfModule>
I'm also using a GoDaddy as the hosting provider if that helps.
Solution 1:[1]
The No input file specified is a message you are presented with because of the implementation of PHP on your server, which in this case indicates a CGI implementation (can be verified with phpinfo()).
Now, to properly explain this, you need to have some basic understanding on how your system works with URL's. Based on your .htaccess file, it seems that your CMS expects the URL to passed along as a PATH_INFO variable. CGI and FastCGI implementations do not have PATH_INFO available, so when trying to pass the URI along, PHP fails with that message.
We need to find an alternative.
One option is to try and fix this. Looking into the documentation for core php.ini directives you can see that you can change the workings for your implementation. Although, GoDaddy probably won't allow you to change PHP settings on a shared enviroment.
We need to find an alternative to modifying PHP settings
Looking into system/uri.php on line 40, you will see that the CMS attempts two types of URI detection - the first being PATH_INFO, which we just learned won't work - the other being the REQUEST_URI.
This should basically, be enough - but the parsing of the URI passed, will cause you more trouble, as the URI, which you could pass to REQUEST_URI variable, forces parse_url() to only return the URL path - which basically puts you back to zero.
Now, there's actually only one possibilty left - and that's changing the core of the CMS. The URI detection part is insufficient.
Add QUERY_STRING to the array on line 40 as the first element in system/uri.php and change your .htaccess to look like this:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
This will pass the URI you request to index.php as QUERY_STRING and have the URI detection to find it.
This, on the other hand, makes it impossible to update the CMS without changing core files till this have been fixed. That sucks...
Need a better option?
Find a better CMS.
Solution 2:[2]
Citing http://support.statamic.com/kb/hosting-servers/running-on-godaddy :
If you want to use GoDaddy as a host and you find yourself getting "No input file specified" errors in the control panel, you'll need to create a
php5.inifile in your weboot with the following rule:
cgi.fix_pathinfo = 1
best easy answer just one line change and you are all set.
recommended for godaddy hosting.
Solution 3:[3]
In my case, there were an error in the php.ini open_basedir variable.
Solution 4:[4]
I had the same problem. All I did to fix the issue was to modify my htacces file like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /crm/
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^mywebsite.com [NC]
RewriteRule ^(.*)$ http://www.mywebsite.com/$1 [L,R=301]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^index.php/(.*)$ [L]
</IfModule>
Solution 5:[5]
GoDaddy is currently (Feb '13) supporting modification of FastCGI for some accounts using PHP 5.2.x or earlier. See GoDaddy article "Disabling FastCGI in Your Hosting Account".
(In my case, this is apparently necessary to help get the current version of LimeSurvey (2.0) towards a running state.)
Solution 6:[6]
Adding php5.ini doesn't work at all. But see the 'Disable FastCGI' section in this article on GoDaddy: http://support.godaddy.com/help/article/5121/changing-your-hosting-accounts-file-extensions
Add these lines to .htaccess files (webroot & website installation directory):
Options +ExecCGI
addhandler x-httpd-php5-cgi .php
It saves me a day! Cheers! Thanks DragonLord!
Solution 7:[7]
It worked for me..add on top of .htaccess file. It would disable FastCGI on godaddy shared hosting account.
Options +ExecCGI
addhandler x-httpd-php5-cgi .php
Solution 8:[8]
disabling PHP-FPM fixed my issue.
Solution 9:[9]
Update
All the previous reviews were tested by me, but there was no solution. But I did not give up.
SOLUTION
Uncomment the following lines in my NGINX configuration
[/etc/nginx/site-avaible/{sitename}.conf]
The same code should follow in the site-enable folder
#fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;
And comment this:
fastcgi_param SCRIPT_FILENAME / www / {namesite} / public_html $ fastcgi_script_name;
I changed several times from the original:
#fastcgi_pass unix: /var/php-nginx/9882989289032.sock;
Going back to this:
#fastcgi_pass 127.0.0.1:9007;
And finally I found what worked ...
fastcgi_pass localhost: 8004;
I also recommend these lines...
#fastcgi_index index.php;
#include fastcgi_params;
And even the FastCGI timeout (only to improve performance)
fastcgi_read_timeout 3000;
During the process, I checked the NGINX log for all modifications. (This is very important because it shows the wrong parameter.) In my case it is like this, but it depends on the configuration:
error_log/var/log/nginx/{site}_error_log;
Test the NGINX Configuration
nginx -t
Attention this is one of the options ... Well on the same server, what did not work on this site works on others ... So keep in mind that the settings depends on the platform.
In this case it was for Joomla CMS.
Solution 10:[10]
Run ulimit -n 2048
And restart php/php-fpm
Solution 11:[11]
The solution for me was to remove white space in one of my helper files. The error listed two pages involved, a CI session file and one of my custom helpers.
Solution 12:[12]
In my case, I fixed it by butting the rules inside a LocationMatch Directive
<LocationMatch "^/.">
#your rewrite rules here
</LocationMatch>
/. matches any location
I have the rewrite rules inside one of the .conf files of Apache NOT .htaccess file.
I don't know why this worked with me, this is my current setup
- Apache version 2.4
- PHP 7.1
- OS Centos 7
- PHP-FPM
Solution 13:[13]
In my case giving a correct path to the root element in Nginx config.
changing root D:/fridoon/test/public; to root D:\fridoon\test\public; solved the issue.
then restart Nginx and php.
I am using Nginx in windows with Thinkcmf.com Chinese content management Framework. and also delete .user.ini file in the public directory some time this caused the above subject error.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
