Installing xdebug using "pecl install xdebug" on xampp - php

When I tried to install Xdebug using
pecl install xdebug
I'm getting the following error. I'm using the latest xampp bitnami distribution on Windows 7 machine.
downloading xdebug-2.2.5.tgz ... Starting to download xdebug-2.2.5.tgz
(255,840 bytes)
.....................................................done: 255,840
bytes 66 source files, building WARNING: php_bin C:\xampp\php\php.exe
appears to have a suffix \php.exe, but config variable php_suffix
does not match ERROR: The DSP xdebug.dsp does not exist.
Do I need to configure anything on php.ini for this?

Related

Xdebug installation failed because "phpize" failed on macOS Big Sur with MAMP

I am trying to install Xdebug on my Mac, since I am using MAMP for local development.
I tried using pecl to install Xdebug by running the following command in my terminal:
sudo pecl install xdebug
But the following happens:
hello-world:~ lois$ sudo pecl install xdebug
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading xdebug-2.9.8.tgz ...
Starting to download xdebug-2.9.8.tgz (245,293 bytes)
...................................................done: 245,293 bytes
91 source files, building
running: phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
autom4te: need GNU m4 1.4 or later: /usr/bin/m4
ERROR: `phpize' failed
It looks like phpize is trying to locate some files which don't exist, and then fails.
There is no mention of those files in the xdebug installation page, so I am not sure what I did wrong.
Ok, so I finally found the solution to my problem.
First solution: if you are using MAMP
First, I am actually using MAMP for local development. If that is your case as well, you do not need to install Xdebug.
The reason is, Xdebug is already installed with MAMP.
There are only 2 things you need to do:
Modify the php.ini files in MAMP: https://dillieodigital.wordpress.com/2015/03/10/quick-tip-enabling-xdebug-in-mamp-for-osx/
Set up your IDE to use Xdebug. I am using VS Code, there are lots of tutorials on how to set up VS Code with Xdebug.
Second solution: you are not using MAMP, so you absolutely want to install Xdebug on your Mac
If you had the same problem I had with phpize, it is because newer versions of macOS have a different folder structure.
Xdebug expects a certain structure, which is not present anymore. In this case, take a look at this article: https://bbqsoftwares.com/blog/xdebug-catalina
Autoconf might be missing
run brew install autoconf and try again
on Apple M1 Silicon make sure to use arch -x86_64 sudo pecl install xdebug to install xdebug

Unable to load dynamic library 'zip.so' on Centos 7.6.1810 using remi-php72 repo

I am having problems getting October CMS to update:
Update failed
"Class 'ZipArchive' not found" on line 51 of /var/www/html/jdd/htdocs/vendor/october/rain/src/Filesystem/Zip.php
And if I do php -m, i get the following warning:
PHP Warning: PHP Startup: Unable to load dynamic library 'zip.so' (tried: /usr/lib64/php/modules/zip.so (/usr/lib64/php/modules/zip.so: undefined symbol: zip_libzip_version), /usr/lib64/php/modules/zip.so.so (/usr/lib64/php/modules/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Strange thing is, in my /etc/php.d/ folder, the zip.ini file contains the line: extension=zip.so. whereas all other .ini files in /php.d do not include the ".so" extension (eg: for the json.ini file, the line reads: extension=json). I have tried removing the ".so" from the zip.ini extension= line, but it still won't work.
As far as I know, the system is only running x86_64 executables (how do I check this with absolute certainty - all binaries are showing as .x86_64 or .noarch?).
I have tried other versions of php:
-php 5.4 installs zip.so fine (it loads correctly), except October requires at least php 7.0.
-php 7.0 to 7.3 all install zip.so, but the extension still does not load.
Can anyone help?
I've got the same problem and found following solution:
Search for installed php modules:
yum list installed | grep php*
Try to locate installed php-zip module:
rpm -ql php72-php-pecl-zip
You will see something like this:
/etc/opt/remi/php72/php.d/40-zip.ini
/opt/remi/php72/root/usr/lib64/php/modules/zip.so # <----
/opt/remi/php72/root/usr/share/doc/pecl/zip
Then just create symlink to this file in directory where php searches modules by default:
ln -s /opt/remi/php72/root/usr/lib64/php/modules/zip.so /usr/lib64/php/modules/zip.so
After this steps I finally saw zip extension in php -m output and now can use class ZipArchive.
Also you should probably restart your httpd service.
1 - Download manually the last ZIP pecl lib at https://pecl.php.net/package/zip
2 - Install it with pecl in the downloaded file
sudo pecl install zip-1.19.1.tgz
3 Enable zip on php.ini
extension=zip
Please check you are using latest libzip5 version 1.5.1 from remi-safe repository (which is mandatory, and enabled by default)

Cant install Crypt_GPG on xampp windows

I used the command
php pyrus.phar install pear/Crypt_GPG to install Crypt_GPG in xampp in windows.
But it is showing the follwoing dependency error
Pyrus version
2.0.0a4 SHA-1: 72271D92C3AA1FA96DF9606CD538868544609A52 Using PEAR installation found at C:\xampp\php\pear Pyrus\Installer\Exception:
Dependency validation failed for some packages to ins tall,
installation aborted Pyrus\Dependency\Exception:
pear.php.net/Crypt_GPG can optionally use PHP exten sion "posix"
Pyrus\Dependency\Exception: Cannot install pear.php.net/Crypt_GPG on
Windows
The pear page https://pear.php.net/package/Crypt_GPG says posix is an optional dependendy and also posix cant be installed in windows. It also says that Crypt_GPG can be installed in windows. See bottom of the page.
Is there anyway i can get pass this error and install Crypt_GPG on php in xampp in windows?
Do not use pyrus; it's buggy and not developed anymore.
The original PEAR installer will work fine.

How to install SPL_Types for MAMP 3.0.7.3?

I'm having trouble installing SPL_Types with pecl for MAMP 3.0.7.3. Note that I am NOT using the "Pro" version of MAMP. How can I install this, or any pecl package, for the basic version of MAMP?
When I run the pecl install pecl/SPL_Types command, the output is:
pecl install pecl/SPL_Types
downloading SPL_Types-0.4.0.tgz ...
Starting to download SPL_Types-0.4.0.tgz (8,388 bytes)
.....done: 8,388 bytes
6 source files, building
running: phpize
grep: /Applications/MAMP/bin/php/php5.6.2/include/php/main/php.h: No such file or directory
grep: /Applications/MAMP/bin/php/php5.6.2/include/php/Zend/zend_modules.h: No such file or directory
grep: /Applications/MAMP/bin/php/php5.6.2/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.
ERROR: `phpize' failed
I've read that with older versions of MAMP, there was an extra download available of "server components and libraries" that would supply the missing pieces. However, that appears not to be available any longer.
What is the correct procedure now?
It looks like you don't have autoconf installed. Try running this:
brew install autoconf
and see if that helps resolve the issue!

Installing test-helpers extension for PHP on Windows fails

Trying to install phpunit test-helpers ( https://github.com/sebastianbergmann/php-test-helpers )
C:\>pecl install phpunit/test_helpers
downloading test_helpers-1.1.0.tgz ...
Starting to download test_helpers-1.1.0.tgz (10,370 bytes)
.....done: 10,370 bytes
4 source files, building
WARNING: php_bin C:\wamp\bin\php\php5.3.8\php.exe appears to have a suffix \php5.3.8\php.exe, but config variable php_suffix does not match
ERROR: The DSP test_helpers.dsp does not exist.
Using "pecl config-set php_suffix .exe" did not change anything. Unfortunately no recent precompiled DLL's are available to try setting them up manually.
Seems like it's an issue with the test-helpers distribution package.
See the issue and comments: https://github.com/sebastianbergmann/php-test-helpers/issues/6#issuecomment-3654335
If anyone knows how to fix it, it would be great! :)
Note: the Test-Helper extension is superseded by https://github.com/krakjoe/uopz

Categories