Home > Backend Development > PHP Tutorial > phpize 动态添加 PHP 扩展的错误及解决方案

phpize 动态添加 PHP 扩展的错误及解决方案

PHPz
Release: 2018-09-30 16:17:22
forward
1028 people have browsed it

使用phpize 动态添加 PHP 扩展是开发中经常需要做的事情,但是在 macOS 中,首次使用该功能必然会碰到一些错误,本文列出了这些错误的解决方法。

问题一:

执行 phpize 报错如下:

$ phpize grep: /usr/include/php/main/php.h: No such file or directory grep: /usr/include/php/Zend/zend_modules.h: No such file or directory grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory Configuring for: PHP Api Version: Zend Module Api No: Zend Extension Api No:

解决方法:

$ ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include /usr/include

PS:如果 sudo 授权后仍提示没有操作权限,请参考文章 macOS 中的 Rootless 机制 。

问题二:

执行 phpize 报错如下:

$ phpize Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. 解决方法:

先安装 Homebrew :

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

然后安装 autoconf :

$ brew install autoconf

PS:Homebrew 的强大谁用谁知道。关于什么是 Homebrew,以及 Homebrew 的使用,请点击Homebrew传送门。不建议手动安装 autoconf 软件包,因为依赖包太多~~

Recent posts from the php Quickfix site:

PrestaShop 1.7 starts the Symfony journey for the Community 
#prestashop, #symfony, #framework, #community Burnout in Tech - Laravel News 
#burnout, #technology, #developer New in Symfony 3.2: DX improvements (Symfony Blog) 
#symfony, #developer, #experience, #improvement PHP: rfc:security-classification 
#rfc, #security, #classification Do you know YAML? | Blog of Leonid Mamchenkov 
#yaml, #guide, #specification Red Hat will provide PHP 7.0 for RHEL - Remi's RPM repository - Blog 
#redhat, #php7, #rhel, #product, #release Introducing the SensioLabsInsight commit status on GitHub - SensioLabs Insight Blog 

更多相关教程请访问 php编程从入门到精通全套视频教程

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template