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

phalcon: Unable to initialize module

My environment is: CentOS7.0 64bits+Nginx+PHP5.6.18

Installation flow:


# sudo yum install php-devel pcre-devel gcc make
# git clone --depth=1 git://github.com/phalcon/cphalcon
# cd cphalcon/build
# sudo ./install

then,


# vi /usr/local/php/etc/php.ini

insert one line : extension="/usr/lib64/php/modules/phalcon.so"

then, run the command:


# service php-fpm restart

got the results like below:


Gracefully shutting down php-fpm . done
Starting php-fpm [18-Mar-2016 08:58:01] NOTICE: PHP message: PHP Warning:  PHP Startup: phalcon: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20131226
These options need to match
 in Unknown on line 0
 done

I do not know the reason. Can anyone help me?



58.4k
edited Mar '16

Hey man

You should not put this code extension="/usr/lib64/php/modules/phalcon.so" into php.ini instead of you should be created a file phalcon.ini inside directory /etc/php.d, just do following command below


echo "extension=phalcon.so" >> /etc/php.d/phalcon.ini

Then restart php-fpm if use nginx



1.9k
edited Mar '16

Thanks.

I have deleted the code extension="/usr/lib64/php/modules/phalcon.so" from php.ini and created a file "phalcon.ini" inside the directory /etc/php.d/ the contents of the phalcon.ini is : echo "extension=phalcon.so">>/etc/php.d/phalcon.ini Then I restarted the php-fpm use command "service php-fpm restart" and "service nginx restart" The Warning message did not display again.

but I can not find phalcon in phpinfo().



1.9k
edited Mar '16

I have tryed the below cases of the contents of the file phalcon.ini

echo "extension=phalcon.so" >> /etc/php.d/phalcon.ini

extension=phalcon.so

but phalcon still not visible in phpinfo()



58.4k

Hey

Are you sure install success Phalcon to check it just running

# ls /usr/lib64/php/modules | grep phalcon


1.9k
edited Mar '16

I have got below message when the installation finished.

Build complete.
Don't forget to run 'make test'.

Installing shared extensions:     /usr/lib64/php/modules/
Installing header files:          /usr/include/php/

Thanks for compiling Phalcon!
Build succeed: Please restart your web server to complete the installation

to run that command, I can got the result like below


# ls /usr/lib64/php/modules | grep phalcon
phalcon.so

When I run 'make test' I got this:


# make test
make: *** No rule to make target `test'.  Stop.


58.4k
edited Mar '16

Hi I see you have install success it, so I guess we have some problems I don't know exactly it, but currently I have use Centos 7 and nginx like use and it work fine


  # php --re phalcon | grep version
Extension [ <persistent> extension #62 phalcon version 2.0.8 ] {
        Property [ protected static $_version ]
root at dev-startup in ~
#

Module compiled with module API=20100525 PHP compiled with module API=20131226

It means that you have ancient phalcon.so version / phpize version, and your php is newer and that's why phalcon is not running.

Try to update php-devel and compile module again.



1.9k

Module compiled with module API=20100525 PHP compiled with module API=20131226

It means that you have ancient phalcon.so version / phpize version, and your php is newer and that's why phalcon is not running.

Try to update php-devel and compile module again.

Thanks.

I got the phalcon.so version use the command git clone --depth=1 git://github.com/phalcon/cphalcon. that means the version of the phalcon.so is the latest.

So, How can I check the version of phpize? or How can I get the latest version of phpize?



1.9k

Anyway,Thank you very much.

Hi I see you have install success it, so I guess we have some problems I don't know exactly it, but currently I have use Centos 7 and nginx like use and it work fine


 # php --re phalcon | grep version
Extension [ <persistent> extension #62 phalcon version 2.0.8 ] {
       Property [ protected static $_version ]
root at dev-startup in ~
#
edited Mar '16

But git clone is not giving you phalcon.so. You have to compile it first.



1.9k
edited Mar '16

But git clone is not giving you phalcon.so. You have to compile it first.

Yes, but I use the below commands to compile that.

I think the php-devel also the latest version.

I do not know where is the problem happened?


# sudo yum install php-devel pcre-devel gcc make
# git clone --depth=1 git://github.com/phalcon/cphalcon
# cd cphalcon/build
# sudo ./install

And, How can I solve it?



1.9k

I have reinstalled again, and I found the message below


php-devel .x86_64 0:5.4.16-36.e17_1

Is that right? and. How to upgrade that?