When I uncomment pdo_sqlite line in php.ini I am getting
Unable to initialize module Module compiled with module API=20131226 PHP
compiled with module API=20121212 These options need to match
..when trying to access my sqlite database from FatFree framework.
How should I resolve this, tried to rebuild extension using pecl without
success.
php -v gives this:
PHP 5.5.8 (cli) (built: Jan 10 2014 15:37:29)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.4, Copyright (c) 2002-2014, by Derick Rethans
I should just add, PDO works fine with mysql.
ADDITION:
pecl upgrade pdo_sqlite
fails, with:
Makefile:183: recipe for target 'sqlite_driver.lo' failed
make: *** [sqlite_driver.lo] Error 1
ERROR: `make' failed
Unable to initialize module Module compiled with module API=20131226 PHP compiled with module API=20121212 These options need to match
This error means your extension was compiled in a later version of PHP. You need to make sure your extensions match the version you're using.
Related
I successfuly installed phalcon 4.0 framework. Also I check phpinfo() on browser and there is phalcon, but if check php modules, there is not the palcon.
Also if I check php module by this command,
php -m | grep phalcon
I get this php warning:
Cannot load module 'phalcon' because required module 'psr' is not loaded in Unknown on line 0
I tried add extension=psr.so to php.ini, but it still not worling.
I also create 50-phalcon.ini file on /etc/php/7.3/apach2/conf.d folder, still not working.
Please help me, I have no idea how to solve this problem. Please help!
You have installed v4 which requires the PSR extension to be loaded first.
Have a look at this article: https://docs.phalconphp.com/4.0/en/upgrade
In short psr.so has to be present in your system and loaded before Phalon.
#Ubuntu
$ zephir -V
PHP Warning: Cannot load module 'phalcon' because required module 'psr' is not loaded in Unknown on line 0
Zephir 0.12.12 by Andres Gutierrez and Serghei Iakovlev (1094502)
php -v
PHP Warning: Cannot load module 'phalcon' because required module 'psr' is not loaded in Unknown on line 0
PHP 7.2.24-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Oct 24 2019 18:29:11) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.24-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
PS: I extended psr.so and configured it to php.ini
But it doesn't compile when running zephir
After one of PHP updates (ubuntu) I got an error Class 'AMQPConnection' not found in my application.
I reinstalled latest stable version (1.7.1) of amqp via pecl
sudo pecl uninstall amqp
sudo pecl install amqp
It asks me:
downloading amqp-1.7.1.tgz ...
Starting to download amqp-1.7.1.tgz (79,905 bytes)
..................done: 79,905 bytes
18 source files, building
running: phpize
Configuring for:
PHP Api Version: 20121113
Zend Module Api No: 20121212
Zend Extension Api No: 220121212
Set the path to librabbitmq install prefix [autodetect] :
When I choose one of the variants - builds fails, error always like
configure: error: Please reinstall the librabbitmq distribution itself or (re)install librabbitmq development package if it available in your system
ERROR: `/tmp/pear/temp/amqp/configure --with-librabbitmq-dir=20121113' failed
If I choose autodetect, installation proccessed successfully.
Then I add extension=amqp.so into php.ini and get an error
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20131226/amqp.so' - /usr/lib/php5/20131226/amqp.so: cannot open shared object file: No such file or directory in Unknown on line 0
I found amqp.so via
locate amqp.so
It display
/usr/lib/php5/20121212/amqp.so
Then I change extension=amqp.so to the full path /usr/lib/php5/20121212/amqp.so
And I get very interesting error
PHP Warning: PHP Startup: amqp: Unable to initialize module
Module compiled with module API=20121212
PHP compiled with module API=20131226
These options need to match
in Unknown on line 0
As I understand, PHP compiled with version newest than Amqp.
But it is the latest amqp library version.
Pecl shows:
Package Stable/(Latest) Local
amqp 1.7.1 (stable) 1.7.1 Communicate with any AMQP compliant server
PHP version is 5.6.4
PHP 5.6.4-4ubuntu6 (cli) (built: Apr 17 2015 15:47:51)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend
Technologies
with Xdebug v2.2.6, Copyright (c) 2002-2014, by Derick Rethans
I just upgraded to php 5.6.4. When i do pear installs of various packages it complains that if have a module mismatch.
example:
sudo pecl install xdebug
Failed loading /usr/local/php-5.6.4/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so:
/usr/local/php-5.6.4/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so: undefined symbol: zend_execute_ex
Zend OPcache requires Zend Engine API version 220131226.
The Zend Engine API version 220100525 which is installed, is outdated.
PHP Warning: PHP Startup: PDFlib: Unable to initialize module
Module compiled with module API=20131226
PHP compiled with module API=20100525
However, 20131226 is php 5.6.4, 20100525 is 5.4 i believe. So oddly pear thinks the modules were compiled w/ 5.6 but the version of php is 5.4. Ive had this the other way around where the module is older than the php version a lot and typically just recompile those module. this one im a bit stumped.
[richv]$ php -v
PHP 5.6.4 (cli) (built: Jun 16 2015 16:08:30)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
with Xdebug v2.3.2, Copyright (c) 2002-2015, by Derick Rethans
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
[richv]$ pear version
PEAR Version: 1.9.5
PHP Version: 5.6.4
Zend Engine Version: 2.6.0
Running on: Linux dragon 3.10.0-229.4.2.el7.x86_64 #1 SMP Wed May 13 10:06:09 UTC 2015 x86_64
If you still have the old php version lying around, then pear/pecl probably still uses this php version - even if it shows the correct php version in pear version.
Try to change the php_bin pear config setting:
$ pear config-show
..
$ pear config-set php_bin /path/to/new/php
I can't configure ioncube or source guardian loaders with phpfarm. I thinks that is for "(DEBUG)" in php -v but I do not know how to. I need help with this issue.
My php -v:
root#martin:/opt/phpfarm/src# /opt/phpfarm/inst/php-5.3.22/bin/php -v
Cannot load the ionCube PHP Loader - it was built with configuration API220090626,NTS, whereas running engine is **API220090626,NTS,debug**
PHP Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with build ID=API20090626,NTS
PHP compiled with build **ID=API20090626,NTS,debug**
These options need to match
in Unknown on line 0
Warning: PHP Startup: SourceGuardian: Unable to initialize module
Module compiled with build ID=API20090626,NTS
PHP compiled with build ID=API20090626,NTS,debug
These options need to match
in Unknown on line 0
PHP 5.3.22 (cli) (built: Apr 19 2015 17:43:14) **(DEBUG)**
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans
Although I can only answer for the ionCube Loaders, I presume the same applies to the Source Guardian Loaders.
PHP extensions need to match the exact same version, including release/debug status, thread-safety and PHP version. You are therefore right in that the ionCube Loaders will not work on PHP compiled with debug symbols. ionCube does not provide Loaders for this scenario, so your only solution is to build PHP as release version.
Do note that building PHP with debug symbols will most likely not help you debug your PHP scripts, if that is your goal.
I'm trying to install Phalcon module on Windows 7 with running Zend Server.
Some useful information: php -v
[30.09.2014 15:02:32 p12888/t2672 NOTICE] Successfully established connection the database
PHP 5.5.13 (cli) (built: Jun 26 2014 12:03:16)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies
with Zend Extension Manager v6.0.0, Copyright (c) 2003-2014, by Zend Technogies
with Zend Data Cache v6.0.0, Copyright (c) 2004-2014, by Zend Technologies
[loaded] [licensed] [disabled]
- with Zend Job Queue v6.0.0, Copyright (c) 2004-2014, by Zend Technologies
[loaded] [not licensed] [disabled]
- with Zend Session Clustering v6.0.0, Copyright (c) 2004-2014, by Zend Tecnologies [loaded][licensed] [disabled]
- with Zend Utils v6.0.0, Copyright (c) 2004-2014, by Zend Technologies [licensed] [licensed] [enabled]
- with Zend Code Tracing v6.0.0, Copyright (c) 2009-2014, by Zend Technologies [loaded] [licensed] [enabled]
- with Zend Server Z-Ray v7.0.0, Copyright (c) 1999-2014, by Zend Technologies [loaded] [licensed] [enabled]
- with Zend Monitor v6.0.0, Copyright (c) 1999-2014, by Zend Technologies [loaded] [licensed] [disabled]
- with Zend Debugger v6.0.0, Copyright (c) 1999-2014, by Zend Technologies [loaded] [licensed] [enabled]
- with Zend Page Cache v6.0.0, Copyright (c) 2004-2014, by Zend Technologies [loaded] [licensed] [disabled]
- with Zend Monitor UI v6.0.0, Copyright (c) 2004-2014, by Zend Technologies [loaded] [licensed] [enabled]
OS: Windows 7 X64
I'm downloading DLLs from http://phalconphp.com/en/download/windows and https://github.com/phalcon/cphalcon/tree/master
Zend sever is installed in program files x86 and I've tried install dlls what I get from logs is:
[30-Sep-2014 15:35:42] PHP Warning: PHP Startup: phalcon: Unable to initialize module
Module compiled with build ID=API20121212,NTS,VC11
PHP compiled with build ID=API20121212,NTS,VC9
These options need to match
in Unknown on line 0
[30-Sep-2014 15:35:44] PHP Warning: PHP Startup: phalcon: Unable to initialize module
Module compiled with build ID=API20121212,NTS,VC11
PHP compiled with build ID=API20121212,NTS,VC9
These options need to match
in Unknown on line 0
[30-Sep-2014 15:35:46] PHP Warning: PHP Startup: phalcon: Unable to initialize module
Module compiled with build ID=API20121212,NTS,VC11
PHP compiled with build ID=API20121212,NTS,VC9
These options need to match in Unknown on line 0
[30-Sep-2014 15:37:08] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\Zend\ZendServer\lib\phpext\php_phalcon.dll' - The specified module could not be found.
in Unknown on line 0
[30-Sep-2014 15:37:10] PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\Zend\ZendServer\lib\phpext\php_phalcon.dll' - The specified module could not be found.
in Unknown on line 0
[30-Sep-2014 15:38:28] PHP Warning: PHP Startup: phalcon: Unable to initialize module
Module compiled with build ID=API20121212,NTS,VC11
PHP compiled with build ID=API20121212,NTS,VC9
These options need to match in Unknown on line 0
[30-Sep-2014 15:38:30] PHP Warning: PHP Startup: phalcon: Unable to initialize module
Module compiled with build ID=API20121212,NTS,VC11
PHP compiled with build ID=API20121212,NTS,VC9
These options need to match
in Unknown on line 0
[30-Sep-2014 15:38:32] PHP Warning: PHP Startup: phalcon: Unable to initialize module
Module compiled with build ID=API20121212,NTS,VC11
PHP compiled with build ID=API20121212,NTS,VC9
These options need to match
in Unknown on line 0
I get these errors for different DLLs which I try to install as PHP module. Do you have any clues how can I install it on Windows?
I've already installed some modules for example MONGO and it worked but I'm struggling with phalcon
When you are using a pre-compiled PHP extension for windows you must match the API numbers (PHP version), thread safety on or off (ZTS or NTS), and the version of Visual Studio used for the compile
PHP compiled with build ID=API20121212,NTS,VC9
This information tells you that the zend server version of PHP you're using was compiled with VC9, has thread safety off (NTS) and requires the 20121212 version of PHP's internal APIs
Module compiled with build ID=API20121212,NTS,VC11
This information tells you that the phalcon extension you downloaded was compiled with VC11 - but the API and thread safety settings are the same as the current PHP install. Because one of the three things doesn't match, however, the extension won't load correctly.
Unfortunately phalcon does not provide pre-compiled versions of the extension for PHP 5.5, NTS, built with VC9 so you'll either need to build your own or ask the maintainers to add that version
Or use something other than Zend Server for your PHP