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

I have read similar issues but I believe that the solution to mine might be new:
I have recently upgraded my Windows 10 to PHP 8.2.1, and today I added extension=ext/php_imagick to php.ini, and when running php -v I get the following error:
Warning: PHP Startup: imagick: Unable to initialize module
Module compiled with module API=20210902
PHP compiled with module API=20220829
These options need to match
I have tried downgrading to PHP 8.1, but the module API version was still more recent, plus I have been downloading Imagick from sources that said it was compatible with PHP 8.2...
I have tried installing the latest version of Imagick from various sources, following this guide, but I keep getting the error.
Thinking that there might not be yet an official packaged version of Imagick compiled with the latest module API, I have been following this guide to compile Imagick by myself, I have put the bin folder URL into the Path, relaunched the command prompt and this time received the error:
the procedure entry point MagickSetSeed could not be located
That was my whole day, I am out of ideas...

Related

Not able to load php_grpc.dll for php 5.6 in xampp for windows

I am trying to use google cloud php sdk to fetch from google bigtable and found that it requires grpc to be enabled.
So i tried installing grpc on my xampp by downloading dll file from https://pecl.php.net/package/gRPC
I am running PHP version 5.6 on using xampp on my windows machine
I also updated my php.ini file by adding below
extension=php_grpc.dll
I restarted apache and printing phpinfo but i am not able to find grpc module loaded.
I also checked the list of extensions loaded by running php -m command and i get below error.
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_grpc.dll' - The specified module could not be found.
in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_grpc.dll' - The specified module could not be found.
in Unknown on line 0
Can anyone provide me a solution?
I was facing the same issue when installing the Google Ads PHP library on WAMP Server. I solved it downloading a different gRPC version
https://windows.php.net/downloads/pecl/releases/grpc/1.17.0/
Extacted the file and copied on the extensions directory of WAMP and on the php.ini just add the next line
extension=grpc
Restart apache and php. Hope it helps

Homebrew throwing unable to load dynamic library error with all versions of PHP on macOS Sierra

When I install PHP using Homebrew, any extensions that I attempt to load (including the core extensions such as mysqli and gd2) throw an Unable to load dynamic library error during any usage. Is there a solution available?
The error thrown is as follows:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/Cellar/php70/7.0.15_8/lib/php/extensions/no-debug-non-zts-20151012/php_mysqli.dll' - dlopen(/usr/local/Cellar/php70/7.0.15_8/lib/php/extensions/no-debug-non-zts-20151012/php_mysqli.dll, 9): image not found in Unknown on line 0
The folder referenced, /usr/local/Cellar/php70/7.0.15_8/lib/php/extensions/no-debug-non-zts-20151012, does not exist. The command used for installation was homebrew/php/php70 --with-httpd24 --with-pear. I also attempted without the --with-pear flag.
I note that while the error refers to DLL files for some reason, changing these to SO files in the php.ini file does not resolve the problem, as the files still do not exist anywhere on the system.
I have now attempted this installation on a clean macOS 10.12.3 system, trying PHP 5.6 first and then PHP 7.0. Both experience the same issue.
I have also opened an issue on GitHub, but I was hoping someone might have experienced a similar issue and managed to resolve the problem.

Php Pthreads extension is enabled in Wamp settings window, but does not appear in Loaded Extensions in Localhost (Windows)

There are many similar explanations about this topic, but none solved my problem. I have followed the installation guide of php Pthreads at: http://php.net/manual/en/pthreads.installation.php
After that extension was showing at wampserver settings window:
Howerver, it did not appear in loaded extensions in localhost. I have checked the logs and saw the error:
PHP Warning: PHP Startup: pthreads: 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
I have searched for the error. Some explanations said to download the correct version of "Pthreads". I have tried several versions and now I get another error:
PHP Warning: PHP Startup: Unable to load dynamic library
'c:/wamp64/bin/php/php5.6.25/ext/php_pthreads.dll' - ��
������ �������� �����.
in Unknown on line 0
Both "php.ini" files in Apache folder and Php folder have the lines:
extension=php_pthreads.dll
extension_dir ="c:/wamp64/bin/php/php5.6.25/ext/"
Currently I get this error and extension is not loaded. What can be done here? Thank you
It looks to me like pthreads 3.0.6 is built only for PHP7.
As I see you are using PHP5.6.25 then the last version of pthreads that will work on that PHP is V2.0.9
Downloadable from here

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.

Missing packages on Ubuntu 12.04 with PHP 5.4

I've upgraded PHP to version 5.4 using this guide:
http://www.barryodonovan.com/index.php/2012/05/22/ubuntu-12-04-precise-pangolin-and-php-5-4-again
Now when i hit "$php -v" it throws following error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/memcached.so' - /usr/lib/php5/20100525/memcached.so: undefined symbol: memcached_touch in Unknown on line 0
How can i properly install "memcached" library? Package manager reports that i've already got latest version. I even tried to reinstall it to no avail.
You need all extensions in the correct version. We had this problem here before some time. At the moment only the memcache beta supports php5.4 on this site you get a compiled module.
Class 'Memcache' not found & PHP

Categories