Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel artisan migrate fail

I am getting this problem: http://pastebin.com/B5MKqD0T

PHP Fatal error: Uncaught TypeError: Argument 1 passed to Illuminate\Exception\WhoopsDisplayer::display() must be an instance of Exception, instance of ParseError given

But I have no clue how to fix it, I am new to laravel and composer etc.

I am using laravel 4.0 (because I'm following and old tutorial of my friend)

like image 521
Jacob Lane Avatar asked Jan 02 '16 17:01

Jacob Lane


People also ask

Does php artisan migrate delete data?

php artisan migrate:fresh is used when we want a fresh or new installation of our database. It deletes all the existing tables of the database and runs the migrate command.

What is php artisan migrate rollback?

By default, php artisan migrate:rollback will rollback all of your database migrations. By specifying --step=1 , you're saying that you only want to rollback the latest database migration. Plus, if you change the number, e.g. into --step=2 , you're telling Laravel to only rollback the last two migrations.

What does php artisan migrate -- force do?

php artisan migrate --force publishes schema to the database, even in production. migrate --force ensures that the migrations are published even when the application is in product mode. php artisan migrate:rollback reverses the last migration batch.

Can I delete migration file Laravel?

If you've only created the migration and you've not executed the php artisan migrate command, all you would need to do to remove the migration is to delete the file. You could do that via your text editor or the command line with the rm command.


1 Answers

ParseError was introduced in PHP 7. In other hand you're using Laravel 4 which has no PHP7 support.

Laravel 5.1 is the first version of Laravel to support PHP 7.

So, there's 2 solutions:

  1. upgrade Laravel to >= 5.1 (strongly recommend this!)
  2. downgrade PHP to 5.*

Read more about throwable exceptions in PHP7: https://trowski.com/2015/06/24/throwable-exceptions-and-errors-in-php7/

like image 186
Limon Monte Avatar answered Oct 06 '22 03:10

Limon Monte