2017-04-21 14:32 阅读 363


I have PHP 7.1 on Ubuntu 16.04 installed. When I'm trying to install Xdebug by using apt-get install php-xdebug, I'm getting xdebug.ini in directories 5.6, 7.0 and 7.1.

I don't need /php/5.6/mods-available/xdebug.ini and /php/7.0/mods-available/xdebug.ini extensions, because I'm using only PHP 7.1 version.

Any ideas?


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

4条回答 默认 最新

  • 已采纳
    dragon201401 dragon201401 2017-04-21 14:50

    It's because php-xdebug is ambiguous and will download the default package which will contain multiple versions for php compatibility, try going to xdebug site and download the code, then make/build it

    点赞 10 评论 复制链接分享
  • doulou9927 doulou9927 2018-01-20 19:33

    I used these commands to get xdebug installed and running on 7.2

    git clone git:// && cd xdebug 
    apt-get install -y php7.2-dev && ./
    service php7.2-fpm restart
    点赞 8 评论 复制链接分享
  • douxiexie3574 douxiexie3574 2019-01-23 01:19

    Xdebug has an awesome wizard(form) where you can just paste the content of your php.ini or results of php -i command and get step by step instructions on how to go about setting it up.

    In my experience, it's the most reliable and error-free method and I have used in vagrant instances with both mod-php and php-fpm 7.1 & 7.2 versions without any issues.

    点赞 5 评论 复制链接分享
  • doulangchao8934 doulangchao8934 2017-04-21 14:35


    apt install php7.1-xdebug

    If I good understood, you don't want to have many xdebug ini files. Ubuntu supports many php versions, which you can switch if you need. If you want to have single xdebug configuration file, I recommend to create catalog mods-available in /etc/php, move xdebug.ini there and make symbolic link from all required paths (for apache2, cli for every php version you need) - for example, for PHP 7.1 with Apache

    ln -s /etc/php/mods-available/xdebug.ini /etc/php/7.1/apache2/conf.d/20-xdebug.ini

    点赞 评论 复制链接分享