php-xdebug

Discussion in 'OpenLiteSpeed Suggestions and Requests' started by enthess, Sep 7, 2016.

  1. enthess

    enthess Member

    I am reading up about php-unit testing and the writer of "Modern PHP" suggests installing php-xdebug, since i am using lsphp70 all the time, how can i work with php-xdebug then?

    Is it easy for you to add lsphp70-xdebug to repo ?

    :)
     
  2. lsfoo

    lsfoo Administrator

    Hi enthess,

    We do not have an xdebug package for any lsphp versions. That said, I've read that there are issues with installing xdebug via package managers, so if you're willing to try, you could try installing xdebug from source.

    The few things to note when using lsphp vs regular php:
    1. Check your site's phpinfo for the ini location. This may be a non-standard location.
    2. The phpize and php commands will have to use /usr/local/lsws/lsphp7/bin/phpize, etc. instead of just 'phpize'.

    https://xdebug.org/docs/install
    Referring to the compiling and the configuration steps here.
     
  3. enthess

    enthess Member

    Hi awesome lsfoo!

    Alright, i will check this up! :)

    Thanks for the good help!
     
  4. ArchCodeMonkey

    ArchCodeMonkey New Member

    I wanted to set up Xdebug for my development VM and came here looking for the same information. I've worked through the process and seem to have figured out the main issues so I thought I'd post my findings to help out anyone else who comes after me. My VM is using CentOS 7, you will need to adjust the commands for whatever package manager your version of Linux uses.

    The steps I took are based upon the tailored instructions to install Xdebug available at https://xdebug.org/wizard.php (Requires HTML output of phpinfo() command).

    Compiling Xdebug requires the "phpize" and "php-config" tools (and a compiler). While a standard install of OpenLiteSpeed includes phpize, it is missing the PHP headers and the php-config command. The php-devel package can be used for standard PHP installs so I took a guess that there might be an equivalent lsphp70-devel package provided for OpenLiteSpeed and found I was right.

    Install the required dependencies (will be located in /usr/local/lsws/lsphp70/bin)

    Code:
    sudo yum install lsphp70-devel make gcc
    Download source tar and unzip (or clone the git project from git://github.com/xdebug/xdebug.git)

    Code:
    wget http://xdebug.org/files/xdebug-2.5.4.tgz
    tar -xvzf xdebug-2.5.4.tgz
    Change to source directory

    Code:
    cd xdebug-2.5.4
    Run phpize (will need to use full path)

    Code:
    /usr/local/lsws/lsphp70/bin/phpize
    Run ./configure (will need to provide full path to php-config)

    Code:
    ./configure --with-php-config=/usr/local/lsws/lsphp70/bin/php-config
    Run make

    Code:
    make
    Copy the compiled module somewhere (e.g. The LiteSpeed PHP modules directory)

    Code:
    sudo cp modules/xdebug.so /usr/local/lsws/lsphp70/lib64/php/modules
    Edit the php.ini file to enable the compiled module in PHP (all available settings are documented at https://xdebug.org/docs/all_settings)

    Code:
    sudo nano /usr/local/lsws/lsphp70/etc/php.ini
    Add the following at the end of the file.

    Code:
    [xdebug]
    zend_extension = /usr/local/lsws/lsphp70/lib64/php/modules/xdebug.so
    xdebug.remote_enable=1
    xdebug.remote_connect_back=1
    xdebug.remote_port=9000
    Restart OpenLiteSpeed

    Code:
    sudo /usr/local/lsws/bin/lswsctrl restart
    If you run phpinfo() again xdebug should be now listed under the configuration section.
     
  5. lsfoo

    lsfoo Administrator

    Nice work! Looks good!
     

Share This Page