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

seanwu's avatar

php artisan command not showing any errors

Hi guys, I have my Laravel 5.1 set up on an apache server, which runs fine and error messages are showing in the browser. However, when I run php artisan commands, whenever it encounters an error, it would just fail and give me back the command line prompt.

Is there a way to make it show the error messages in my terminal?

Thanks in advance.

0 likes
5 replies
willvincent's avatar

Are you running CentOS? Apparently they ship their cli php configured so that it can't display errors without forcing it to with a command line flag.

php -d display_errors artisan

You might want to make an alias for php that appends the display_errors flag..

in .bashrc or whereever you define your aliases;

alias phpe="php -d display_errors"

Then (after logging out and back in, or sourcing the file you just edited source .bashrc for example) you should be able to just do:

phpe artisan

and get errors displayed, or php artisan to not see errors.. if you always want to display errors, on the cli, no matter what.. just create the alias thusly:

alias php="php -d display_errors"
willvincent's avatar

Hmm.. interesting that you wouldn't be seeing errors in terminal on a mac.. Then again, I personally am running a new-ish version of php installed by homebrew, and may well have tweaked my config at some point. :)

seanwu's avatar

Unfortunately php -d display_errors artisan did not work for me, I can't remember if I made any config changes, I'll try reinstall it to see if that works.

seanwu's avatar

It turns out that there was no php.ini loaded in the system, I created one based on a sample and it worked. Thanks for the help @willvincent

Please or to participate in this conversation.