简体   繁体   English

PHP不会在Fedora 25上加载pdo_mysql扩展

[英]PHP won't load pdo_mysql extension on Fedora 25

After a little toying around with my FreePBX install on F25, I seem to have broken it, and can't get pdo_mysql to load: 在F25上安装FreePBX玩了一会儿之后,我似乎已经坏了,无法加载pdo_mysql:

[root@freepbx-localdomain freepbx] # /usr/bin/env php -m | grep -i pdo
PDO
pdo_sqlite

FreePBX's ./install errors out appropriately: FreePBX的./install错误被适当地排除:

Checking if Asterisk is running and we can talk to it as the 'asterisk' user...Done
Preliminary checks done. Starting FreePBX Installation
Checking if this is a new install...Yes (No /etc/amportal.conf file detected)
Database Root installation checking credentials and permissions..Error!
Invalid Database Permissions. The error was: could not find driver

Lastly, pdo_mysql is in the /etc/php.d directory: 最后,pdo_mysql在/etc/php.d目录中:

[root@freepbx-localdomain php.d] # ls *pdo_mysql*
30-pdo_mysql.ini

I'm struggling here, and about to do a clean CentOS install (and not run it on Fedora Workstation, which wasn't the best idea). 我在这里苦苦挣扎,准备进行一个干净的CentOS安装(而不是在Fedora Workstation上运行,这不是最好的主意)。 Ideas? 有想法吗?

Edit: While supposedly php.ini is no longer used to load extensions, I did try it anyways, adding: 编辑:虽然据说php.ini不再用于加载扩展名,但我还是尝试了一下,并添加了:

extension="pdo.so"
extension="pdo_mysql.so"

And now... 现在...

[root@freepbx-localdomain freepbx] # /usr/bin/env php -m | grep -i pdo
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo.so: undefined symbol: zend_new_interned_string in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_mysql.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/pdo_mysql.so: undefined symbol: mysqlnd_allocator in Unknown on line 0
PDO
pdo_sqlite

I have been fooling around with this issue a while and I think I solved it doing the following: 我一直在愚弄这个问题一段时间,我认为我可以通过以下方法解决它:

installed php mysql using this command in the terminal: 在终端中使用以下命令安装了php mysql:

dnf install  php-mysqlnd

then restarted apache with the following: 然后使用以下命令重新启动apache:

service httpd restart

for me, removing php and then installing again worked. 对我来说,删除php,然后再次安装有效。

Before that, I tried installing php-pdo but it did not work. 在此之前,我尝试安装php-pdo,但没有成功。 After reinstalling php, I removed php-pdo and php-mysqlnd; 重新安装php之后,我删除了php-pdo和php-mysqlnd; and it still worked. 而且仍然有效。 crazy! 疯!

after each installation/removal, restarted httpd. 每次安装/删除后,重新启动httpd。

Wasted more than an hour and mood on this! 浪费了一个多小时和心情!

sudo dnf -y remove php
sudo dnf -y install php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM