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

How to test if the extension is installed

Hi Folks!

I'm newbie to the phalcon framework. I've installed the extension and when run phpinfo() shows only the call to phalcon.ini on php.ini. How may I know if it's installed?

tks



22.5k

I found on this tutorial https://docs.phalcon.io/en/latest/reference/tutorial.html <?php print_r(get_loaded_extensions()); ?> shows what extensions are installed and to my bad luck dont works.



98.9k

Look at your phpinfo() output which php.ini is loaded and add extension=phalcon.so there, also check if apache's logs has any messages related to phalcon.



19.8k
Accepted
answer
edited Apr '14

From my default check.php:

if (!class_exists("\\Phalcon\Version")) {
    die("Foodly requires the Phalcon extension to run.");
} elseif (\Phalcon\Version::getId() < 1030000) {
    die("Foodly requires at least Phalcon version 1.3.0 to run.");
} elseif (!file_exists(APPLICATION_PATH . 'config/config.php')) {
    die("Configuration file missing.");
} elseif (!file_exists(APPLICATION_PATH . '../vendor/autoload.php')) {
    die("Composer autoloader missing.");
}