Xdebug errors after update to PHP7

xdebug
apache
php

#1

No problem! Running into a new issue which I think i need to give up for. I’m getting the xdebug warning on apache run.

Warning: can't enable debugging because xdebug plugin for php is not installed.

Tried following the instructions here: https://github.com/c9/c9.ide.run.debug.xdebug (after installing php7.0-dev) but the make fails. Tried installing manually from xdebug website as well but the make fails again…

make: *** [xdebug.lo] Error 1
ERROR: `make' failed

I can’t figure this one out and I’m completely stuck.


Xdebug plugin for php is not installed - Using php7
Updated to PHP7 but now cannot install phpMyAdmin
#2

Try installing Xdebug from the PPA directly:

sudo apt-get install xdebug

It should be at version 2.4.0~rc3 which has support for PHP 7. Haven’t tested it but that should work.


#3

Get the following error:

sudo apt-get install xdebug
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package xdebug

apt-cache search xdebug
results in:

php5-xdebug - Xdebug Module for PHP 5
php-xdebug - Xdebug Module for PHP

Running:
sudo apt install php-xdebug
Stats I have php-xdebug up-to-date.

php-xdebug is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 25 not upgraded.

php -m Shows that xdebug is listed!


#4

The solution in #post 2 doesn’t seem to work.

E: Unable to locate package xdebug


#5

Any updates on this? I am getting:

Warning: can’t enable debugging because xdebug plugin for php is not installed.
see https://github.com/c9/c9.ide.run.debug.xdebug for details.

php -v

PHP 7.1.13-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Jan 16 2018 15:37:12) ( NTS )
Copyright © 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright © 1998-2017 Zend Technologies
with Zend OPcache v7.1.13-1+ubuntu14.04.1+deb.sury.org+1, Copyright © 1999-2017, by Zend Technologies
with Xdebug v2.5.5, Copyright © 2002-2017, by Derick Rethans

I am trying to develop a Symfony 4 project and need PHP 7.1.


#6

@onlinespaces what runner do you use, if it is the default php runner, it will launch apache which uses different php.ini
You need to use a new runner similar to Xdebug plugin not installing in workspace, with the command for starting symphony, (likely php bin/console server:run)


#7

I am using the Apache https (PHP, HTML) runner.

Since Laravel, Symfony, and others are starting to make php 7.1 mandatory, it would be great to get this working without running a custom runner.

I am trying to create a container that I can use at a container that I can clone to start new projects.

Here are the steps I took:

  • sudo add-apt-repository ppa:ondrej/php -y

  • sudo apt-get update -y

  • sudo apt-get install php7.1-curl php7.1-dev php7.1-gd php7.1-intl php7.1-mcrypt php7.1-json php7.1-mysql php7.1-opcache php7.1-bcmath php7.1-mbstring php7.1-soap php7.1-xml php7.1-xdebug

  • sudo a2dismod php7.0

  • sudo apt-get install libapache2-mod-php7.1 -y

  • Added
    zend_extension=xdebug.so
    xdebug.remote_enable=1
    to /etc/php/7.1/mods-available/xdebug.ini

  • sudo phpenmod xdebug

  • Added xdebug.remote_enable=1 to loaded php.ini.

php -v gives me:

PHP 7.1.13-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Jan 16 2018 15:37:12) ( NTS )
Copyright © 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright © 1998-2017 Zend Technologies with Zend OPcache v7.1.13-1+ubuntu14.04.1+deb.sury.org+1, Copyright © 1999-2017, by Zend Technologies with Xdebug v2.5.5, Copyright © 2002-2017, by Derick Rethans

phpinfo() on webpage also shows PHP Version 7.1.13-1+ubuntu14.04.1+deb.sury.org+1 and xdebug being enabled.

I sent an invite so you could take a look. The website homepage shows phpinfo().

Thanks.


#8

Running php bin/console server:run *:8080 starts the web server.

I created a runner called “Symfony Runner” but it is not working:

{
    "script": [
        "php bin/console server:run *:8080"
    ],
    "selector": "^.*\\.(php|phar)$",
    "info": "Running PHP script $file",
    "working_dir": "$project_path",
    "debugger": "xdebug",
    "debugport": 9000,
    "env": {
        "XDEBUG_CONFIG": "xdebug.remote_enable=1 idekey=cloud9ide remote_host=localhost remote_port=9000 remote_mode=req"
    }
}

also tried

{
    "cmd": [
        "php bin/console server:run *:8080"
    ],
    "selector": "^.*\\.(php|phar)$",
    "info": "Running PHP script $file",
    "working_dir": "$project_path",
    "debugger": "xdebug",
    "debugport": 9000,
    "env": {
        "XDEBUG_CONFIG": "xdebug.remote_enable=1 idekey=cloud9ide remote_host=localhost remote_port=9000 remote_mode=req"
    }
}

#9

The version with “script” is correct.
It wasn’t working because symphony hits the same bug in cloud9 debugger laravel was hitting.
the fix will be deployed in next couple of days, but until that you can add the following snippet to your user script.

P=require("plugins/c9.ide.run.debug.xdebug/lib/DbgpSession").prototype;
if (/throw/.test(P._handleInit.toString()))
    P._handleInit = eval("("+P._handleInit.toString().replace("throw", "")+")")`

#10

The fix was deployed yesterday, please let us know if you still experience any issues with debugging