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

4

6

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?

Concertmaster answered 22/4, 2014 at 21:59 Comment(0)
C
15

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!

Concertmaster answered 22/4, 2014 at 22:11 Comment(3)
Any idea on how to do this on windows ?Sporran
Sry if i lift this up. BIG THANKS! You saved my day.Performative
i had to edit the file /etc/php5/mods-available/phalcon.ini and remove the ;Nakia
E
7

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.

Etz answered 25/10, 2016 at 19:39 Comment(0)
V
1

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.

Vesuvianite answered 6/6, 2014 at 9:32 Comment(1)
Phalcon is already in his path for him to see the error message.Promissory
C
0

$ 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!

Cassius answered 14/8, 2015 at 17:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.