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

Upgrading PHP version messes up Phalcon, how to reconfigure it?

Hi there. Just one hour ago everything was working just fine, I had PHP 5.3.x (can't remember) and I was working on a phalcon project without issues. Then I needed to upgrade PHP version, so I did, and now, I'm running in PHP 5.5.10, but phalcon just died. Right now with new php version I have:

$ php5 -v
PHP 5.5.10-1+deb.sury.org~precise+1 (cli) (built: Mar 27 2014 16:18:01) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies

In the installation, terminal asked me if I wanted to replace apache and php configuration files, I said yes to everything, knowing that then I needed to add the extension to the php.ini file.

I followed same video I followed first time: https://www.youtube.com/watch?v=5Nr79LF7Mik to install phalcon, and it succesfully compiled like this:

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

Installing shared extensions:     /usr/lib/php5/20121212/

So I looked for php.ini in /etc/php5/apache2/php.ini and added the line extension=phalcon.so restarted the server using sudo service apache2 restart and surprise surprise, printing phpinfo(), phalcon extension is not loaded.

Looking in forums, I found: https://forum.phalcon.io/discussion/660/which-lamp-php-ini-file-do-you-add-extension-phalcon-so-to- saying to check which is the correct php.ini, where I got:

$ php -i | grep Loaded
Loaded Configuration File => /etc/php5/cli/php.ini
libXML Loaded Version => 20708

So I added extension=phalcon.so in that file, restarted the server, didn't work.

I found another one: https://serverfault.com/questions/431740/phalcon-doesnt-load where it says that I can load the extension with the full path, so I first checked in /usr/lib/php5/20121212/ and the phalcon.so file IS THERE. So I changed the line extension=phalcon.so for extension=/usr/lib/php5/20121212/phalcon.so, restarted the server, didn't work.

I kept looking, I found this: https://forum.phalcon.io/discussion/1959/phalcon-with-php-5-5-10-has-problems- where the guy has same PHP version that I do, and solved the issue by creating a new file called phalcon.ini and placing it into /etc/php5/apache2/conf.d/ with the content extension=phalcon.so, I tried that, restarted the server, not working.

Finally, I started asking if the extension dir is correct like this:

$ php-config --extension-dir
/usr/lib/php5/20121212

So I'm not crazy, it's loading extensions from where it should, the phalcon.so file is there, I have the line in both php.ini files, and nothing works, I gave up, any ideas how to have phalcon working again?



98.9k

Try adding extension=phalcon.so to a file called /etc/php5/apache2/conf.d/50-phalcon.ini

I just deleted extension=phalcon.so from both php.ini and added the file as you asked, and it worked.

Thanks a lot!, but you know if this happens just with PHP 5.5.x?



98.9k

Good, This must happen with any version of PHP running Phalcon 1.3.x



1.1k
edited Apr '14

Hi, I encountered excatly same problem, Creating a file /etc/php5/apache2/conf.d/50-phalcon.ini adding extension=phalcon.so to it and restarting apache has solved the problem, many thanks!

My OS version:

DISTRIB_ID=Ubuntu DISTRIB_RELEASE=13.10 DISTRIB_CODENAME=saucy DISTRIB_DESCRIPTION="Ubuntu 13.10" NAME="Ubuntu" VERSION="13.10, Saucy Salamander" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 13.10" VERSION_ID="13.10" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"

My PHP version (PHP Version 5.5.3-1ubuntu2.3)