PHP Warning: PHP Startup: solr: Unable to initialize module - php

I'm getting the below warning while adding the solr-client extinctions.
PHP Warning: PHP Startup: solr: Unable to initialize module
Module compiled with module API=20131226
PHP compiled with module API=20121212
These options need to match in Unknown on line 0
can any one Please hep me out in this ?

PHP Warning: PHP Startup: solr: Unable to initialize module
1:Check extension_dir directive in php.ini. It should point to folder with 5.2 modules.
2:This is because PHP extensions are developped in C, and are "close" to the internals of PHP -- which means that, if the APIs of those internals change, the extension must be re-compiled, to use the new versions.
And, between PHP 5.2 and PHP 5.3, for what I remember, there have been some modifications in the internal data-structures used by the PHP engine -- which means extensions must be re-compiled, in order to match that new version of those data-structures.
How to update your PHP extensions will depend on which system you are using.
If you are on windows, you can find the .dll for some extensions here : http://downloads.php.net/pierre/
For more informations about the different versions, you can take a look at what's said on the left-sidebar of windows.php.net.
If you are on Linux, you must either :
Check what your distribution provides
Or use the pecl command, to re-download the sources of the extensions in question, and re-compile them.

Related

How to fix PHP Warning: PHP Startup: Unable to load dynamic library 'xxx/xxx/yaf.so'?

[26-Nov-2021 21:49:17 Asia/Shanghai] PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php5.6.40/lib/php/extensions/no-debug-non-zts-20131226/yaf.so' - dlopen(/Applications/MAMP/bin/php/php5.6.40/lib/php/extensions/no-debug-non-zts-20131226/yaf.so, 0x0009): tried: '/Applications/MAMP/bin/php/php5.6.40/lib/php/extensions/no-debug-non-zts-20131226/yaf.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/yaf.so' (no such file) in Unknown on line 0
You are loading the incorrect version for your PHP Version.
if this is Yet Another Framework
You can only use this on the version of PHP is created for.
for example if your PHP Version is 5.3
You would need a yaf.so to match PHP 5.3
Looking on there GIT this is a 5.2 build, so your PHP Version needs to match this.
Personally i would ditch the 5.3 you are running and install 7.0.
5.3 is very dated, pointless developing anything based on this.
When you have the right version, Place this inside your ext folder in PHP.
Edit your PHP.ini file
add in:
extension=yaf.so
Ensure your extension_dir is configured correctly too:
extension_dir = "ext"
your yaf should be in the same folder as the extension dir, just ensure extension is built for the PHP version you are using, they are not cross compatible

i am using php 5.6.24 in xamp and i'm installing V8js extension and getting following warning

php -i | findstr "Thread"
PHP Warning: PHP Startup: v8js: 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
Thread Safety => enabled
You have installed the wrong version of the extension. You need the version that is compiled with API 20131226. So you have to search for the correct version and install them. Then is should work.
https://github.com/terrylinooo/v8js-dll
here you can see the versions that are included. So normally if you have used the correct version it should be correct.

php_pthreads.dll - The specified module could not be found.?

Hi I am trying to implement threading in php. What ever I have read till this point I got to know pthreads library can be used for this purpose.
I have gone through the php installation guide below :
http://docs.php.net/manual/en/pthreads.installation.php
After downloading pthreads windows installation zip I unzipped it & placed following files in respective locations :
Move
php_pthreads.dll to the 'bin\php\ext\' directory.
Move pthreadVC2.dll to the 'bin\php\' directory.
Move pthreadVC2.dll to the 'bin\apache\bin' directory.
Move pthreadVC2.dll to the 'C:\windows\system32' directory.
Configured php\php.ini and add
extension=php_pthreads.dll
But I am getting an error on server startup which is as follows :
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_pthreads.dll' - The specified module could not be found.
in Unknown on line 0
I am unable to detect what is the issue above file php_pthreads.dll is #given location, what may go wrong.
PHP Version of xampp : 5.6.15, Pthreads lib version : 3.1.0 both the softwares are for x86 architecture.
I made change as suggested by Saitama below, changed version of pthreads from 3.1.0 to 2.0.0 I got new warning as below :
PHP Warning: PHP Startup: pthreads: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20131226
These options need to match
in Unknown on line 0
How to I match these compile API version I have php extension build number as 20131226 but how to decide this number while downloading a pthread binary installation zip ?
The pthreads module can only be loaded if you are using the CLI SAPI.
And it is only available under CLI SAPI only.
Also, pthreads v3 is only for PHP7 and since you are using PHP 5.6 you need to use pthreads v2.
It is only available under the cli sapi because, spawning multiple threads under apache can prove to be buggy.
So, the problems are:
* You are trying to load pthreads under some another SAPI than CLI.
* You need to use pthreadsv2 rather than pthreadsv3.
Note: If you would be using pthreadsv2 you can most probably load pthreads under the apache SAPI. But still it is not recommended. Using some other approach would be highly recommended.

PHP Installation Yosemite

I believe I have an issue with my PHP installation
When I type php into the command line, i get the following
PHP Warning: PHP Startup: pdo_pgsql: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: pgsql: Unable to initialize module
Module compiled with module API=20100525
PHP compiled with module API=20121212
These options need to match
in Unknown on line 0
Can anyone advise?
I tried this - http://jason.pureconcepts.net/2014/11/install-apache-php-mysql-mac-os-x-yosemite/
As the author of that post, the issue is with the previously compiled modules pdo_pgsql and pgsql.
As noted in the comments, you will need to reinstall these modules for the Yosemite's of PHP (run php -v).
Steps for doing so with these specific modules has been answered already.
I just had the same issue and I don't use Postgres so I really didn't care for installing PEAR and then autoconfig, etc.
So I found that you can simply comment out those extensions in php.ini
To find the ini file location:
php -i | grep php.ini
And then comment out the above 2 extensions in the ini file. Mine was located at: /Library/Server/Web/Config/php/php.ini

How do I fix PHP module thread-safe/non-thread-safe mismatch?

This is out of the error log:
PHP Warning: PHP Startup: BOPEE Extension: Unable to initialize module
Module compiled with build ID=API20090626,TS,VC9
PHP compiled with build ID=API20090626,NTS,VC9
These options need to match
in Unknown on line 0
PHP Warning: PHP Startup: CustomExt Module: Unable to initialize module
Module compiled with build ID=API20090626,TS,VC9
PHP compiled with build ID=API20090626,NTS,VC9
These options need to match
in Unknown on line 0
How I get the non-threadsafe source for PHP? The only download link I found on windows.php.net/download was http://windows.php.net/downloads/releases/php-5.3.2-src.zip and that appears to be the threadsafe code --- or is there some way of telling the source that it's actually non-threadsafe?
I have tried putting --disable-zts on the commandline for configure.bat but whilst that has a good effect on the outputs from configure.bat, it doesn't seem to make the source any less threadsafe.
In your case above, PHP itself is non-thread-safe (NTS), but the module is thread-safe (TS). The module is thread-safe because the Zend Thread-Safe ZTS constant is defined (either in the module's source code or in VS 2008's Preprocessor Definitions).
Simply changing ZTS=1 to ZTS=0 does not work.
You must completely remove the definition of ZTS.

Categories