Can't install Xdebug on PHP - php

Trying to install Xdebug so I can debug PHP with VS Code, followed the instructions of the page step by step, reference Xdebug wizard.
Download php_xdebug-3.1.6-8.1-vs16-x86_64.dll
Move the downloaded file to \xampp\php\ext, and rename it to php_xdebug.dll
Update C:\xampp\php\php.ini and add the line:
zend_extension = xdebug
Restart the Apache Webserver
To verify correct installation run cmd and type php -v, output should list Xdebug installed:
PHP 7.4.10 (cli) (built: Aug 18 2020 09:37:14) ( NTS DEBUG )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.10-dev, Copyright (c), by Zend Technologies
with Xdebug v3.0.0-dev, Copyright (c) 2002-2020, by Derick Rethan
Installation is trivial, I don't have cloned .ini files, I'm getting the right dll from the page, I'm restarting Apache, my renameing of the dll is right. I don't know what is going on, my output from cmd is:
C:\Users\User>php -v
PHP 8.1.13 (cli) (built: Nov 22 2022 15:49:14) (ZTS Visual C++ 2019 x64)
Copyright (c) The PHP Group
Zend Engine v4.1.13, Copyright (c) Zend Technologies
My PHP version is: 8.1.12
Also tried changing the ini file to
;zend_extension="c:\xampp\php\ext\php_xdebug.dll"
which is the actual path where the dll is located. Also my PHP is TS, so is the file it's downloading from the wizard. Any hints?

As #aynber said in a comment, semicolon is used for indicating comments and therefore the line
zend_extension="c:\xampp\php\ext\php_xdebug.dll"
is not processed

Related

How to install the pthreads PHP extension on Debian 9

Surprisingly, I can't find an answer anywhere. I need help to install the pthreads PHP extension on Debian 9 with PHP 7.3 installed.
If I write php -v, I get the following:
PHP 7.3.6-1+0~20190531112735.39+stretch~1.gbp6131b7 (cli) (built: May 31 2019 11:27:35) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.6-1+0~20190531112735.39+stretch~1.gbp6131b7, Copyright (c) 1999-2018, by Zend Technologies
I tried to download the .tgz file form pecl.php.net, extract it, put it in /etc/php/7.3/fpm/ext (I created the ext directory) and define the extension_dir as that directory in php.ini.
Then I wrote in the php.ini file extension=/etc/php/7.3/fpm/ext/pthreads-3.1.6 and I rebooted my server.
If I write php -m, I still not see the pthreads extension.

Set default version of Php in CentOS 7

I have two versions of PHP in opt/remi folder php56 and php72
but when I php -v on cmd it shows:
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans
How to set default version to PHP 7.2?
I have two versions of PHP in opt/remi folder php56 and php72
how to set default version to PHP 7.2
SCL are designed for parallel installation so don't alter default version in base system
Once the collection is enabled, the version will be used
$ scl enable php72 bash
$ php -v
PHP 7.2.8 (cli) (built: Jul 17 2018 05:35:43) ( NTS )
If you want 7.2 to be the default version (base system) you should install it, according to Wizard instructions for "Default / single version" (and keep 5.6 as secondary version)
Change php cli version in Centos 7
First, find your php7, run phpinfo() and get path or you can do with other ways. for me, it is:
/usr/local/lsws/lsphp73/
then:
cd ~
. ~/.bash_profile
And:
alias php='/usr/local/lsws/lsphp73/bin/php'
Now:
php -v
PHP 7.3.13 (cli) (built: Dec 20 2019 16:02:35) ( NTS )
Create a file "/etc/profile.d/php.sh". Use pathmunge to add the path to your php bin you want as default on line one and save the file.
Example:
pathmunge /opt/remi/php73/root/bin
Reload your profile afterwards by logging in again.
Now if you do a which php and php -v you should see the following output in my case
[root#host etc]# which php
/opt/remi/php73/root/bin/php
[root#host etc]# php -v
PHP 7.3.4 (cli) (built: Apr 2 2019 13:48:50) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.4, Copyright (c) 1998-2018 Zend Technologies
with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.3.4, Copyright (c) 2002-2019, by ionCube Ltd.
This is the preferred way to accomplish this task using tools that are already supplied on a minimal install. This also allows scripts and commands to hit the correct php binaries when accomplishing other tasks. Commands like, pear, pecl, phar, php-config. You want your experience to be global when setting the default, otherwise you might wind up still getting version 5.6's tools when trying to install an extension or complete another task.
module enable php74
for your understanding:
cat /opt/remi/php74/enable
export PATH=/opt/remi/php74/root/usr/bin:/opt/remi/php74/root/usr/sbin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/opt/remi/php74/root/usr/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export MANPATH=/opt/remi/php74/root/usr/share/man:${MANPATH}

PHP version Conflict between 5.5 and 7.1 in ubuntu 14.04 LTS

When I want to know my php version by terminal using
#php -v
I am getting
PHP 7.1.4-1+deb.sury.org~trusty+1 (cli) (built: Apr 11 2017 22:45:20) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.1.4-1+deb.sury.org~trusty+1,
Copyright (c) 1999-2017, by Zend Technologies
But when I am trying to run info.php written with php code
<?php phpinfo(); ?>
O/P
PHP Version 5.5.9-1ubuntu4.21
Please let me clear what is happening exactly with my php version.
I installed the full LAMP on my system freshly after un-install APACHE2, PHP & My-Sql.
Also, I recommend check Loaded Configuration File item at phpinfo() output.
Here I got /etc/php/7.0/apache2/php.ini using Ubuntu 16.04 LTS and PHP 7.0.15 with Apache.
Then at the terminal, run php --ini and check the same item Loaded Configuration File: to see if got any difference.

Installing Xdebug for use with PHPStorm

I want to install a debugger for PHP for my MAMP environment on Mac OS 10.8.5, where I run PHP 5.5.3. I am looking at PHPStorm and Xdebug. I am doing my best to follow the instructions on the PHPStorm site.
Here are my steps:
1) Download the Xdebug extension compatible with your PHP version
$ su admin
$ cd /Applications/MAMP/bin/php/
$ git clone git://github.com/xdebug/xdebug.git
I understand that this installs Xdebug 2.3.2 (Release date: 2015-03-22)
2) Copy the extension file to your web server in a location that is accessible by the web server. I do not understand what this extension file is, so I have been unable to complete this step.
3) Add the following lines at the end of your php.ini file:
[Xdebug]
zend_extension="/Applications/MAMP/bin/php/xdebug/php_xdebug.h"
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port="9000"
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/Applications/MAMP/tmp"
Note the additional final line, suggested by this page.
4) Restart your web server
5) Check your installation
$ php --version
PHP 5.3.28 (cli) (built: Jan 23 2014 18:02:48)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
Not the right version of PHP. Trying again:
$ /Applications/MAMP/bin/php/php5.5.3/bin/php --version
PHP 5.5.3 (cli) (built: Sep 18 2013 14:31:13)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
There is no sign of "With Xdebug..."
What exactly should I do at step 2? Have I made a mistake at any of the other steps? Are there further steps that I am missing?

how to update native php 5.3 mac installation with installed brew php 5.4 installation?

I am trying to work on laravel framework, i got an error for which i needed php5.4+. earlier i had installed php, apache and mysql somehow which came with mac.
when i check the versions i get as below:
$ /usr/local/Cellar/php54/5.4.19/bin/php -v
PHP 5.4.19 (cli) (built: Sep 17 2013 21:14:22) (DEBUG)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
$ php -v
PHP 5.3.15 with Suhosin-Patch (cli) (built: Aug 24 2012 17:45:44)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
right now php5.3 gets displed on phpinfo(), how to make apache use php5.4?
if which php still gives /usr/bin/php, add this line to the end of your ~/.bashrc (or ~/.zshrc if you use ZSH)
export PATH="$(brew --prefix)/bin:$PATH"
Also see https://github.com/josegonzalez/homebrew-php#installing-multiple-versions
EDIT
For Apache
LoadModule php5_module /usr/local/opt/php54/libexec/apache2/libphp5.so
php5.3, php5.4, php5.5
http://php-osx.liip.ch/
PHP 5.5
http://mac.tutsplus.com/tutorials/server/upgrading-the-native-php-installation-on-os-x-mountain-lion/

Categories