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

Error Installing: php_pdo_get_dbh_ce

My buddies trying to install Phalcon locally on his Ubuntu 12 x64 .

However he gets this error when restarting apache:

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

You need to load PDO first before Phalcon.

In your computer, have a look at the /etc/php5/apache2filter/conf.d/ folder

The ini file that loads phalcon should be prefixed to a number higher than the one PDO is. So in my system I have:

20-pdo_mysql.ini 50-phalcon.ini

That should make it work :)

Hey, I'm the one having the issue. I think the first issue was that there wasn't a phalcon.ini file linked in the /etc/apache2/conf.d/ folder. I created a symlink for it named 50-phalcon.ini but when I restart apache I still get the same issue. I don't get any errors when install as per the install log: https://gist.github.com/dansackett/9763173 so I'm not sure where the issue is...



151
Accepted
answer

I followed https://forum.phalcon.io/discussion/1899/-solved-can-t-upgrade-to-phalcon-1-3-0 and reinstalled php, apache, and mysql and then reinstalled phalcon and all was good to go.

No need to reinstall, in centos you must include extension=phalcon.so after extension=pdo_mysql.so in /etc/php.d/pdo_mysql.ini

This setup is really killing me.. I guess in 1.2.6, there was no issue like this arise. It just happened in 1.3.x I'm going crazy over this for almost 2 days now!

@javier maties - there is no pdo_mysql.ini in /etc/php.d/ because I get all my php and other modules from REMI. In remi, there is no pdo-mysql BUT pdo-mysqlnd

I'm going to kill myself now.. I'm using CentOS and boy... can't find a solution to this. Maybe I should re-install and see what happen

Search the correct file with: find . -type f -exec grep -l "pdo_mysql.so" {} \;

I solved it! @Dan and the rest of them is correct that it should be reinstalled. But in my case, I just reinstalled the HTTPD and it was all good!

I just wanted to add my experience here so that it could help someone else if they were encountering the same problems.

Reinstalling twice did not work for me, so I tried to work out why phalcon directive in php.ini was being loaded before pdo.so and I noticed this in the ini file:

;;;; ; Note: packaged extension modules are now loaded via the .ini files ; found in the directory /etc/php.d; these are loaded by default. ;;;;

So I went into /etc/php.d and created a file called phalcon.ini. Inside this file I added extension=phalcon.so and restarted apache.Phalcon is up and running.

CentOS6.5 PHP5.5 Apache2.2



60

Greate!! I solved it.

I just wanted to add my experience here so that it could help someone else if they were encountering the same problems.

Reinstalling twice did not work for me, so I tried to work out why phalcon directive in php.ini was being loaded before pdo.so and I noticed this in the ini file:

;;;; ; Note: packaged extension modules are now loaded via the .ini files ; found in the directory /etc/php.d; these are loaded by default. ;;;;

So I went into /etc/php.d and created a file called phalcon.ini. Inside this file I added extension=phalcon.so and restarted apache.Phalcon is up and running.

CentOS6.5 PHP5.5 Apache2.2

Same as @Dan, I just reinstall PHP and then reinstalled phalcon and all worked OK.

edited May '15

I also prefixed the ini with high enough number (50-phalcon.ini)

Debian 7 php 5.5

I just wanted to add my experience here so that it could help someone else if they were encountering the same problems.

Reinstalling twice did not work for me, so I tried to work out why phalcon directive in php.ini was being loaded before pdo.so and I noticed this in the ini file:

;;;; ; Note: packaged extension modules are now loaded via the .ini files ; found in the directory /etc/php.d; these are loaded by default. ;;;;

So I went into /etc/php.d and created a file called phalcon.ini. Inside this file I added extension=phalcon.so and restarted apache.Phalcon is up and running.

CentOS6.5 PHP5.5 Apache2.2

edited Jul '15

I resolved my issue following these steps below:

1 locate phalcon.ini

2 found - /etc/php5/apache2/conf.d/20-phalcon.ini

3 locate phalcon.so

4 found - /usr/lib/php5/20121212/phalcon.so

5 sudo gedit /etc/php5/apache2/conf.d/20-phalcon.ini

6 extension = /usr/lib/php5/20121212/phalcon.so

7 apache restart.

Could be helpful as well, you have to load msql.so first. Solution is next

  1. vi /etc/php5/mods-available/mysql.ini 2 after extension=mysql.so put extension=phalcon.so

solved on Debian.

Solved too. I didn't create "/etc/php5/apache2/conf.d/30-phalcon.ini" as mentioned into the documentation : https://docs.phalcon.io/en/latest/reference/install.html#debian-ubuntu. I just added "extension=phalcon.so" into "/etc/php5/mods-available/mysql.ini" and restarted apache2.

Now I can use "phalcon commands"

@+

Could be helpful as well, you have to load msql.so first. Solution is next

  1. vi /etc/php5/mods-available/mysql.ini 2 after extension=mysql.so put extension=phalcon.so

solved on Debian.

Followed these steps. Replaced directory name (numbered) with actual value in my machine. Worked perfectly.

I resolved my issue following these steps below:

1 locate phalcon.ini

2 found - /etc/php5/apache2/conf.d/20-phalcon.ini

3 locate phalcon.so

4 found - /usr/lib/php5/20121212/phalcon.so

5 sudo gedit /etc/php5/apache2/conf.d/20-phalcon.ini

6 extension = /usr/lib/php5/20121212/phalcon.so

7 apache restart.