Tuesday, November 5, 2013

Fixing "no input file specified" error with .htaccess or php.ini


This error usually occurs on goDaddy hosting, because of the way they have PHP installed.

Method 1: Quick fix for Joomla and Magento on Apache server with .htaccess

The following method should work if you get "No input file specified" error message while installing a content management or eCommerce system on Apache server. It can be Joomla, Magento, or other platform that uses "index.php" as part of SEO friendly URLs.

Add the code below to your .htaccess file in the directory of your site on the server.

If you don't have .htaccess file there, just create a text file on your computer, paste the code, upload it to your server, and rename it to ".htaccess":

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^index.php/(.*)$ [L]


Note: if your site is not in the root of your domain name,
for example, in a subfolder named "yourdirectory":
http://yourDomain/yourDirectory/
then replace this:

RewriteBase /

with:

RewriteBase /yourDirectory/

Method 2: Fixing "No input file specified" error by editing php.ini file

The following should work if PHP runs in CGI mode, like on shared/Deluxe hosting from goDaddy.

Add the following to php.ini (or create a text file, paste the code, upload to the root directory of your site and rename it to php.ini):

cgi.fix_pathinfo = 1

Note for goDaddy users
If your site is hosted with goDaddy, the file should be named php5.ini.

If you uploaded a new php5.ini file, instead of editing the existing one, most likely it won't take effect right away, it should start working after the server is rebooted.

You may try to speed this up as explained here:
Why isn't my php.ini file taking effect?

7 comments:

  1. Hello!

    I've tried these fixes in as many different file paths and combinations that I can think of and nothing is working for me.

    http://websitecampaign.blogspot.co.uk/2013/11/fixing-no-input-file-specified-error.html#comment-form

    Heres my .htaccess (original file content)

    RewriteEngine On

    RewriteRule ^(assets).* $0 [L]

    RewriteRule ^(app|bootstrap|config|cron|error|messages)\.php$ - [F,L]
    RewriteRule ^(controller|helper|model|views) - [F,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule .* index.php/$0 [PT,L]

    And my file path on server is:

    [http://www.lunar-development.co.uk/Projects/SagepayPHPFormKit/demo/][1]

    When you click on form then it should open up the start of the shopping cart.

    Any chance you could help me out as I'm going nuts trying to figure it out..


    [1]: http://www.lunar-development.co.uk/Projects/SagepayPHPFormKit/demo/

    ReplyDelete
    Replies
    1. Hello Lewis, I've just checked, but couldn't see the error on your page.

      Delete
    2. Thanks a lot. I have removed all .htaccess code form my file and then pasted the above code, worked like charm.

      Delete
  2. Thanks for sharing such beneficial information with us. Your article is truly extremely agreeable while perusing and please continue sharing more.

    Website Fix | Fix Hacked Site | Shopping Cart Repair

    ReplyDelete
  3. I read that Post and got it fine and informative. Please share more like that...
    Laravel Development Services | Angularjs Development Services

    ReplyDelete
  4. If you are searching for a top and affordable digital marketing and web and mobile apps development services provider company in Lucknow, then contact us, we offer very cheap price development services. Our experts have rich experience in webs and mobile apps development services.

    Web Development Services Company | Mobile Apps Development Company | SEO Services Company in Lucknow

    ReplyDelete