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

CentOS, can't load Phalcon after PDO - even with 30-phalcon.ini

Sorry if this has been answered before, but I just can't find a solution that works.

On my VPS I run CentOS with Apache and PHP 5.3.3 and I installed all the required packages, successfully built Phalcon and created a 30-phalcon.ini in /etc/php.d with the content extension=phalcon.so.

The problem is that it doesn't seem to work.

Loading the index gives an error: Fatal error: Class 'Phalcon\Loader' not found in /home/xxxxxxxxxxxx/subdomain/phalcon/www_data/index.php on line 6

Giving a random input to PHP in terminal gives the following error: [[email protected] phalcon]$ php asd PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/phalcon.so' - /usr/lib/php/modules/phalcon.so: undefined symbol: php_pdo_get_dbh_ce in Unknown on line 0

This must be the case when PDO is not loaded before Phalcon which should be solved by creating the ini file in php.d. But it is not.

Any idea?

Thanks, Martin

check if you have extension=phalcon.so in your php.ini file somewhere?



43.9k
Accepted
answer
edited Jun '14

I do not know how centOs is organizing php startup, ...

is there in /etc/php.d other startup files ? If not you should:

  • create a 10-pdo.ini with extension=pdo.so in it
  • create a 20-mysql.ini with extension=mysql.so in it
  • create a 20-pdo_mysql.ini with extension=pdo_mysql.so in it

Also I agree with digitronac double check your php.ini file

le51' answer was 90% correct. After renameing the mentioned (and json.ini) everything works now.

Thanks.



43.9k