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

Error: Phalcon extension isn't installed. (Phalcon 3 - PHP 7 - Centos 7)

While trying to install Phalcon Dev Tools I receive the error: Error: Phalcon extension isn't installed. I am running (Phalcon 3 - PHP 7 - Centos 7).

When I check to see if the extension is installed it is clear that it is not installed as it is not seen under the php info page. (viewing the php info. https://localhost/info.php). I also checked what extensions are running using ( php -m ) and listing all extensions that have loaded, phalcon was not to be seen. When following the installation instructions for this extension during initial installation, it tells me it all installed correctly.

I am trying to install Phalcon 3 on Centos 7 and am following the installation as per the phalcon Documentation. I have already installed phalcon on Ubuntu and all was fine but cant seem to get things going under Centos 7. I have viewed the existing forum for info regarding this issue and there were mentions of checking the php.ini file. making sure that: phalcon.ini in /etc/php.d/ was added with extension=phalcon.so. I have checked this file under etc/php.d/phalcon.ini.

1. Steps by step Install

Installing Lamp Centos 7 and Phalcon 3

2. Update

sudo yum update

sudo yum install nano

3. Install Apache

sudo yum install httpd

Enable Apache to start at boot

sudo systemctl enable httpd.service

4. Install the MariaDB-server

to install the latest version of mariadb we can use the mariadb repository. https://downloads.mariadb.org/mariadb/repositories/#mirror=aarnet_pty_ltd&distro=CentOS&distro_release=centos7-amd64--centos7&version=10.1

sudo yum install MariaDB-server MariaDB-client

Enable MariaDB to start at boot

sudo systemctl enable mariadb.service

5. Install PHP 7

Have used IUS repository. for php70u which is the same version listed under phalcon website. Dont know wheather to use a different php7 from another repository eg. EPEL Repository, Remi Repository, Webtatic Repository etc. Install the new PHP 7 packages from IUS

Install repository:

cd ~

curl 'https://setup.ius.io/' -o setup-ius.sh

run the script

sudo bash setup-ius.sh

Install PHP 7 + additional required packages.

sudo yum install php70u php70u-cli php70u-devel php70u-mysqlnd

Restart apache:

sudo apachectl restart

Additional PHP packages

sudo yum install git

sudo yum install gcc

(Dont know if i need mcrypt or any other packages?)

Test PHP:

php -v

yum info php

Created an info.php file in webroot

nano /var/www/info.php

Test php in browser using url:

https://localhost/info.php

Lastly Restart apache server:

sudo systemctl restart httpd.service

6. Install Phalcon:

phalcon repository

curl -s https://packagecloud.io/install/repositories/phalcon/stable/script.rpm.sh | sudo bash

Install Phalcon:

sudo yum install php70u-phalcon

(Installed phalcon to home directory not sure if this is a problem)

Creating the extension:

git clone git://github.com/phalcon/cphalcon.git

cd cphalcon/build

sudo ./install

7. Install Devtools

Receive error trying to install phalcon devtools.

=====Error: Phalcon extension isn't installed.=====

Hopefully someone out there might recognise an issue with my install or maybe has come across this error and knows what must be done under centos to fix it. Thanks

Details

Centos 7 (if possible): (phalcon info)

Phalcon 3: (php --ri phalcon)

PHP Version: (php -v)

Apache



7.6k
  1. in 6th. point u do twice this same. First u install from sourcelist and second u build from souce. Next time use one of it.

  2. When u type php -m do you see phalcon or not?
edited Jan '17

Isn't possibly you have enabled phalcon for some apache/fpm/httpd or something like this and not for cli?



3.2k
  1. in 6th. point u do twice this same. First u install from sourcelist and second u build from souce. Next time use one of it.

  2. When u type php -m do you see phalcon or not?

Hi, Thanx for the reply and spending the time to have a look, I see what you are saying with regards to point 6. I have the option to install from RPM or compile from source and I am doing both. Thanks for picking up on that i completely missed it. I will have another go at installing using RPM only and see what happens.

and I dont see phalcon when I run 'php-m'



3.2k

Isn't possibly you have enabled phalcon for some apache/fpm/httpd or something like this and not for cli?

Hi,

Good pickup, I didnt mention in the steps that I have added the extension to my PHP configuration. (I forgot to write thin in my steps, but i did do it)

I Added a file called phalcon.ini in /etc/php.d/ with this content: extension=phalcon.so

So with regards to enabling this for PHP, It was done correctly and i did not enable it for apache etc by mistake. Not sure of the CLI, is this the php cli can you maybe elaborate on this.

Thanks again for your reply, well picked up....



3.2k

Hi Guys,

I did a complete new install and this time in step 6. I only added repository then installed phalcon. Unfortunately I still have the same issue. Does anyone have any other suggestions. should I install php7 from another repository eg. Webtastic. not sure where to go next.

Any help appreciated.



7.6k

Hi, if you agin type php -m in comandline and you don't see Phalcon that is information that PHP-CLI doesn't have initialized Phalcon module. please make:

sudo vi /etc/php/7.0/cli/conf.d/50-phalcon.ini into file add extension=phalcon.so save and exit.

please call php -m agin and tell that you have (or not) Phalcon in list



3.2k

Hi,

I have ran the command php -m and I still dont see phalcon.

I did notice that your php path and my php path are different. Im not sure if this has something to do with the PHP repo i am using or version of PHP. I am using PHP 7 from the IUS repo. Maybe I should try another eg. EPEL, Webtatic etc. let me know what you are using and what you have had success with.

PHP Ini Path:

/etc/php.d

sudo nano /etc/php.d/phalcon.ini into file add extension=phalcon.so save and exit.

PHP Path:

/usr/bin/php

Have you any other suggestions.Thanx