在lampp套件中编译gmp php扩展时缺少config.m4文件

在lampp套件中编译gmp php扩展时缺少config.m4文件,php,php-extension,gmp,lampp,phpize,Php,Php Extension,Gmp,Lampp,Phpize,我正在尝试用PHP7.1.7和api版本20160303编译LAMP套件的gmp。 我下载了gmp-6.1.2.tar.bz2,使用bzip2-dk gmp-6.1.2.tar.bz2获取tar文件,然后tar-xvvf gmp-6.1.2.tar然后cd gmp-6.1.2/ 当我运行/opt/lampp/bin/phpize时(我正在为开发人员使用lampp套件), 我得到了这个 Cannot find config.m4. Make sure that you run '/opt/lam

我正在尝试用PHP7.1.7和api版本20160303编译LAMP套件的gmp。 我下载了gmp-6.1.2.tar.bz2,使用
bzip2-dk gmp-6.1.2.tar.bz2

获取tar文件,然后
tar-xvvf gmp-6.1.2.tar
然后
cd gmp-6.1.2/
当我运行
/opt/lampp/bin/phpize
时(我正在为开发人员使用lampp套件), 我得到了这个

Cannot find config.m4. 
Make sure that you run '/opt/lampp/bin/phpize' in the top level source directory of the module
我正在尝试为php7.1.7编写gmp

不运行/opt/lampp/bin/phpize,并按照以下步骤进行配置 它使用api版本编译时没有任何错误20151012,但我的php说它需要20160303

在控制台上运行php,我得到以下信息:

PHP Warning:  PHP Startup: gmp: Unable to initialize module
Module compiled with module API=20151012
PHP    compiled with module API=20160303
These options need to match
 in Unknown on line 0

Warning: PHP Startup: gmp: Unable to initialize module
Module compiled with module API=20151012
PHP    compiled with module API=20160303
These options need to match
 in Unknown on line 0

根据您的评论,为了编译特定版本的GMP扩展,您需要克隆PHP-SRC存储库,并编译PHP GMP扩展

git clone git@github.com:php/php-src.git
您可以克隆目标分支,而不是克隆整个存储库

git clone -b PHP-7.1.7 git@github.com:php/php-src.git --depth 1
然后转到GMP扩展目录&phpize扩展并完成编译步骤

cd php-src/ext/gmp
phpize
./configure
make
sudo make install

你的扩展源代码是什么?我已经从这里下载了gmp源文件,这不是PHP扩展,这是gmp库,PHP扩展使用gmp库PHP_SRC默认带有gmp扩展,但是你仍然需要启用它,当你在编译带有标志
--with gmp
的PHP时,我没有编译PHP,检查问题,我正在使用lampp套件我还想补充一点,如果使用lampp套件编译扩展,请在使用
/configure--with php config=path\u php\u config