Apache Xdebug



How you install Xdebug depends on your system. There are the following possibilities: Linux with a package manager such as apt, yum, or something else. Linux without an Xdebug package with PECL. Windows 10 1903, Apache 2.4.41 (Win64), PHP 7.3.9, Xdebug 2.7.0RC2, NetBeans 11.1, Java JRE 8u221.

Hello,
First of all thank you everyone for your help.
I have been struggling with the installation of xdebug for a while, and it has been very hard and at the end impossible. I have OSX 10.11 El Capitan and XAMP 5.6.3-0.
After fighting for a while I have understood somethings, the Mac comes with a apache server already installed so things like 'phpize' get called from the mac version instead for the Xampp, but the real point is, right now I have installed debug (it comes with Xamp, yes finally I discovered this) but when it's called throws this error (/Applications/XAMP/xamppfiles/logs/error_log)
Code: Select all
Xdebug requires Zend Engine API version 220121212.
The Zend Engine API version 220131226 which is installed, is newer.
Contact Derick Retinas at http://xdebug.org/docs/faq#api for a later version of Xdebug.

The problem I think is going on here (maybe I'm wrong) is that the server is calling zend from the Mac server (which is outdated and I don't use) instead of the xampp one, but probably I'm wrong.
Could someone help me please?

Apache Xdebug Ubuntu

Thank you very much
Free collection of beautiful vector icons for your web pages.

Introduction

Xdebug is a powerfull tool for debugging PHP. It can display formated errors and embed the usefull var_dump function.This page explains how to install and configure Xdebug.

Apache debugXdebug apache phpstorm

The following has been tested on a Cloud9 server with the following versions:

  • Linux 4.9.120-c9 (How to check my Linux version?)
  • Ubuntu 14.04.5 LTS Trusty (How to check my Linux version?)
  • PHP 7.2.9 (How to check my PHP version?)

Check you configuration

Sometime, Xdebug is not configure, and the var_dump function is not displayed properly.Create a PHP file on your server with the following content:

Check if the display is formated. On the following illustration, var_dumpis not displayed properly:

Apache Xdebug Enable

Check if the Xdebug module is installed. The following command displays the listof PHP modules instaled:

If Xdebug is already installed (Xdebug is in the list of instaled module), skip the next step.

Install Xdebug

Install the following package:

Restart Apache2 manualy or with the following command:

Configure Xdebug

Check if var_dump is now formated properly. If not, add or update the html_errorsparameter in your php.ini file:

Display should now be formated:

Optional configuration

I also strongly recommand to set the following parameters only on your local environment in your php.ini. Thiswill display PHP errors and warning in the page:

See also

Last update : 01/07/2021

Apache Xdebug Config

'>