致命错误:找不到"ext/standard/php_smart_str.h"文件 [英] Fatal error: 'ext/standard/php_smart_str.h' file not found

查看:588
本文介绍了致命错误:找不到"ext/standard/php_smart_str.h"文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了MacOS Mojave,并在2012年中的Macbook Pro上进行了全新安装.使用命令行工具安装了XCode.使用PEARL,PECL和ICU的最新版本(63.1),可以使用本机Apache和PHP,以供以后使用Intl扩展.

I downloaded MacOS Mojave and did a clean installation on my mid 2012 macbook Pro. Installed XCode with command line tools. Got native Apache and PHP working, with PEARL, PECL and last version of ICU (63.1) for later use of Intl extension.

但是,每次安装Intl的尝试都失败了.在进行干净安装之前,我在笔式驱动器上找到了一个intl.so并使用了ICU版本54,但这并不是使事情在开发环境中正常工作的最佳方法.

But every attempt of Intl instalation has failed. Before the clean instalation, i found a intl.so on a pen drive and used ICU version 54, but isn't the best way to get things working for a development enviroment.

最后,由于无法找到php_smart_str.h文件,我陷入了无法完成Intl的PECL的困境.

In the end, i'm stuck with PECL incapable of finish intall of Intl because can't find php_smart_str.h file.

我也重新安装了开发人员工具的头文件:

I've reinstalled the developer tools header files too:

$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

没有Homebrew是否有可能拥有一个开发环境?

Is it possible to have a development enviroment without Homebrew?

当我在航站楼上奔跑时:

When i run at the terminal:

sudo pecl install intl

返回以下内容:

/private/tmp/pear/install/intl/intl_error.h:24:10: fatal error: 'ext/standard/php_smart_str.h' file not found

在创建libtool并运行后:make.

Right after creating libtool and running: make.

推荐答案

好吧,我真的不想使用自制软件,而是只想使用Mac OS Mojave预先安装在MacBook Pro上的本机apache和php,以尝试维护CakePHP可以使用的最干净的开发环境.

Ok, instead of using homebrew, i really wanted to use only native apache and php pre-installed on my MacBook Pro with Mac OS Mojave, trying to maintain the most clean development environment possible for CakePHP use.

因此,在Pecl官方网站上( https://pecl.php.net/package/intl ),显然Intl软件包已不再维护,并已被取代.从PHP 5.3.0开始,您不需要使用Pecl来安装intl扩展,它与PHP捆绑在一起.

So, on Pecl Official site ( https://pecl.php.net/package/intl ), it's clear that Intl package is not maintained anymore and has been superseded. Since PHP 5.3.0 you don't need to use Pecl to install intl extension, it's bundled with PHP.

但是,在Mac OS Mojave上的PHP 7.1.24本机安装中缺少此功能.

But, it's missing on native instalation of PHP 7.1.24 on Mac OS Mojave.

然后我从php.net下载了PHP 7.1,安装了XCode命令行工具,ICU( http://site.icu-project.org/),Autoconf,重新安装开发人员工具头文件,最后使用phpize安装了Intl扩展名.

Then i downloaded PHP 7.1 from php.net, installed XCode Command Line Tools, ICU (http://site.icu-project.org/), Autoconf, reinstalled the developer tools header files, and finally installed Intl extension using phpize.

重要提示:您必须禁用SIP.

Important: you'll have to disable SIP.

这篇关于致命错误:找不到"ext/standard/php_smart_str.h"文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆