If you’ve recently updated your local Laravel environment to PHP 7.3, you might have noticed that php artisan tinker no longer works!
You can open tinker, but as soon as you type anything it just shuts down, like this:
Don’t worry. There’s an easy fix. We just need to add one line to your php.ini file.
First, let’s find your php.ini
Let’s use VIM to make a quick change. If your path is different than the one in my screenshot, use whatever you see there.
cd / cd usr/local/etc/php/7.3 vi php.ini
Thanks to this GitHub issue we know the code we need to add to your .ini file is the following
So let’s just insert it right at the top:
If you don’t know how to use VIM, you can edit this with a text editor.
Now that this is done, just go back to your repository and open up tinker again. You should be able to run commands again!
Happy tinkering, and let me know if you have any questions!