45

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.

Paulo Boaventura
  • 1,365
  • 1
  • 9
  • 29
Cole Roberts
  • 954
  • 3
  • 15
  • 25
  • 2
    There is not enough information given in this question. It is not possible to answer. – arkascha Jan 28 '13 at 05:34
  • it can be .htaccess or your url settings (like seo, url rewriting) in admin or clear your server and website cache. for this go to your server account and try to endweb process. – Rakesh Sharma Jan 28 '13 at 05:37
  • @arkascha Sorry, what other information should I provide? I appreciate your timely response. – Cole Roberts Jan 28 '13 at 05:49
  • _All_ information available: is that short string really _all_ you see? _Where_ do you see it? What is in the http servers log files? Access and error log? How does the `.htaccess` file you mention look like? What is the url you called? Or: what type of installer is that? ... – arkascha Jan 28 '13 at 05:56
  • 1
    I ran into this issue for me with Laravel and my local env. Solution was to reprovision vagrant: `vagrant reload --provision` – Connor Leech Jun 19 '19 at 13:52

13 Answers13

122

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.

Repox
  • 15,015
  • 8
  • 54
  • 79
  • 15
    Thanks! I had `RewriteRule ^(.*)$ /index.php/$1 [L]` (without question mark) in my .htaccess with ExpressionEngine on virtual shared hosting. That broke unexpectedly today with the error message from OP. I guess the web hoster updated something. `RewriteRule ^(.*)$ /index.php?/$1 [L]` (with question mark) fixed it. – Blaise Jul 18 '13 at 21:28
  • is there is any way to intercept this error and replace by custom message ? (nginx) thanks – warfish May 16 '14 at 00:30
  • 3
    I had: `RewriteEngine On` `RewriteCond %{REQUEST_FILENAME} !-f ` `RewriteCond %{REQUEST_FILENAME} !-d ` `RewriteRule .* index.php/$0 [PT]` ...and it worked when I've just changed the last line to: `RewriteRule ^(.*)$ index.php?/$1 [L]` – Andrade Aug 23 '14 at 13:55
  • 1
    Thank you so much for this! I'm upgrading a VERY old SlimPHP site that currently runs on PHP 5.3 and hit this issue. I was prepared for a long grind of googling but your fix solved it for me. – Sherri Aug 17 '21 at 17:06
26

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.ini file 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.

chetan
  • 261
  • 3
  • 2
  • 4
    Perhaps you'd like to bring in the relevant code and explain. If a link becomes obsolete then your answer will mean nothing to future visitors. – Dan Hanly Sep 23 '13 at 16:38
  • 3
    I tried your suggestion and it worked like a charm! Add `cgi.fix_pathinfo = 1` to your php5.ini file – victmo Sep 24 '13 at 17:13
  • What about an application running on a local server (Laragon), with `PHP7` , what is the equivalent of your solution in such a case? – Razvan Zamfir Aug 08 '19 at 13:39
14

In my case, there were an error in the php.ini open_basedir variable.

jbaylina
  • 4,408
  • 1
  • 30
  • 39
6

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>
webicy
  • 1,584
  • 1
  • 14
  • 16
3

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.)

DragonLord
  • 6,395
  • 4
  • 36
  • 38
3

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!

Community
  • 1
  • 1
jondinham
  • 8,271
  • 17
  • 80
  • 137
2

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

2

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.

Paulo Boaventura
  • 1,365
  • 1
  • 9
  • 29
2

disabling PHP-FPM fixed my issue.

Faiyaz Alam
  • 1,191
  • 9
  • 27
1

Run ulimit -n 2048

And restart php/php-fpm

Yarin Gold
  • 489
  • 1
  • 4
  • 17
0

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.

jason
  • 1,132
  • 14
  • 32
0

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
Accountant م
  • 6,975
  • 3
  • 41
  • 61
0

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.

Feridun
  • 137
  • 7