Bobcares

Laravel could not open input file artisan – How we fix it

by | Mar 17, 2020

Have you just got the Laravel error could not open input file artisan?

Usually, the error shows up when a user tries to open the Laravel project outside the project folder.

At Bobcares, customers often approach us to fix Laravel errors, as a part of our Server Management Services.

Today, let’s see how our Support Engineers fix this Laravel error.

 

Laravel application structure

Laravel is a PHP framework for web application development. A composer is a tool that integrates the dependencies and libraries.

It includes the dependencies in the composer.json file. This file is usually placed in the source folder.

Laravel has a command-line interface. This is known as Artisan. It has a set of commands to assist web application development. To start the Laravel service, we use the command,

php artisan

But in some cases, this ends up in errors. Our customers often approach us to fix errors while accessing the artisan console. Today, let’s discuss one such error.

 

Laravel error could not open input file artisan

Could not open input file: artisan

This is a very common error message that a Laravel user gets.

Usually, users get this error while trying to access a project using the command, php artisan. In the command-line, the error appears as,

aravel could not open input file artisan

Now let’s see why does this error appears.

 

1. Wrong console location

This error mainly occurs when a user tries to open a Laravel project outside the project folder. Laravel can only execute the project if we open it inside the project folder.

That is what the error says ‘could not open input file‘. So whenever customers approach us with this error, we ask the customer to re-check the location where they execute the command.

 

2. Improper permissions of artisan

Sometimes the artisan may not be executable. If the user tries to execute the command, it cannot access it. And the user receives this error.

So to make artisan executable, we use the command

chmod +x artisan

Later try to use the command, and it will work.

 

[Still, having trouble in loading your Laravel project? – We can help you.]

 

Conclusion

So far we saw the reasons for the Laravel error could not open input file artisan. Incorrect console location and improper permissions trigger the error. We also saw how our Support Engineers fix it.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

5 Comments

  1. Kuol

    Actually for me I don’t have the Author folder in my controllers folder. So I decided to use the php artisan:auth to create that inside my folder and the command was showing me “can not open input file”

    Reply
    • Sijin George

      Hello Kuol,
      The Auth folder will be located at App\Http\Controllers\Auth. Looks like there is something wrong in the command that you used to create auth file. This depends on the Laravel version that you are using. If you need further assistance, we’ll be happy to talk to you on chat (click on the icon at right-bottom).

      Reply
  2. Ars

    Thanks!
    Indeed terminal was set to htdocs instead of actual laravel project div.

    Reply
  3. Fahad Muzzamil

    Worked, Thanks.
    Please mak esure everybody to get to the exact project directory where all the files exist and project created.

    Reply
    • Hiba Razak

      Hi Fahad,
      Thanks for the feedback.We are glad to know that our article helps you solves the issue ?

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF