简体   繁体   English

如何在netbeans中的ubuntu 16.04中安装xdebug?

[英]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 我得到这个错误"E: Unable to locate package php5-xdebug"请帮助谢谢

If you're running the default apt installation of PHP on Ubuntu 16.04, then it should be PHP7. 如果你在Ubuntu 16.04上运行PHP的默认apt安装,那么它应该是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. 如果我不得不从php5-xdebug猜测,那么我会说你使用的是用于Ubuntu 14.04或更早版本的命令,其中默认的PHP安装是PHP5。 You can verify your PHP version with: 您可以使用以下命令验证PHP版本:

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: 从我相对较新的Ubuntu 16.04安装,没有任何添加的PPA,我得到一个结果:

php-xdebug - Xdebug Module for PHP php-xdebug - 用于PHP的Xdebug模块

So you can install this package by name (note the missing "5" from your command): 因此,您可以按名称安装此软件包(请注意命令中缺少的“5”):

sudo apt install php-xdebug

You might also have to restart your webserver. 您可能还需要重新启动Web服务器。 If you're running the stock build of Apache for Ubuntu 16.04: 如果您正在为Ubuntu 16.04运行Apache的库存版本:

sudo service apache2 restart

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM