"host" (DB_HOST) must be "127.0.0.1", not "localhost" ... done =) also, using MySQL (integrated on the VM)
Nov 17, 2015
1
Level 1
php artisan clear-compiled is trying to read databases before phpunit
I'm starting to work in CI with Semaphoreci ( https://semaphoreci.com ) and the instruction for the process are very simple:
- In a Ubuntu VM, php 5.6 server, do a pull from Git
- Run "composer install --prefer-source"
- Run "phpunit"
The problem appear on 2), after installing dependencies from the lock file, Laravel execute the command "php artisan clear-compiled" AND the error appears:
Generating autoload files
> php artisan clear-compiled
[Illuminate\Database\QueryException]
SQLSTATE[HY000]: General error: 1 no such table: users (SQL: XXXX)
When executing the same commad on local, having the same variables and the database in 'driver' => 'sqlite' it finish fine:
Generating autoload files
> php artisan clear-compiled
> php artisan optimize
Generating optimized class loader
Compiling common classes
The command should be fine, the fix is not "delete the command", is there any other way?? because I can't get to the 3) command "phpunit" and there the DB magic happens.
Level 1
Please or to participate in this conversation.