在php 5.6 Amazon Linux AMI上安装xdebug

时间:2016-05-18 22:02:25

标签: linux amazon-web-services redhat xdebug fedora

我创建了一个Elastic Beanstalk环境

ID_LIKE="rhel fedora"
VERSION_ID="2016.03"
PRETTY_NAME="Amazon Linux AMI 2016.03"
ANSI_COLOR="0;33"
CPE_NAME="cpe:/o:amazon:linux:2016.03:ga"
HOME_URL="http://aws.amazon.com/amazon-linux-ami/"

我尝试使用

安装xdebug
sudo yum install php-pecl-xdebug

但我一直收到以下错误

Loaded plugins: priorities, update-motd, upgrade-helper
Resolving Dependencies
--> Running transaction check
---> Package php-pecl-xdebug.x86_64 0:2.2.3-1.5.amzn1 will be installed
--> Processing Dependency: php(api) = 20090626-x86-64 for package: php-pecl-xdebug-2.2.3-1.5.amzn1.x86_64
--> Processing Dependency: php(zend-abi) = 20090626-x86-64 for package: php-pecl-xdebug-2.2.3-1.5.amzn1.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Conflict: php56-common-5.6.21-1.124.amzn1.x86_64 conflicts php-common < 5.5.22-1.98
--> Finished Dependency Resolution
Error: php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

我应该使用什么?作为参考,我如何确定哪些包可用? 非常感谢。

1 个答案:

答案 0 :(得分:8)

php-pecl-xdebug取决于Amazon Linux 2.3的默认PHP版本。由于您安装了PHP 5.6,因此会发生冲突。

不幸的是,看起来Amazon Linux只有xdebug的软件包,最高可达PHP 5.5:

[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ sudo yum search xdebug
Loaded plugins: priorities, update-motd, upgrade-helper
============================= N/S matched: xdebug ==============================
php-pecl-xdebug.x86_64 : PECL package for debugging PHP scripts
php54-pecl-xdebug.x86_64 : PECL package for debugging PHP scripts
php55-pecl-xdebug.x86_64 : PECL package for debugging PHP scripts

  Name and summary matches only, use "search all" for everything.

由于有PECL包,您可以通过以下方式安装:

[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ sudo yum install php-pear php56-devel gcc
[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ sudo mount -o remount,exec /var/tmp/
[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ sudo pecl install xdebug
[ec2-user@ip-xxx-xxx-xxx-xxx ~]$ sudo mount -o remount,noexec /var/tmp/