Reputation: 1696
I create my project with Laravel 5.3 in localhost, after create I upload project in VPS, but after upload this error shows:
In localhost
:
PHP
version is: 7.0,
OS
: Ubuntu 16.04,
In VPS
:
PHP
version is: 7.0, OS
: Ubuntu server 16.04 and Mysql
is not install (The other server's database).
.env file in VPS:
DB_CONNECTION=mysql
DB_HOST=192.168.19.51
DB_PORT=3306
DB_DATABASE=flight
DB_USERNAME=*****
DB_PASSWORD=*****
Do I need to change the PHP
or VPS
or Laravel`?
EDIT 1:
config/database.php
:
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
],
Upvotes: 0
Views: 821
Reputation: 2299
PHP PDO Extension is not installed on VPS. Check this answer PDOException “could not find driver”
Just run on VPS
sudo apt-get install php7.0-mysql
Upvotes: 1