[DOCKER] laravel migration failed story

migration failed and I got an error, so share the solution. What I wanted to do was add a users table. So I ran the following command.
php artisan make:migration create_users_table
 // Create users table

Error details Apparently, it's an undefined constant.
 ErrorException 
  Use of undefined constant JSON_INVALID_UTF8_SUBSTITUTE - assumed 'JSON_INVALID_UTF8_SUBSTITUTE'

When I searched on the net, it was a problem with the PHP version. It's an error that appears only in PHP 7.2 or later When I checked the version, it was PHP 7.1.

In the first place, I migrated outside the docker container. So, into the docker container

PHP version was 7.4

And migration passed safely! !!

Recommended Posts

laravel migration failed story
Story when migration could not be done