Can't find PHP headers in /usr/include/php The php-devel package is required for use of this command.
报错
phpize
编译扩展时,报错:Can't find PHP headers in /usr/include/php The php-devel package is required for use of this command.
在 /usr/include/php
中找不到PHP头文件,使用此命令需要 php-devel
包。
解决办法
phpize
是用来扩展 php 扩展模块的,通过 phpize
可以建立 php
的外挂模块,phpize
是属于 php-devel
的内容,所以只要运行 yum install php-devel
就行了
yum install php-devel
接下来就会安装上 php-devel
Installed:
pcre-cpp-8.42-4.el8.x86_64 pcre-devel-8.42-4.el8.x86_64
pcre-utf16-8.42-4.el8.x86_64 pcre-utf32-8.42-4.el8.x86_64
php-devel-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64
Complete!
这时,如果使用 phpize
编译扩展出现 error:
Error: php72w-common confiicts with php-common-xxx.xx
You cold try using --skip-broken to work around the problem
You cold try running:rpm -Va --nofiles --nodigest
这说明仓库中默认的phpize
与 PHP 版本不一致,我们可以看下 php-devel
的版本,然后重新安装 phpize
。
yum info php-devel
Repository epel is listed more than once in the configuration
Last metadata expiration check: 1:46:46 ago on Tue 02 Nov 2021 09:08:48 AM CST.
Installed Packages
Name : php-devel
Version : 7.2.24
Release : 1.module_el8.2.0+313+b04d0a66
Architecture : x86_64
Size : 5.3 M
Source : php-7.2.24-1.module_el8.2.0+313+b04d0a66.src.rpm
Repository : @System
From repo : AppStream
Summary : Files needed for building PHP extensions
URL : http://www.php.net/
License : PHP and Zend and BSD and MIT and ASL 1.0
Description : The php-devel package contains the files needed for building PHP
: extensions. If you need to compile your own PHP extensions, you will
: need to install this package.
安装与当前版本一致的 php-devel
就可以了,例如:
yum install php72w-devel
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
2019-11-02 nvm —— Node版本管理工具