Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

SimonAngatia's avatar

php artisan serve error: could not find the input file.

I am in the project directory but when I run php artisan serve I get this error that Could not open input file: artisan. I was initially working but then when I walk up this morning and did the command to begin working on the project I encountered the error! Please, someone, help me know where the problem might be.

0 likes
17 replies
Sinnbeck's avatar

Can you run ls -laand post the result? If on windows run dir

SimonAngatia's avatar

$ ls -la total 983 drwxr-xr-x 1 admin 197121 0 Aug 15 20:48 ./ drwxr-xr-x 1 admin 197121 0 Aug 15 23:49 ../ -rw-r--r-- 1 admin 197121 250 Aug 15 10:08 .editorconfig -rw-r--r-- 1 admin 197121 790 Aug 15 20:51 .env drwxr-xr-x 1 admin 197121 0 Aug 15 11:37 .git/ -rw-r--r-- 1 admin 197121 116 Aug 15 10:08 .gitattributes -rw-r--r-- 1 admin 197121 191 Aug 15 10:08 .gitignore -rw-r--r-- 1 admin 197121 467 Aug 15 10:08 .htaccess drwxr-xr-x 1 admin 197121 0 Aug 15 11:37 app/ -rwxr-xr-x 1 admin 197121 1739 Aug 15 10:08 artisan* drwxr-xr-x 1 admin 197121 0 Aug 15 11:37 bootstrap/ -rw-r--r-- 1 admin 197121 0 Aug 15 10:08 chat.txt -rw-r--r-- 1 admin 197121 1609 Aug 15 13:51 composer.json -rw-r--r-- 1 admin 197121 207448 Aug 15 20:48 composer.lock drwxr-xr-x 1 admin 197121 0 Aug 15 11:37 config/ drwxr-xr-x 1 admin 197121 0 Aug 15 11:37 database/ -rw-r--r-- 1 admin 197121 1769 Aug 15 10:08 package.json -rw-r--r-- 1 admin 197121 508151 Aug 15 10:08 package-lock.json -rw-r--r-- 1 admin 197121 1167 Aug 15 10:08 phpunit.xml drwxr-xr-x 1 admin 197121 0 Aug 15 20:58 public/ drwxr-xr-x 1 admin 197121 0 Aug 15 11:38 resources/ drwxr-xr-x 1 admin 197121 0 Aug 15 11:38 routes/ -rw-r--r-- 1 admin 197121 59 Aug 15 10:08 serve.bat -rw-r--r-- 1 admin 197121 584 Aug 15 10:08 server.php drwxr-xr-x 1 admin 197121 0 Aug 15 11:38 storage/ drwxr-xr-x 1 admin 197121 0 Aug 15 20:48 vendor/ -rw-r--r-- 1 admin 197121 60 Aug 15 10:08 watch.bat -rw-r--r-- 1 admin 197121 1081 Aug 15 10:08 webpack.mix.js -rw-r--r-- 1 admin 197121 213175 Aug 15 10:08 yarn.lock

Sinnbeck's avatar

Your artisan file seems to have a * in the name?

mv artisan* artisan
Sinnbeck's avatar

Rename the artisan file to not have a *in the name

SimonAngatia's avatar

How do I rename it? I am renaming but when I do ls -la it still has the asterisk( *)

Sinnbeck's avatar

What if you check the folder using the folder viewer in your os? Does it still have a *? Or only when using ls?

SimonAngatia's avatar

The way it appears in the folder it doesn't have the asterisk

Sinnbeck's avatar

Ok not related then I think.

What happens if you run

./artisan
SimonAngatia's avatar

It takes a very long time to run those command and then it says the input file could not be found

Sinnbeck's avatar

Did you try simply rebooting the computer?

SimonAngatia's avatar

Now when I run it, it executes without doing anything. It doesn't start the server

Sinnbeck's avatar

Do you have other laravel projects? Do they work?

SimonAngatia's avatar

I have. I have tried on them too but it doesn't' work too.

Sinnbeck's avatar

What is your user called? admin? Seems that user owns all files

Please or to participate in this conversation.