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

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.

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

Installing PHP 7.2 extension pdflib, module error

I am trying to install pdflib on PHP 7.2 which I already had installed before. Somehow I restructured my PHP Installation with Homebrew a while ago. Before that restructure I had my extensions in /usr/local/etc/php/7.2/extensions. I just needed to reference my .so Files in php.ini and everything had been working just fine.
After the restructure I used pecl to install new extensions. Now I have my extensions in usr/local/lib/php/pecl/20170718 which is also referenced in my php.ini as extension_dir. But if I put the pdflib.so inside this directory and register it in php.ini I get the following error:
Warning: PHP Startup: PDFlib: Unable to initialize module
Module compiled with module API=20160303
PHP compiled with module API=20170718
These options need to match`Warning: PHP Startup: PDFlib: Unable to
initialize module
How can I solve this or is there a way to roll back to the old configuration?
Module compiled with module API=20160303
PHP compiled with module API=20170718
this message indicate, that a PDFlib DSO is loaded, which was build for an older PHP (PHP 7.1).
I see two possible problems:
a different extension is loaded by accident. For example due to different names. (php_pdflib.so vs pdf.so)
your PECL build go wrong, and it was build the extension against the old PHP 7.1.
I would recommend
check your php.ini and remove all extensions with pdf
download the latest PDFlib 9.1.2 from the website and unpack the package
copy the correct DSO (php_pdflib.so) to your extension_dir
add now extension=php_pdflib.so to your php.ini
hope that helps,
Rainer

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

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.

PHP Startup: unable to initialize module

i'm trying to install mongoDB in my system. As instructed in
http://www.mongodb.org/display/DOCS/PHP+Language+Center,
I downloaded php_mongo.dll and put it in ../php5.3.0/ext folder. Then I added extension=php_mongo.dll to php.ini. When I restarted WAMP, I got the following errors:
PHP Startup: unable to load dynamic library php5.3.0/ext/php_gd2.dll
and the same error for
php_mbstring.dll,php_mysql.dll,php_mysqli.dll,php_pdo_mysql.dll,php_pdo_sqlite.dll.
After that, I got another error:
PHP Startup: Mongo: Unable to initialize module
Module compiled with build ID=API20090626, TS, VC9
PHP compiled with build ID=API20090626, TS, VC6.
These options need to match.
After some reading up from the net, I realize that I have to change the compiler for PHP. Does anyone know on how to update php compiler VC6 to php compiler VC9?
My Apache version 2.2.11
PHP version 5.3.0
thank you
http://windows.php.net/download/
Download the zip file for VC9 x86 Thread Safe (which is for PHP run as Apache module).
Extract the contents of the zip somewhere
Stop apache
Backup the php.ini file you have in your current PHP directory ../php5.3.0/
Delete (or backup) the rest of the contents you have in ../php5.3.0/
Place the extracted content in ../php5.3.0/
Put php_mongodb.dll in ../php5.3.0/ext/
Put php.ini back also
Restart Apache
edit:
Sorry, I forgot to mention that you also need to replace your apache install with the one from apachelounge as well, and have Microsoft 2008 C++ Runtime (x86) or the Microsoft 2008 C++ Runtime (x64) installed, as per the remarks in "Which version do I choose?" on the same page http://windows.php.net/download/
For time being, check which module is in warning message, just go to php.ini file and comment it. This could work

SAPRFC dll and PHP 5.5

I wanted to try using SAPRFC dll along with PHP to retrieve data from SAP server at our company, but after downloading the latest version (1.4.1) from http://sourceforge.net/projects/saprfc/files/
Then, I added the dll files (php_saprfc_528.dll and php_saprfc_530.dll) to PHP extensions folder, then I updated php.ini file. When I start Apache server, the following error message shows to me
PHP Startup: saprfc: Unable to initialize module
Module compiled with module API=20060613
PHP compiled with module API=20121212
These options need to match
Googling this issue, I found that that saprfc was compiled with another version of PHP not same as the one I'm using. I'm running PHP 5.5.9, so I started looking with saprfc dll file compatible with PHP 5.5, but I couldn't find.
Can anybody please provide the download for the php_saprfc.dll which will work with PHP 5.5, or what are the steps for compiling php_saprfc.dll that will make it compatible with PHP 5.5
Thanks
Compiled php module you can download here: https://sourceforge.net/projects/saprfcsapnwrfc/files/?source=navbar
Have you installed the RFC DLL on the system in question? At runtime the SAPRFC PHP module needs it - from the installation instructions (As you mentioned DLL I'm assuming you're using Windows):
For installation (from binary package):
PHP binaries (http://www.php.net/downloads.php)
librfc32.dll in Windows System directory (or SAPGUI installed)
You can obtain librfc32.dll from a system that has SAPGUI installed (check the Windows directory) or by installing the classic RFC SDK. For more information on that SDK, see note 27517 (SAP SMP login required).
Once you've done that and if the PHP module still doesn't work, then you can consider recompiling. See the instructions in that same installation guide for instructions. They do mention Visual C 6.0 though, which is rather old...

Categories