我想在ubuntu服务器18 LTS中部署我的laravel应用。所以我已经安装了nginx postgres php。但是,当我尝试执行php artisan migrate
时,出现此返回错误:
This is the errror (a picture beacose of comande line)。
所以我已经验证了另一件事:首先,我可以使用postgres用户访问本地主机中的数据库。laravel应用程序无需数据库即可工作。
在php.ini中,我没有注释extention=pdo-pgsql;
和extention=pgsql
我已使用此命令sudo apt-get install php7.2-pgsql
安装php postgres sql扩展名
这是我在laravel中数据库的.env设置:
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5433
DB_DATABASE=THERY //I have already create the database
DB_USERNAME=postgres
DB_PASSWORD=postgres
您的问题可能有不同的问题。可能发生以下任何情况:
apt-get install php-pgsql
composer require asmiarowski/laravel-postgres // There are multiple librariies available in packagist
php artisan config:cache