在Mac上的XAMPP上安装PHP 7.0国际化扩展(国际) [英] Install PHP 7.0 Internationalization extension (Intl) on XAMPP on Mac

查看:302
本文介绍了在Mac上的XAMPP上安装PHP 7.0国际化扩展(国际)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照此处概述的说明进行操作:

I followed the instructions outlined here:

在Mac上的XAMPP上安装PHP国际化扩展(Intl)

Ran sudo pecl install intl 从酒窖中选择了正确的文件

Ran sudo pecl install intl selected the correct files from the Cellar

然后发生此错误:

/private/tmp/pear/temp/intl/intl_error.h:24:10:致命错误: 找不到"ext/standard/php_smart_str.h"文件

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

     ^ 1 error generated. make: *** [php_intl.lo] Error 1 ERROR: `make' failed

没关系,进行了一些研究,发现PHP 7.0.8不推荐使用php.smart_str.h到php.smart_string.h

No matter, did some research and found out that PHP 7.0.8 deprecated php.smart_str.h to php.smart_string.h

因此,由于我很少了解C ++,所以将smart_string.h复制到smart_str.h,并将所有标头从STRING重命名为字符串.....

So given my scant knowledge of C++ I copied smart_string.h to smart_str.h and renamed all the headers from STRING to string.....

重新运行pecl-没有运气....更多错误...因为我一直在使用XAMPP,所以不知道.c文件在哪里并且不重新构建php(不那么感兴趣),因为无论如何结束了该选择.

re-ran pecl -no luck....more errors......without knowing where the .c files are and remaking php (not really interested in going that far) since anyway I'm using XAMPP so that ended that option.

我在Mac上有php 5.5,位于usr/local/bin文件夹的深处 所以下一步就是让pecl使用这些文件并生成一个intl.so文件....

I have php 5.5 on my mac, deep in the usr/local/bin folder so next step was to get pecl to use those files and generate an intl.so file....

那是......我有intl.so文件,因此将其放在XAMPP的'extensions'文件夹中(以供参考:/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non- zts-20151012)

Did that....I have the intl.so file so put it in the 'extensions' folder in XAMPP (for reference: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012)

Ran php并出现以下错误:

Ran php and came up with this error:

警告:PHP启动:无法加载动态库 '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so' -dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so, 9):找不到符号:_zval_used_for_init引用自: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so 预期输入:平面命名空间 /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so 在第0行上的未知"中

Warning: PHP Startup: Unable to load dynamic library '/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so' - dlopen(/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so, 9): Symbol not found: _zval_used_for_init Referenced from: /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so Expected in: flat namespace in /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20151012/intl.so in Unknown on line 0

我想这与不同版本有关吗?

I imagine it has to do with different versions?

在任何情况下,如果没有XAMPP上的PHP 7.0.8中的make错误,我都无法获得pecl来安装intl.对此没有任何文档,您会认为,如果不赞成使用header.h文件,则会更新所有扩展名吗?

In any case I can't get pecl to install intl without a make error in PHP 7.0.8 on XAMPP. There is no documentation on this and you'd think that if you deprecate a header.h file you'd update all extensions?

似乎无法在PHP 7中安装intl.so吗?

Install intl.so in PHP 7 seems impossible?

推荐答案

到目前为止,似乎php的扩展名intl.so与php捆绑在一起 并应使用php(intl --enabled)进行编译. XAMPP不支持此功能(截至2016年10月),MAMP支持.我不了解其他发行版.但是,如果您愿意重新编译PHP 7,那么值得这样做,并在编译期间启用它.

So far, it seems that extension intl.so for php is bundled with php and should be compiled with php (intl --enabled). XAMPP does not support this (as of Oct 2016), MAMP does. I do not know about other distros. However, if you're willing to recompile PHP 7, it's worth it just to do that and enable it during compiling.

所以....我和MAMP一起跑步.然后我决定只安装apache 2.4和php 7以及Mysql,而无需使用MAMP或XAMPP附带的堆栈和垃圾,并且一切都像一个魅力……因此,如果您需要使用CakePHP或intl支持等...只需删除XAMPP/MAMP并进行标准安装即可.我使用自制软件(MacOS),一切正常.

So....I ran with MAMP. Then I decided that I would simply install apache 2.4 and php 7 and Mysql without the stack and the junk that comes with MAMP or XAMPP and everything works like a charm... so if you need to use CakePHP or intl support etc... just drop XAMPP/MAMP and go with a standard install. I used homebrew (MacOS) and everything is working fine.

更新:对于Windows,XAMPP不会默认使用它,但是您可以在php.ini中添加模块(dll)并像超级按钮一样工作

Update: As regards Windows, XAMPP does not default it, but you can add the module (dll) in php.ini and works like a charm

这篇关于在Mac上的XAMPP上安装PHP 7.0国际化扩展(国际)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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