[英]PHP Warning: PHP Startup: Unable to load dynamic library phalcon.so: undefined symbol: php_pdo_g$
I have PHP Version 5.6.29 and i have to install phalcon 2.0.10 and also tried with phalcon 2.0.13 version on ubuntu14.04 system. 我有PHP版本5.6.29,我必须安装phalcon 2.0.10,并且还尝试在ubuntu14.04系统上使用phalcon 2.0.13版本。 But i am getting below error in apache error log
但是我在Apache错误日志中遇到以下错误
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/phalcon.so' - /usr/lib/php/20131226/phalcon.so: undefined symbol: php_pdo_g$
PHP警告:PHP启动:无法加载动态库'/usr/lib/php/20131226/phalcon.so'-/usr/lib/php/20131226/phalcon.so:未定义符号:php_pdo_g $
So please help me here. 所以请在这里帮助我。
undefined symbol: php_pdo_g
未定义符号:php_pdo_g
Looks like you do not have pdo extension. 看起来您没有pdo扩展名。 Or refer to the: Why does Phalcon 2 raise "undefined symbol: php_pdo_get_dbh_ce in Unknown on line 0" warning?
或参考以下文章: 为什么Phalcon 2会引发“未定义的符号:第0行上的Unknown中的php_pdo_get_dbh_ce”警告?
As you have apache2 at ubuntu 14.04 I assume, that you have probably added 当您在ubuntu 14.04上拥有apache2时,我认为您可能已经添加了
extension=phalcon.so
in wrong file. 在错误的文件中。 There are a couble of configuration files for PHP in ubuntu at path
/etc/php5
. ubuntu中的
/etc/php5
路径下有大量PHP配置文件。 Mine tree looks like this: 矿树看起来像这样:
/etc/php5$ tree
.
├── apache2
│ ├── conf.d
│ │ ├── 05-opcache.ini -> ../../mods-available/opcache.ini
│ │ ├── 10-pdo.ini -> ../../mods-available/pdo.ini
│ │ ├── ...
│ │ └── 21-phalcon.ini -> /etc/php5/mods-available/phalcon.ini
│ └── php.ini
├── cli
│ ├── conf.d
│ │ ├── 05-opcache.ini -> ../../mods-available/opcache.ini
│ │ ├── 10-pdo.ini -> ../../mods-available/pdo.ini
│ │ ├── ...
│ │ └── 21-phalcon.ini -> /etc/php5/mods-available/phalcon.ini
│ └── php.ini
└── mods-available
├── ...
└── phalcon.ini
As you can see, in mods-available
folder there is a phalcon.ini
file, which holds extension=phalcon.so
line. 如您所见,在
mods-available
文件夹中有一个phalcon.ini
文件,其中包含extension=phalcon.so
行。 Than in other folders there are symlinks to it. 比在其他文件夹中有符号链接。 Don't forget about the number on the begining of symlink name.
不要忘记符号链接名称开头的数字。 In documentation they write sometimes that it should be named
30-phalcon.ini
etc. Case is that it should be loaded after all other extensions to satisfy Phalcons requirements, and the highest number at first part of filename is used for that, as extensions are loaded in ascending order based on filenames. 他们在文档中有时会写为它应命名为
30-phalcon.ini
等。这种情况是,应在所有其他扩展名之后加载它以满足Phalcons的要求,并使用文件名开头的最高编号,因为扩展名是根据文件名升序加载。
To fix your problem you should remove extension line from php.ini file and put it in dedicated file in mods-available/
directory, and after that link it with proper filename in all conf.d/
folders. 要解决您的问题,您应该从php.ini文件中删除扩展线,并将其放在
mods-available/
目录中的专用文件中,然后将其与所有conf.d/
文件夹中的正确文件名链接。
Tutorial how install phalcon: https://www.digitalocean.com/community/tutorials/how-to-install-and-get-started-with-phalcon-on-an-ubuntu-12-04-vps 教程如何安装Phalcon: https ://www.digitalocean.com/community/tutorials/how-to-install-and-get-started-with-phalcon-on-an-ubuntu-12-04-vps
You should php.ini edit and Apache restart: 您应该php.ini编辑并重新启动Apache:
sudo service apache2 restart
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.