- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我已经使用 EasyApache4 在 Centos 6.9 上运行的 VPS 服务器上安装了 7.1.7-1.1.1.cpanel
和 7.0.21-1.1.1.cpanel
。我有一个 Laravel API 和一个 Angular4 应用程序,我想在服务器上运行它们,但我在让 PHP 正常运行时遇到问题。使用 git 安装网站后出现错误;
could not find driver (SQL: select * from
site_menu_placements
whereactive
= 1)
我检查了 error_log,发现以下内容对我来说没有多大意义;
[22-Jul-2017 00:57:11 UTC] PHP Warning: Module 'pdo_sqlite' already loaded in Unknown on line 0
[22-Jul-2017 00:57:11 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_mbstring.dll' - /opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[22-Jul-2017 00:57:35 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo.dll' - /opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[22-Jul-2017 00:57:35 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_firebird.dll' - /opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_firebird.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[22-Jul-2017 00:57:35 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_informix.dll' - /opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_informix.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[22-Jul-2017 00:57:35 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_mssql.dll' - /opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_mssql.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[22-Jul-2017 00:57:35 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_mysql.dll' - /opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_mysql.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[22-Jul-2017 00:57:35 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_oci.dll' - /opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_oci.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[22-Jul-2017 00:57:35 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_oci8.dll' - /opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_oci8.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[22-Jul-2017 00:57:35 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_odbc.dll' - /opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_odbc.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[22-Jul-2017 00:57:35 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_pgsql.dll' - /opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_pgsql.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[22-Jul-2017 00:57:35 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_sqlite.dll' - /opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_pdo_sqlite.dll: cannot open shared object file: No such file or directory in Unknown on line 0
[22-Jul-2017 00:57:35 UTC] PHP Warning: Module 'PDO' already loaded in Unknown on line 0
[22-Jul-2017 00:57:35 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php71/root/usr/lib64/php/modules/pdo_mysql.so' - /opt/cpanel/ea-php71/root/usr/lib64/php/modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
[22-Jul-2017 00:57:35 UTC] PHP Warning: Module 'pdo_sqlite' already loaded in Unknown on line 0
[22-Jul-2017 00:57:35 UTC] PHP Warning: PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_mbstring.dll' - /opt/cpanel/ea-php71/root/usr/lib64/php/modules/php_mbstring.dll: cannot open shared object file: No such file or directory in Unknown on line 0
我认为该错误对应于 php_pdo_mysql.dll
没有正常运行。我检查了 phpinfo() 并发现主 php.ini 文件位于 /opt/cpanel/ea-php71/root/etc
我尝试在此文件中加载 PDO 模块,但使用即使我有也没有效果;
extension=pdo.so
extension=pdo_mysql.so
extension=pdo_sqlite.so
extension=mysql.so
当我查看 phpinfo() 页面时,我可以看到有一个名为“PDO”的部分,但在该部分中我只在 PDO 驱动程序行中看到 sqlite。我相信我也应该看到 mysql。
当我通过 ssh 运行 php artisan migrate
时,出现以下错误;
[Doctrine\DBAL\Driver\PDOException] could not find driver
[PDOException] could not find driver
我认为应该包含 pdo mysql 驱动程序的软件包是 ea-php71-php-pdo-7.1.7-1.1.6.cpanel.x86_64
我已经使用了 rpm - ql ea-php71-php-pdo-7.1.7-1.1.6.cpanel.x86_64
找出它的安装位置,我得到以下信息;
/opt/cpanel/ea-php71/root/etc/php.d/20-pdo.ini
/opt/cpanel/ea-php71/root/etc/php.d/20-sqlite3.ini
/opt/cpanel/ea-php71/root/etc/php.d/30-pdo_sqlite.ini
/opt/cpanel/ea-php71/root/usr/lib64/php/modules/pdo.so
/opt/cpanel/ea-php71/root/usr/lib64/php/modules/pdo_sqlite.so
/opt/cpanel/ea-php71/root/usr/lib64/php/modules/sqlite3.so
所以 pdo_mysql 丢失了。
最佳答案
按照说明进行操作:
第 1 步:在命令行上运行 pecl install pdo
第2步: 如果已经安装,只需编辑/etc/php.ini
第 3 步:添加以下行
; Extension PDO
extension=pdo.so
第二种方式:
首先安装php-mysql
sudo apt-get install php7.0-mysql
然后启用模块
sudo phpenmod pdo_mysql
并重新启动apache
sudo service apache2 restart
希望对您有帮助。
关于php - 使用 EasyApache4 在 CENTOS 6.9 上启用 PDO 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45249705/
我试图在我的服务器上运行 easyapache 并收到以下错误: !! Failed to install CPAN Perl module(s) Tie::IxHash Net::SSL Date:
我已经没有想法了,希望有人能帮助我。 我正在使用WHM,并使用EasyApache来启用zip。完成后,我的所有 mysql_connect 语句都停止工作。 因此运行一段基本代码,例如: 返回:“
我正在尝试在 cPanel 服务器上使用 easyapache 4 安装 mod_cloudflare for Apache。我运行的是 CentOS 7.2。 我已经按照选项 2 here 下的说明
cPanel 中 EasyApache 上的 Tomcat 突然停止工作,并在所有页面上抛出 404。 我尝试了通常的启动和停止 Apache HTTPD 和 Apache Tomcat Linux
Hai 我正在尝试在 centos 服务器中配置 php 处理程序 dso,但我遇到了这个错误 [root@2 ~]# /usr/local/cpanel/bin/rebuild_phpconf --
我需要在我的服务器上安装 php5.2 版本。现在 php 5.4 是安装的最旧版本。从2天开始。我在谷歌上搜索了很多,但还没有找到合适的指导。试了很多教程都没有用。任何建议或指导将不胜感激。谢谢 最
我是一名优秀的程序员,十分优秀!