我在 ubuntu 中使用 xampp,当我进行 php artisan 迁移时,它显示 PDO 异常找不到驱动程序
然后解决这个问题
我向我展示了安装 mbstring、php_curl 等,我已经安装了 mbstring,然后在安装 php_curl 时出现错误无法定位
root@allau-Inspiron-5558:/home/allau# sudo apt-get install php5-curl
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php5-curl
当我输入 php --ini 时,它显示以下内容
root@allau-Inspiron-5558:/home/allau# php --ini
Configuration File (php.ini) Path: /etc/php/7.0/cli
Loaded Configuration File: /etc/php/7.0/cli/php.ini
Scan for additional .ini files in: /etc/php/7.0/cli/conf.d
Additional .ini files parsed: /etc/php/7.0/cli/conf.d/10-opcache.ini,
但是我在ubuntu中使用xampp,我猜它指向/etc/php/7.0的php.ini,但我想使用/opt/lampp的php我该怎么做?
请帮忙
最佳答案
您通过 CLI 使用的 PHP 与 XAMPP 使用的 PHP 不同。 XAMPP 自带 PHP,如果您想通过 CLI 运行该 PHP,而不是通过 Ubuntu 运行该 PHP,那么您应该将其添加到您的 PATH 中:
nano ~/.bashrc
然后在文件末尾添加这一行:
导出 PATH=/opt/lampp/bin:$PATH
...并保存(ctrl+o
-> enter
-> ctrl+x
)
关于php - Laravel - php artisan 迁移问题 - 找不到驱动程序 - ubuntu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36868404/