Installing Phalcon PHP Devtools: "ERROR: Phalcon extension isn't installed ..." though the module is installed

automatix picture automatix · Apr 22, 2014 · Viewed 8.7k times · Source

After some days ago I installed Phalcon PHP, I am more and more exited about it. Now I want to try the Phalcon Devtools out. I've just installed it like in the installation manual via Composer (for Linux) shown. But when I try to execute the phalcon command, I get an error:

$ phalcon commands
ERROR: Phalcon extension isn't installed, follow these instructions to install it: http://docs.phalconphp.com/en/latest/reference/install.html

What can be the problem?

(Environment: Debian GNU/Linux 7.4 (wheezy), PHP 5.5.11-1).


Additional information:

I installed Phalcon PHP like in the docu shown:

$ apt-get install php5-dev libpcre3-dev gcc make php5-mysql
$ git clone --depth=1 git://github.com/phalcon/cphalcon.git
$ cd cphalcon/build
$ ./install

Since it seemed to not work, I tried it with

$ cd cphalon/build/64bits
$ export CFLAGS="-O2 --fvisibility=hidden"
$ ./configure --enable-phalcon
$ make && make install

After that the module was compiled and the phalcon.so created in the PHP modules direcroty /usr/lib/php5/20121212. Then I created the INI file /etc/php5/mods-available/phalcon.ini (with content extension=phalcon.so) manually and enabled it with a symlink: ln -s /etc/php5/mods-available/phalcon.ini /etc/php5/fpm/conf.d/20-phalcon.ini. And after a restart it worked. I created a "Hello World!" application and the module was also displayed in the phpinfo() output:

enter image description here

But the output of php --modules does not contain "phalcon". And the output of get_loaded_extensions() does not contain it as well. Why?

Answer

automatix picture automatix · Apr 23, 2014

The answer to both questions (1. Why do I get an error? and 2. Why php --modules doesn't show the module, though phpinfo() (in browser) does?) is the same: I enabled the module for FPM, but didn't do this for the CLI.

$ ln -s /etc/php5/mods-available/phalcon.ini /etc/php5/cli/conf.d/20-phalcon.ini

Now it works!