Installing gearman PHP extension on Windows using cygwin and pecl - php

There is only a handful of threads on installing gearman on Windows, especially the gearman PHP extension. I have not found a solution yet. If anyone found a solution to get gearman PHP extension working on Windows, please comment on this thread.
I came across this thread on pecl install gearman. When attempting to install Gearman PHP extension through cygwin using pecl, the installation failed with the following error.
$ pecl search gearman
Retrieving data...0%
Matched packages, channel pecl.php.net:
=======================================
Package Stable/(Latest) Local
gearman 1.1.2 (stable) PHP wrapper to libgearman
$ pecl install gearman
pecl/gearman requires PHP (version >= 5.1.0, version <= 6.0.0, excluded versions: 6.0.0), installed version is 7.1.12
No valid packages found
install failed
I checked PHP version and it is 5.6.3. Where is that installed version 7.1.12 coming from?
$ php -v
PHP 5.6.31 (cli) (built: Jul 5 2017 22:24:51)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
Related thread: How can i install gearman php extension on Windows OS?

Related

PECL fails to install Xdebug on PHP 8.1 because it thinks I'm on PHP version 7.4

I've searched far and wide, tried everything but I can't get to install Xdebug on PHP 8.1
I've got multiple PHP versions installed via homebrew, when I switch to PHP 8.1 and try to install Xdebug I get the following:
BE-C02CRC3FMD6N:~ treynaert$ php -v
PHP 8.1.14 (cli) (built: Jan 9 2023 16:02:41) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.14, Copyright (c) Zend Technologies
BE-C02CRC3FMD6N:~ treynaert$ pecl install xdebug
pecl/xdebug requires PHP (version >= 8.0.0, version <= 8.2.99), installed version is 7.4.33
No valid packages found
install failed
As you can see, php -v returns 8.1, phpinfo() in the browser gives me the same. Though for some reason pecl thinks I'm on 7.4.
I'm on Mac OSX Catalina BTW (10.15.7)
Anyone has a clue?

Install xdebug on specific php version

I'm trying to install xdebug.
I've already seen some issues about it (like this one : Installing xdebug with PHP 5.5 ) but it seems outdated and not corresponding to my issue).
When I try
sudo pecl install xdebug
I'm getting the following error
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading xdebug-2.8.0.tgz ...
Starting to download xdebug-2.8.0.tgz (238,122 bytes)
.................................................done: 238,122 bytes
69 source files, building
running: phpize
sh: 1: phpize: not found
ERROR: `phpize' failed
It seems that means phpize isn't installed in my php version
php -v
PHP 7.2.24-0ubuntu0.19.04.1 (cli) (built: Oct 24 2019 11:49:39) ( 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-0ubuntu0.19.04.1, Copyright (c) 1999-2018, by Zend Technologies
So, some topics seems to tell me to change my php version to download a version with phpsize included. But I was more looking for a way to add phpsize to my current php version but I don't know how to do that.
Thanks for your assistance
If Ubuntu first you need install php dev version:
sudo apt install php7.x-dev
And then:
sudo pecl install xdebug
I had some problems with xdebug version too.
I had to install an specific version for php7.1 using PECL,
I don't really know if your question is already solved but let me share you this webpage, it's the compatibility graph to know wich version works with an specific php versions:
https://xdebug.org/docs/compat
As far as I know if you want to install the latest xdebug version you can use the repo, but if you need an old version you'll be forced to install it using PECL.
Hope you find this answer usefull!

Why is php zip extension not working on ubuntu though it's installed?

I'm on Ubuntu 16.04 and I'm trying to install prestashop e-commerce CMS that requires php zip extension to unzip the main CMS folder.
I have installed php-zip and php7.2-zip and I also restarted the web server (apache2) but the CMS still displays the following message
An error has occured:
You must install PHP zip extension first
Here's the result of my installed php zip packages and my current php version:
eljaouhari#eljaouhari-HP-350-G1:/var/www/html$ php -v
PHP 7.2.5-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: May 5 2018 04:59:13) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.5-1+ubuntu16.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies
eljaouhari#eljaouhari-HP-350-G1:/var/www/html$ apt list --installed | grep php | grep zip
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
php-zip/xenial,xenial,now 1:7.2+60+ubuntu16.04.1+deb.sury.org+1 all [installé]
php7.2-zip/xenial,now 7.2.5-1+ubuntu16.04.1+deb.sury.org+1 amd64 [installé]
I spent an hour and a half trying to figure out whether I need to activate the extestion on the php.ini file and also installing and reinstalling and restarting the web server but nothing seems to work.
I have tried a few solutions on the web that used to work for me but I can't seem to find a good solution.
Please help me with your experience!
I've found the solution after I printed the results of the phpinfo() function.
It seems that the version of php printed with the "php -v" command is not the version that actually apache is using. Apache ended up using the 7.0 version.
Thanks everyone.

PHP 5.5.3 installing Imagick extension for ImageMagick

So we have this machine with Linux running as development server.
However we are having som issue's getting the imagick extension installed.
We are using:
PHP 5.5.3 (cli) (built: Aug 21 2013 18:12:49)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
And
Version: ImageMagick 6.5.4-7 2012-05-07 Q16 OpenMP http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
If we try to install imagick with this command we get the following:
# pecl install imagick
downloading imagick-3.1.2.tgz ...
Starting to download imagick-3.1.2.tgz (94,657 bytes)
.....................done: 94,657 bytes
15 source files, building
running: phpize
Can't find PHP headers in /usr/include/php
The php-devel package is required for use of this command.
ERROR: `phpize' failed
How can we do the install correct without changing our PHP version to a dev version.
Is there a version of imagick for PHP 5.5.3 or a version of imagick we can use with our PHP version.
Help would really be appreciated!
as root, execute the following command
yum install php-devel
Then try installing the imageMagick extension again
We managed to installed the extension by removing the old php installed package because it was from a different repository. After that we installed everythings from the same repository. After that we needed to added some non default extensions back in php.ini to let everything work again! Don't know the exact details,I'm no unix expert ;).

Install compile version of php in Ubuntu

I have googled for a long time but still cannot figure out why the installation does not work.
I have a machine installed with Ubuntu and php version 5.3.6-13ubuntu3.10 installed, as I want pthreads feature, I try to recompile the downloaded PHP (from the official site, 5.4.14) and recompile with the pthreads enabled, all the processes seem successful, I can recompile and install the php successfully, and type in php -v to check if the version has been upgrade, it shows as follows:
PHP 5.4.14 (cli) (built: May 9 2013 14:27:10)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
And the pthreads seems to be installed correctly
Build process completed successfully Installing
'/usr/local/lib/php/extensions/no-debug-zts-20100525/pthreads.so'
install ok: channel://pecl.php.net/pthreads-0.0.44 Extension pthreads
enabled in php.ini
but the when I restart the apache and run the phpinfo() function, the version is not the same as the above (still 5.3.6-13ubuntu3.10), and the pthreads extension still cannot function properly, encounter the following error)
Fatal error: Class 'Thread' not found
Is there anything I have missed/wrong during the whole process?
Thanks a lot for the help!

Categories