XAMPP 上的 PHP-intl 安装 [英] Php-intl installation on XAMPP

查看:45
本文介绍了XAMPP 上的 PHP-intl 安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在带有 XAMPP 的 mac 上使用扩展程序 intl.

I need to use the extension intl on my mac with XAMPP.

所以我关注了这个链接:

So I have followed this links:

XAMPP for Mac Lion 上的 PHP-intl 安装10.8

http://lvarayut.blogspot.it/2013/09/installing-intl-extension-in-xampp.html

我总是重启我的 apache 服务器,但没有安装扩展.因为如果我启动:

I restart always my apache server but isn't installed the extension. Because if I launch:

php -m | grep intl #should return 'intl'

返回空

没有它我无法启动的命令是用于 composer 和 cakephp 的,如下所示:

The command that I can't launch without it is for composer and cakephp like this:

composer create-project --prefer-dist -s dev cakephp/app cakephp3

返回这个错误:

Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for cakephp/cakephp 3.0.*-dev -> satisfiable by cakephp/cakephp[3.0.x-dev].
    - cakephp/cakephp 3.0.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system.
  Problem 2
    - cakephp/cakephp 3.0.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system.
    - cakephp/bake dev-master requires cakephp/cakephp 3.0.x-dev -> satisfiable by cakephp/cakephp[3.0.x-dev].
    - Installation request for cakephp/bake dev-master -> satisfiable by cakephp/bake[dev-master].

所以我需要用扩展intl来解决ext-intl的问题.

So I need to solve the problem of ext-intl with the extension intl.

有人可以帮我解决这个问题吗?如何安装此扩展程序?

Can someone help me with this problem? How can I install this extension?

谢谢

推荐答案

以下这些步骤对我有帮助,以防万一您使用的是 OSX

These below steps helped me, Just in case if you are using OSX

来自 http://www.phpzce 的步骤.com/blog/view/15/installing-intl-package-on-your-mac-with-xampp

  1. 检查设置了哪个php路径,即

  1. Check which php path is set i.e.

root$: which php

  • 如果您在 Mac 上使用 xampp,它应该是

  • If you are using xampp on your mac it should be

    /Applications/XAMPP/xamppfiles/bin/php 
    

    但是如果它

    /usr/bin/php 
    

    您需要更改您的 OSx php

    you need to change your OSx php

    root$: PATH="/Applications/XAMPP/xamppfiles/bin:${PATH}" 
    

  • 安装icu4c

  • Install icu4c

    root$: brew install icu4c 
    

  • 通过 PECL 安装 Intl

  • Install Intl via PECL

    root$: sudo pecl update-channels 
    root$: sudo pecl install intl 
    

  • 您可以检查 Intl 是否安装成功

  • You can check if Intl was installed successfully

    root$: php -m | grep intl #should return 'intl' 
    

  • 完成

    ==============================

    ============================

    注意:

    • /Applications/XAMPP/xamppfiles/etc/php.ini 文件中的扩展列表添加/取消注释 extension=intl.so 行.并重新启动Apache.谢谢@pazhyn

    • From extensions list in /Applications/XAMPP/xamppfiles/etc/php.ini file Add / Uncomment extension=intl.so line. And restart Apache. Thanks @pazhyn

    在安装intl"之前,如果你还没有安装 Autoconf,你必须先安装它.谢谢@Digant

    Before installing "intl" you have to install Autoconf if you have not installed it. Thanks @Digant

    • 通过 Homebrew brew install autoconf automake或
    • 通过运行下面的命令

    • via Homebrew brew install autoconf automake or
    • by running below commands

    curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz
    tar xzf autoconf-latest.tar.gz
    cd autoconf-*
    ./configure --prefix=/usr/local
    make
    sudo make install
    cd ..
    rm -r autoconf-*
    

    这篇关于XAMPP 上的 PHP-intl 安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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