phpize在/ usr / include / php中找不到PHP头文件

时间:2022-12-17 15:07:29

stack: PHP 5.4.23, php-fpm, nginx 1.4.x, centos 6.5

stack:PHP 5.4.23,php-fpm,nginx 1.4.x,centos 6.5

I was trying to install xdebug, had to run phpize command.

我试图安装xdebug,不得不运行phpize命令。

I have php5-devl already installed and pecl command works

我已经安装了php5-devl并且pecl命令工作

When I ran the command, it gave me the following error output:

当我运行该命令时,它给了我以下错误输出:

# phpize
Can't find PHP headers in /usr/include/php
The php-devel package is required for use of this command.

How to fix this error?

如何解决此错误?

4 个解决方案

#1


13  

I think you have not installed php-pear . I am not seeing it in that link.

我想你还没有安装php-pear。我没有在那个链接中看到它。

You can do it by yum install php-pear

你可以通过yum install php-pear来做到这一点

Info

You can install xdebug also using these steps

您也可以使用这些步骤安装xdebug

1) Install PHP’s devel package for PHP commands execution

1)安装PHP的devel包以执行PHP命令

yum install php-devel

Make sure you also have php-pear package installed

确保你还安装了php-pear软件包

yum install php-pear

2) Install GCC and GCC C++ compilers to compile Xdebug extension yourself.

2)安装GCC和GCC C ++编译器自己编译Xdebug扩展。

yum install gcc gcc-c++ autoconf automake

yum install gcc gcc-c ++ autoconf automake

3) Compile Xdebug

3)编译Xdebug

pecl install Xdebug

pecl安装Xdebug

4) Find the php.ini file using

4)使用找到php.ini文件

`locate php.ini`

And add the following line

并添加以下行

[xdebug]
zend_extension="/usr/lib64/php/modules/xdebug.so"
xdebug.remote_enable = 1

5) Restart Apache service httpd restart

5)重启Apache服务httpd restart

6) Test if it works – create test.php with the following code

6)测试它是否有效 - 使用以下代码创建test.php

<?php phpinfo(); ?>

#2


7  

The problem got solved by the PHP version that is used in the system.

该问题通过系统中使用的PHP版本得到解决。

My PHP Version was 5.6

我的PHP版本是5.6

So by running the following command I solved the problem

因此,通过运行以下命令,我解决了问题

yum install php56-devel

Where "56" is your version of PHP.

其中“56”是您的PHP版本。

#3


0  

My problem hasn't been solved using

我的问题还没有解决

yum install php-devel

But this helped me to solve the problem:

但这有助于我解决问题:

yum --enablerepo=remi,remi-php55 install php55-php-devel

#4


-1  

If you're on PHP 7 such as in my case just installing php-devel won't solve your problems, but you'll need to install some additional packages:

如果您使用的是PHP 7,例如在我的情况下安装php-devel将无法解决您的问题,但您需要安装一些额外的软件包:

yum install php-devel pcre-devel gcc make

yum install php-devel pcre-devel gcc make

And then you'll be able to follow Harikrishnan steps to get xdebug working (if not yet configured).

然后,您将能够遵循Harikrishnan步骤来使xdebug工作(如果尚未配置)。

#1


13  

I think you have not installed php-pear . I am not seeing it in that link.

我想你还没有安装php-pear。我没有在那个链接中看到它。

You can do it by yum install php-pear

你可以通过yum install php-pear来做到这一点

Info

You can install xdebug also using these steps

您也可以使用这些步骤安装xdebug

1) Install PHP’s devel package for PHP commands execution

1)安装PHP的devel包以执行PHP命令

yum install php-devel

Make sure you also have php-pear package installed

确保你还安装了php-pear软件包

yum install php-pear

2) Install GCC and GCC C++ compilers to compile Xdebug extension yourself.

2)安装GCC和GCC C ++编译器自己编译Xdebug扩展。

yum install gcc gcc-c++ autoconf automake

yum install gcc gcc-c ++ autoconf automake

3) Compile Xdebug

3)编译Xdebug

pecl install Xdebug

pecl安装Xdebug

4) Find the php.ini file using

4)使用找到php.ini文件

`locate php.ini`

And add the following line

并添加以下行

[xdebug]
zend_extension="/usr/lib64/php/modules/xdebug.so"
xdebug.remote_enable = 1

5) Restart Apache service httpd restart

5)重启Apache服务httpd restart

6) Test if it works – create test.php with the following code

6)测试它是否有效 - 使用以下代码创建test.php

<?php phpinfo(); ?>

#2


7  

The problem got solved by the PHP version that is used in the system.

该问题通过系统中使用的PHP版本得到解决。

My PHP Version was 5.6

我的PHP版本是5.6

So by running the following command I solved the problem

因此,通过运行以下命令,我解决了问题

yum install php56-devel

Where "56" is your version of PHP.

其中“56”是您的PHP版本。

#3


0  

My problem hasn't been solved using

我的问题还没有解决

yum install php-devel

But this helped me to solve the problem:

但这有助于我解决问题:

yum --enablerepo=remi,remi-php55 install php55-php-devel

#4


-1  

If you're on PHP 7 such as in my case just installing php-devel won't solve your problems, but you'll need to install some additional packages:

如果您使用的是PHP 7,例如在我的情况下安装php-devel将无法解决您的问题,但您需要安装一些额外的软件包:

yum install php-devel pcre-devel gcc make

yum install php-devel pcre-devel gcc make

And then you'll be able to follow Harikrishnan steps to get xdebug working (if not yet configured).

然后,您将能够遵循Harikrishnan步骤来使xdebug工作(如果尚未配置)。