Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Can't Load Extension on Ubuntu 14.04

Hi, thank you for your time, here is the deal:

I using an amazon ec2 with Ubuntu 14.04 where I installed apache, php and of course phalcon.

I used this instructions to install phalcon:

sudo apt-add-repository ppa:phalcon/stable sudo apt-get update sudo apt-get install php5-phalcon

Seems the extension is installed here: /usr/lib/php5/20121212/phalcon.so but is no loaded if I run a php with:

<?php printr(getloaded_extensions()); ?>

The output is:

Array ( [0] => Core [1] => date [2] => ereg [3] => libxml [4] => openssl [5] => pcre [6] => zlib [7] => filter [8] => hash [9] => Reflection [10] => SPL [11] => session [12] => standard [13] => apache2handler [14] => PDO [15] => calendar [16] => ctype [17] => exif [18] => fileinfo [19] => ftp [20] => gettext [21] => iconv [22] => json [23] => Phar [24] => posix [25] => readline [26] => shmop [27] => sockets [28] => sysvmsg [29] => sysvsem [30] => sysvshm [31] => tokenizer [32] => mhash [33] => Zend OPcache )

I already added the 30-phalcon.ini on /etc/php/5.6/apache2/conf.d but seems not work either.

My set up: Ubuntu 14.04, Apache2, PHP 5.6

Thank you for your help in advance.

edited Aug '16

You obviously restarted apache ? What php --ri phalcon returns ?



723

Yep I restarted apache.

Running the script I get this: Extension 'phalcon' not present.

I guest is something related with phalcon or php installation, because all loaded extensions are on /usr/lib/php/20151012 but the phalcon extension is located on /usr/lib/php5/20121212

Thank you for your reply.

You obviously restarted apache ? What php --ri phalcon returns ?

edited Aug '16

Are you sure you have installed php5-dev ? Also 20151012 looks like php7.

What php -v and phphize -v returns ?



46.0k
Accepted
answer

It is API from PHP 5.5.9 which is default repo for Trusty. You need to make clear which PHP major release you are using.

edited Aug '16

If you print a test.php whit phpinfo() function you can get the URL where a loaded the extension modules is. This information appears on the "Additional .ini files parsed" section, in my server I get

/etc/php/7.0/fpm/conf.d/20-phalcon.ini

Here is an example http://imgur.com/a/LHJyU

So you can check what is wrong. Look for another module and put your phalcon ini file in the same path.



723

@stamster was right is because the API form the repo, I removed and installed PHP 5.6 again and then I compiled the source using the correct version of PHP and presto now the phalcon extension is loaded. Thank you very much for your time answering this question, best regards.