Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Ubuntu: How to enable phalcon for PHP Cli

Hello,

I tried running this command and it fails.

Command

sudo /usr/bin/php /usr/share/nginx/myapp/cli/app.php main

Error Message

PHP Fatal error:  Class 'Phalcon\Config' not found in  ...

I am thinking i need to enable phalcon for php cli. How do i do that in ubuntu?

edited May '16

Just edit /etc/phpX/cli/php.ini and add extension=phalcon.so at end of it



12.1k

Hi! thanks for the fast reply. i added it and restart php-fpm.

Got this error below

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

You need to load pdo too before loading phalcon.



12.1k
edited May '16

You need to load pdo too before loading phalcon.

Hi i have set the priority, but it doesnt seems to be working as well. any ideas?

http://i.imgur.com/m5gfwjp.png

I have both PDO and Phalcon at priority 20.

It's working fine with:

20-phalcon.ini

Post your actual phalcon.ini contents, and check this:

file /usr/lib/php5/20131226/phalcon.so



99.6k
Accepted
answer
edited May '16

But you just posted conf.d content from FPM, post result from CLI maybe ? Im guessing you don't even load pdo in cli.



12.1k

But you jsut posted conf.d content from FPM, post result from CLI maybe ? Im guessing you don't even load pdo in cli.

Thanks for the help! Stamster too!

I managed to resolve it last night, but it's too late, so didn't post back. Wojciech was right!

So, what i simply did is to create another symbolic link into cli and it works.

Thanks much guys. This community is awesome. :D

That's the reason why you should always keep your extensions in /etc/php/5.x/mods-available/ And then symlink from both /etc/php/5.x/fpm/ and /etc/php/5.x/cli/



12.1k

That's the reason why you should always keep your extensions in /etc/php/5.x/mods-available/ And then symlink from both /etc/php/5.x/fpm/ and /etc/php/5.x/cli/

thanks!!