OSX xdebug and relation to PEAR - php

I have the Acquia Drupal stack 7.4.4 - which is using PHP 5.2.17 installed on an OSX 10.6.8
Drupal's PHP Stack:
User [~/]> php -v
PHP 5.2.17 (cli) (built: Jun 30 2011 12:12:11)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with Xdebug v2.1.0, Copyright (c) 2002-2010, by Derick Rethans
OS X's PHP Stack:
User [~/]> /usr/bin/php -v
PHP 5.3.4 (cli) (built: Dec 15 2010 12:15:07)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
As seen the Xdebug binary for PHP 5.2 downloaded from http://code.activestate.com/komodo/remotedebugging/ is correctly loaded with PHP 5.2.17 This is also verified with phpinfo.
The purpose for my questions is to reach a stage where I can compile the xdebug.so for the Acquia Drupal stack to be used with NetBeans 7.
So - which version of PEAR / PECL is the correct one to have installed on my system, the one for PHP 5.2.17 or the one for 5.3.4 - or does it not matter?
Thanks

You need a different .so for 5.2 and 5.3 as they have incompatible APIs. A "PEAR/PECL" version makes little sense as Xdebug only uses PEAR as the installer. Just make sure you have a PHP 5.2 and a PHP 5.3 Xdebug.so. The Komodo download provides both.

Great - "Xdebug only uses PEAR as the installer" - I had, with my limited experience, been wondering if those libraries were also used within xdebug/Acquia/NetBeans while actually debugging the code. So PEAR/PECL's sole pupose is now clarified, and it also remains clear that xdebug needs to be compiled for PHP 5.2 as that is the PHP version used by the Acquia 7.4.4 stack.
Now relying on Komodo binaries, without knowing how they were derived and why they do actually work, or even worse - why my own compilations does not work - that is a possible short cut and it does work for me for the time being.
but
... neither Xdebug, Drupal, Acquia or Netbeans provides an up to date description on how to compile the xdebug on a Mac for these tools used on a OS X 10.6.8 (64-bit intel). I assume a simple but up to date and clear step-by-step-guide e.g. as bullet points would benefit a lot of developers-want-to-be ... any takers?

Related

Wanting to learn/run PHP Unit Tests however realised I have old version of PHP

After writing some code in PHP I want to learn the best way to run unit tests against my code. I found a couple such as PHPUnit and SimpleTest but in the documentation I could see they were talking about PHP 7.0 +.
I checked which version of PHP I was running and it looks to be a very old version:
PHP 5.6.30 (cli) (built: Oct 29 2017 20:30:32)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
However when I open my MAMP is states 7.2.10
If I were to install a newer version of PHP on my MACOS Sierra 10.12.6 would this effect the running of my old PHP code (Note I am also running MAMP Version 5.2)? Thanks in advance.

PhpStorm Zero-Configuration Debugging not working for PHP 5.4.19

I'm using XAMPP version v3.2.1 and here's the output of php -v:
PHP 5.4.19 (cli) (built: Aug 21 2013 01:12:03)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
I want to set up Zero-Configuration Debugging with PhpStorm, so I followed all the steps (I think) and tried to launch a PHP file with breakpoints placed on it. But for some reason, when I open / refresh the page, it doesn't detect the breakpoint at all, nor it shows the incoming connection screen in PhpStorm.
I validated my setup here:
and I'm using https://github.com/BrianGilbert/xdebug-helper-for-firefox Firefox plugin.
I just want to simply debug my local PHP website as I browse through it, what am I doing wrong?
You are using PHP 5.4. Please, for the love of god, upgrade. This, and Xdebug's 2.2, haven't been supported for half a decade. Neither PHP 5.4 or Xdebug 2.2 are supported any more, and not for a very long time.

RPM php_mbstring installation on RHEL 7.4 and PHP 7.3 | Call to undefined function mb_substr()

May i know how to install php-mbstring. Here are my server version:
OS:NAME="Red Hat Enterprise Linux Server"VERSION="7.4 (Maipo)"
PHP:
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
I am restricted to connect to the internet. The only way to install php extensions is by downloading rpm. Here are the php extensions installed:
php-gd-7.3.4-1.el7.remi.x86_64
php-7.3.4-1.el7.remi.x86_64
php-sqlsrv-5.6.1-2.el7.remi.7.3.x86_64
php-json-7.3.4-1.el7.remi.x86_64
php-pdo-7.3.4-1.el7.remi.x86_64
php-cli-7.3.4-1.el7.remi.x86_64
php-pdo-dblib-7.3.4-1.el7.remi.x86_64
php-xml-7.3.4-1.el7.remi.x86_64
php-common-7.3.4-1.el7.remi.x86_64
php-soap-7.3.4-1.el7.remi.x86_64
php-pecl-mcrypt-1.0.2-1.el7.remi.7.3.x86_64
php-pgsql-7.3.4-1.el7.remi.x86_64
Kindly point me to the right direction to get the installer for php-mbstring. My application is very dependent from this function. PHP 5.XX works perfectly fine but I need to update my PHP version.
Thank you
You obviously need the php-mbstring package.
Please be aware than
RHEL 7.4 is outdated and unmaintained, current is 7.7
PHP 7.3.4 is outdated and unmaintained, affected by various security issues, including a critical one, current is 7.3.11
BTW, you can download php-mbstring-7.3.4-1.el7.remi.x86_64.rpm from online archive.

ionCube Loader on Windows 64-bit running PHP 5.6.8 not working

I have tried to configure ionCube Encoder on my Windows 10 PC running PHP 5.6.8 but without success. After downloading the encoder zip file from ioCube Loaders
I copied the "ioncube_loader_win_5.6.dll" to "C:\xampp\php\ext". Then I updated my php.ini file to loaded the encoder
[ionCube Loader]
zend_extension="C:\xampp\php\ext\ioncube_loader_win_5.6.dll"
and restarted apache, but when I test it from then command prompt using "php -v", it does not load. See my result
php -v
Failed loading C:\xampp\php\ext\ioncube_loader_win_5.6.dll
PHP 5.6.8 (cli) (built: Apr 15 2015 15:07:09)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
I also tried setting it up using the loader-wizard, but it did not work too. Anyone with useful information will be of great help right now.
Thanks
This Post is old but it might help other people. You have just to replace to dll. I had the same problem when using the 64bits dll. Replacing it with the x86 dll did the tric

Multiple PHP versions using phpenv, php-build and php-version

I'm on Arch Linux, trying to configure multiple PHP versions for testing my scripts.
I'm basing myself on these three tools:
https://github.com/phpenv/phpenv
https://github.com/CHH/php-build/
http://wilmoore.com/php-version/
First I installed Apache and PHP (and their integration package) with pacman:
# pacman -S php apache php-apache
Next, I followed the instructions for installing the tools on the links, everything is working fine.
I manage to install two versions with phpenv-install from php-build tool. I got something like this:
-- ~
|---.phpenv
|---lib
|---versions
|---5.5.1
|---5.4.17
|--- (some more folders)
On CLI environment everything is working fine, I can easily switch between the two versions with php-version:
$ php-version 5.5.1
$ php --version
PHP 5.5.1 (cli) (built: Aug 5 2013 22:54:47)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.2-dev, Copyright (c) 1999-2013, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
$ php-version 5.4.17
$ php --version
PHP 5.4.17 (cli) (built: Aug 5 2013 23:19:44)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
Now the problem: integrate this with apache.
As I said in the beginning of this post, I also had to install PHP from Arch repositories, which coincidentally is on version 5.4.17. This installation is working fine with Apache.
On php-env readme there are these instructions:
phpenv support dynamic switching for Apache apxs libraries and install
will build and install a libphp5.so shared library for Apache under
the versions libexec folder.
By calling phpenv global to show or change the global PHP version a
link is created under ~/.phpenv/lib/libphp5.so for the appropriate
release build. This link can be used for Apache's LoadModule
php5_module directive and requires Apache to restart when changed.
The problem is that there is no file or symlink named libphp5.so in lib directory neither in the whole .phpenv folder, because
$ find ~/.phpenv -name libphp5.so
returns nothing.
Maybe because english is not my first language, I'm having some problem to intepret the second paragraph of the quote above.
There is a package in the AUR for phpenv
https://aur.archlinux.org/packages/phpenv/
As well as packages for many different versions of PHP
https://aur.archlinux.org/packages/?O=0&C=0&SeB=nd&K=phpenv&outdated=&SB=n&SO=a&PP=50&do_Search=Go
First install phpenv:
yaourt phpenv
Then install the php versions you need, for example:
yaourt php53_29_env
Note: even with this though, you will likely have a problem. Checking the package build, it looks like it is missing the patch to disable PHP automatically being compiled with thread safe features when apache is running a thread safe mpm. Not quite sure since on my systems, I want PHP to enable thread safe code so it will work for me.

Categories