Logo Questions Linux Laravel Mysql Ubuntu Git Menu

How to install xdebug in ubuntu 16.04 in netbeans?

Whenever I try to run this code

example@testserver:~$ sudo apt-get install php5-xdebug
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package php5-xdebug

I get this error "E: Unable to locate package php5-xdebug" Please help Thanks

like image 360
Umashankar Saw Avatar asked Jul 12 '16 12:07

Umashankar Saw

1 Answers

If you're running the default apt installation of PHP on Ubuntu 16.04, then it should be PHP7. If I had to guess from php5-xdebug, then I'd say you were using a command intended for Ubuntu 14.04 or older where the default PHP installation was PHP5. You can verify your PHP version with:

php --version

This is what I see:

PHP 7.0.8-0ubuntu0.16.04.2 (cli) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.8-0ubuntu0.16.04.2, Copyright (c) 1999-2016, by Zend Technologies
    with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans

At any rate, you should be able to search available packages for your configuration with:

apt search xdebug

From my relatively fresh Ubuntu 16.04 install without any added PPA's, I get one result:

php-xdebug - Xdebug Module for PHP

So you can install this package by name (note the missing "5" from your command):

sudo apt install php-xdebug

You might also have to restart your webserver. If you're running the stock build of Apache for Ubuntu 16.04:

sudo service apache2 restart
like image 127
Jeff Puckett Avatar answered Oct 23 '22 09:10

Jeff Puckett