We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

php_pdo_get_dbh_ce error when running CLI app

When trying to run a command line file, I'm getting this error:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/phalcon.so' - /usr/lib/php5/20100525/phalcon.so: undefined symbol: php_pdo_get_dbh_ce in Unknown on line 0

I've seen that others are having this issue when trying to run Phalcon via Apache, and the suggested solution was to make sure phalcon.so was loaded after the PDO functions. I've done that as you can see here:

lrwxrwxrwx 1 root root 29 Jun 17  2013 10-mysqlnd.ini -> ../mods-available/mysqlnd.ini
lrwxrwxrwx 1 root root 25 Jun 17  2013 10-pdo.ini -> ../mods-available/pdo.ini
lrwxrwxrwx 1 root root 26 Jun 17  2013 20-curl.ini -> ../mods-available/curl.ini
lrwxrwxrwx 1 root root 24 Jun 17  2013 20-gd.ini -> ../mods-available/gd.ini
lrwxrwxrwx 1 root root 26 Jun 17  2013 20-ldap.ini -> ../mods-available/ldap.ini
lrwxrwxrwx 1 root root 28 Jun 25  2013 20-mcrypt.ini -> ../mods-available/mcrypt.ini
lrwxrwxrwx 1 root root 30 Jun 17  2013 20-memcache.ini -> ../mods-available/memcache.ini
lrwxrwxrwx 1 root root 28 Jun 17  2013 20-mysqli.ini -> ../mods-available/mysqli.ini
lrwxrwxrwx 1 root root 27 Jun 17  2013 20-mysql.ini -> ../mods-available/mysql.ini
lrwxrwxrwx 1 root root 31 Jun 17  2013 20-pdo_mysql.ini -> ../mods-available/pdo_mysql.ini
-rw-r--r-- 1 root root 20 Apr 16 11:00 30-phalcon.ini
-rw-r--r-- 1 root root 60 Apr  3  2012 imagick.ini

I should mention that I'm not having this problem when trying to use Phalcon on the web - just in the CLI application. Calling phpinfo() from the CLI application shows that Phalcon is loaded, and all the proper .ini files have been loaded as well

I tried for 1/2 an hour to fix this before I posted. 3 minutes after posting, I found the solution - I had extension=phalcon.so in my main php.ini file, in addition to being in the separate 30-phalcon.ini file. That caused the Phalcon extension to be loaded too soon. Removing the line from the main php.ini file fixed the problem

removing the "extension=phalcon.co" does not work for me, any help? I already change the priority in conf.d folder, to 50-phalcon.co



98.9k

It must be:

extension=phalcon.so

removing the "extension=phalcon.co" does not work for me, any help? I already change the priority in conf.d folder, to 50-phalcon.co