Vasily Posted July 4, 2019 Share Posted July 4, 2019 (edited) Hello, I glad to share my way to debug code for WHMCS modules WHMCS uses IonCube Loader, so there is a lot of difficulties to use Xdebug and IonCube Loader together. The basic idea is to run the debug connection on demand in order to skip the encoded code. Install Xdebug yum -y install gcc gcc-c++ autoconf automake make php56-devel php56-pear pecl install Xdebug-2.5.5 Configure Xdebug cat > /etc/php.d/xdebug.ini <<FILE ;[xdebug] zend_extension="/usr/lib64/php/modules/xdebug.so" xdebug.remote_enable=1 xdebug.remote_autostart=0 xdebug.idekey=PHPSTORM xdebug.remote_handler="dbgp" xdebug.remote_mode="req" xdebug.remote_connect_back=1 xdebug.remote_port=9000 FILE Restart your httpd server and make sure Xdebug is loaded after IonCube [root@whmcs ~]# php -v PHP 5.6.40 (cli) (built: Jan 12 2019 13:11:15) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.3.2, Copyright (c) 2002-2018, by ionCube Ltd. with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans [root@whmcs~]# Configure the server in PHPStorm Start the debug session Start listening for PHP Debug Connections Add the following code to your file/class/method to interrupt executing and start the debug session ini_set('xdebug.remote_mode', 'jit'); try {throw new \Exception();} catch (\Exception $e) { $breakpoint = 1; } Edited July 9, 2019 by WHMCS ChrisD Added in a code to code box 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.