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

StackOverflow https://stackoverflow.com/questions/23230995

Question

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?

Was it helpful?

Solution

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!

OTHER TIPS

I had the same problem on Windows 10 with WAMP installed. I shows on the phpinfo() but on the command prompt is gives the error.

When you enter c:\>php -m to show the available php modules its not there...

First look where your php.ini file is with the command:

c:\>php --ini

In my case: C:\wamp\bin\php\php5.6.19\php.ini

After editing this file and adding extension=php_phalcon.dll it works and when you enter then the phalcon command it gives you the available version and commands.

C:\>phalcon

C:\>phalcon-tools

Phalcon DevTools (3.0.1)

Available commands:

commands (alias of: list, enumerate)
controller (alias of: create-controller)
module (alias of: create-module)
model (alias of: create-model)
all-models (alias of: create-all-models)
project (alias of: create-project)
scaffold (alias of: create-scaffold)
migration (alias of: create-migration)
webtools (alias of: create-webtools)

How it helps someone.

I cannot comment, but let me tell you here, @Jubayer Arefin.

You need to put your phalcon-devtools path inside %PATH% variable. It's explained in phalcon-devtools docs in install section on their site.

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

I fixed the same problem in Windows:

The problem was in my System Path variable: another old PHP path in it, and the CMD was taking the first (the old one without phalcon extension) by default. Delete this old path, put the correct one -- and it will work!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top