安装xxtea扩展提示“ERROR: failed to run `phpize’”的解决方法

海枫 -
安装xxtea扩展提示“ERROR: failed to run `phpize’”的解决方法

今天给网站换服务器结果无法正常运行,一步步排查后发现是没有安装xxtea扩展导致加解密函数无法使用,于是就安装xxtea扩展

pecl install xxtea

结果提示一堆警告加一个错误提示ERROR: failed to run 'phpize'

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update

Warning: readlink() has been disabled for security reasons in OS/Guess.php on line 201
PHP Warning:  readlink() has been disabled for security reasons in /usr/local/php/lib/php/OS/Guess.php on line 201

Warning: popen() has been disabled for security reasons in OS/Guess.php on line 254
PHP Warning:  popen() has been disabled for security reasons in /usr/local/php/lib/php/OS/Guess.php on line 254

Warning: fgets() expects parameter 1 to be resource, null given in OS/Guess.php on line 255
PHP Warning:  fgets() expects parameter 1 to be resource, null given in /usr/local/php/lib/php/OS/Guess.php on line 255

Warning: pclose() expects parameter 1 to be resource, null given in OS/Guess.php on line 264
PHP Warning:  pclose() expects parameter 1 to be resource, null given in /usr/local/php/lib/php/OS/Guess.php on line 264
downloading xxtea-1.0.11.tgz ...
Starting to download xxtea-1.0.11.tgz (7,404 bytes)
.....done: 7,404 bytes
4 source files, building
running: phpize

Warning: popen() has been disabled for security reasons in PEAR/Builder.php on line 525
PHP Warning:  popen() has been disabled for security reasons in /usr/local/php/lib/php/PEAR/Builder.php on line 525
ERROR: failed to run `phpize'

于是开始疯狂的百度,百度给出的结果大概意思是在php.ini里将popen函数禁用了,只需要将php.ini里disable_functions的值里面的popen去掉即可
最初:

disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,`popen`,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server

修改后:

disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server

然后重启php-fpm

/etc/init.d/php-fpm restart

再次安装xxtea扩展成功,重启php-fpm,网站正常运行!

特别申明:本文内容来源网络,版权归原作者所有,如有侵权请立即与我们联系(cy198701067573@163.com),我们将及时处理。

php介绍

PHP即“超文本预处理器”,是一种通用开源脚本语言。PHP是在服务器端执行的脚本语言,与C语言类似,是常用的网站编程语言。PHP独特的语法混合了C、Java、Perl以及 PHP 自创的语法。利于学习,使用广泛,主要适用于Web开发领域。

Tags 标签

phppecl

扩展阅读

加个好友,技术交流

1628738909466805.jpg