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

Install Debian Stretch - Problem extension

Hello, I have install Phalcon 3 on Debian Stretch , no problem for ./install (php7 detected)

extension=phalcon.so add in 30-phalcon.ini on php/7.0//apache2/conf.d php/7.0/fpm/conf.d, php/7.0/cli/conf.d

php -i | grep extension_dir I have ==> extension_dir => /usr/lib/php/20151012 => /usr/lib/php/20151012

but when I check my installation with <?php print_r(get_loaded_extensions()); ?>

I have ==> Array ( [0] => Core [1] => date [2] => libxml [3] => openssl [4] => pcre [5] => zlib [6] => filter [7] => hash [8] => pcntl [9] => Reflection [10] => SPL [11] => session [12] => standard [13] => cgi-fcgi [14] => mysqlnd [15] => PDO [16] => xml [17] => calendar [18] => ctype [19] => dom [20] => exif [21] => fileinfo [22] => ftp [23] => gettext [24] => iconv [25] => json [26] => mysqli [27] => pdo_mysql [28] => Phar [29] => posix [30] => readline [31] => shmop [32] => SimpleXML [33] => sockets [34] => sysvmsg [35] => sysvsem [36] => sysvshm [37] => tokenizer [38] => wddx [39] => xmlreader [40] => xmlwriter [41] => xsl [42] => Zend OPcache )

I have no error , but phalcon.so is not loaded , Someone have a idea (Sorry English is not my native language)

Thank you



85.5k

do you have this ( I have used only ubuntu )


which php
which phpize
which php-config

and post the results, if its not which people google the command you need in Debian Stretch :-)



1.2k

Thank you for reply

which php /usr/bin/php

which phpize /usr/bin/phpize

which php-config /usr/bin/php-config



85.5k

sorry i forgot, one more, php -v ?



1.2k

PHP 7.0.9-2 (cli) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.9-2, Copyright (c) 1999-2016, by Zend Technologies



85.5k

ok so how did you install phalcon ? did you use zephir or just build/install ?

also can you check if the entension is in your php entension folder ? and if you set correct path in php.ini ?

and put something silly in the php.ini to be sure you are editing the correct ini file



1.2k

I just install with /build ./install in /usr/lib/php/20151012 phalcon.so is here I never editing php.ini , i just added in /conf.d (in php/7.0/apache2; cli; fpm) 30-phalcon.ini with "extension=phalcon.so"



1.2k

I have forgotten 'make test. Now i have this error PHP Fatal error: Class 'jsonserializable' not found in Unknown on line 0 Segmentation fault



85.5k

you need to load the entension on the bottom of the php.ini i think. I remember someone was complaining about this



1.2k

Okay, Same error when i load extension in php.ini

i see : https://stackoverflow.com/questions/36848664/php-fatal-error-class-jsonserializable-not-found-in-unknown-on-line-0

i have deleted my 3 files 30-phalcon.ini in /conf.d

I create one file phalcon.ini in /etc/php/7.0/mods-available

I create 3 link:

ln -s /etc/php/7.0/mods-available/phalcon.ini /etc/php/7.0/apache2/conf.d/30-phalcon.ini

ln -s /etc/php/7.0/mods-available/phalcon.ini /etc/php/7.0/cli/conf.d/30-phalcon.ini

ln -s /etc/php/7.0/mods-available/phalcon.ini /etc/php/7.0/fpm/conf.d/30-phalcon.ini

and same error

PHP Fatal error: Class 'jsonserializable' not found in Unknown on line 0 Segmentation fault

Another Idea ;)



85.5k

nah, i dont know its way different in ubuntu.

Try compile the extension using zephir;

cd zephir;
git pull origin master;
cd phalcon
git pull origin master
zephir build --zendEngine=3

than take a look at the screen where does the extension has been installed and this is what you should include.

Otherwise i really dont know. I never had any issues, even my include is on the top.

Maybe take a look if you have this json extension installed for your php7.. check if it exists in phpinfo();

https://php.net/manual/en/json.installation.php



1.2k

Thank you for your help !

But always the same pb , i reinstall php7, apache ; build with zephir...

Maybe it's debian stretch , i don't know...

Need more coffee ;)



85.5k

haha ... got it. Its the same crap in ubuntu 16.04. I will make a PR in phalcon to update readme.md and let you know



85.5k
Accepted
answer
edited Aug '16
$ sudo apt-get install php php-dev git re2c mc #mc is optimal for those who dont know what they are doing
$ git clone https://github.com/phalcon/zephir.git
$ cd zephir;
$ ./install -c
$ git clone https://github.com/phalcon/cphalcon.git phalcon
$ cd cphalcon;
$ zephir build --zendEngine=3

so far you should be fine.


cd /etc/php/7.0/mods-available;
touch 50-phalcon.ini
mcedit 50-phalcon.ini

insite the 50-phalcon.ini file place exactly this:

; configuration for Phalcon framework module
; priority=50

extension=/usr/lib/php/20151012/phalcon.so
//press F2 for save and exit ( if you are in mc )
cd /etc/php/7.0/mods-available;
phpenmod 50-phalcon //exacly like this, not with .ini after that

this should show normal results now and php -v should not be screaming.

php -m | grep "phalcon"


1.2k

Yeah ! thx for all, Yesterday i create a dual-boot with ubuntu 16.04 , no problem, all is good ! and now .... on debian too ;)

Thx really