Tag Archives: Can’t find PHP headers in /usr/include/php The phpdevel package is required for use of this command.

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

report errors

phpize when compiling the extension, an error is reported: can’t find PHP headers in/usr/include/PHP the PHP devel package is required for use of this command

The PHP header file cannot be found in /usr/include/PHP , and the PHP devel package is required to use this command.

terms of settlement

phpize is used to extend the PHP extension module. A plug-in module of PHP can be established through phpize , phpize belongs to PHP devel , so just run Yum install PHP devel

yum install php-devel

Next you will install 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!

At this time, if you use phpize to compile the extension, an error occurs:

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

This indicates that the default phpize in the warehouse is inconsistent with the PHP version. We can take a look at the version of PHP devel , and then reinstall 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.

Just install PHP devel consistent with the current version, for example:

yum install php72w-devel