当前位置: 首页 > 面试题库 >

在XAMPP上安装php-intl

鲁烨
2023-03-14
问题内容

我需要在XAMPP的Mac上使用扩展名intl。

因此,我遵循了以下链接:

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

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

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

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

返回空

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

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的问题。

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

谢谢


问题答案:

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

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

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

    root$: which php
    
  2. 如果您在Mac上使用xampp,则应该

    /Applications/XAMPP/xamppfiles/bin/php
    

但是如果它

    /usr/bin/php

您需要更改您的OSx PHP

    root$: PATH="/Applications/XAMPP/xamppfiles/bin:${PATH}"
  1. 安装icu4c

    root$: brew install icu4c
    
  2. 通过PECL安装国际

    root$: sudo pecl update-channels
    

    root$: sudo pecl install intl

  3. 您可以检查Intl是否已成功安装

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

完成了

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

注意:

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

  • 在安装“ intl”之前,如果尚未安装Autoconf,则必须先安装它。谢谢@Digant

    • 通过Homebrew brew安装autoconf automake或
    • 通过运行以下命令
          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-



 类似资料:
  • 问题内容: 我已经在Windows XP上安装了xampp 1.7.4和php版本5.3.5。如何在Windows XP上使用PHP 5.3.5在Xampp中安装ffmpeg? 问题答案: 您可以从此处开始执行以下步骤,也可以执行以下步骤。 从此处下载ffmpeg:https://ffmpeg.org/download.html 将php_ffmpeg.dll从php5文件夹复制到C:\ wamp

  • 我有一台新安装OSX Mojave的Mac电脑。我下载了XAMPP(7.3)并安装了它。本地ApacheWeb服务器工作正常,我从仪表板获得的PHPInfo()显示了php的所有正确信息。ini文件为/Applications/XAMPP/xamppfiles/etc/php。伊尼。 我已经复制了一份PHPInfo,并将其放在向导中: https://xdebug.org/wizard.php 说

  • 本文向大家介绍PHP 下载并安装XAMPP,包括了PHP 下载并安装XAMPP的使用技巧和注意事项,需要的朋友参考一下 什么是 XAMPP? XAMPP是最流行的PHP开发环境。XAMPP是一个完全免费的、开源的、易于安装的Apache发行版,包含MariaDB、PHP和Perl。 我应该从哪里下载? 下载适当的稳定 XAMPP 版本 download.根据操作系统的类型(32位或64位操作系统版

  • 我使用的是XAMPP版本5.6。Mac OS X 10.10上的3-0。3约塞米蒂和我想安装Gmagick(https://pecl.php.net/package/gmagick)graphicsmagic的PHP API扩展。(http://www.graphicsmagick.org) 所以我下载了gmagick并将其编译为php: 然后我将其添加到php中。ini: 但该扩展未处于活动状态

  • 问题内容: 我从https://www.elastic.co/downloads/elasticsearch下载了 elasticsearch-5.1.1.zip 然后使用以下命令通过composer 下载用于Elasticsearch 的 Elastica A PHP客户端 作曲家需要ruflin / elastica:dev-master 现在我要打开并进行测试。当我运行此命令 bin \ e

  • 我一直在尝试在ubuntu16上安装xampp(5.6.24)。04,但我遇到了以下错误- /opt/lampp/etc/httpd的第136行出现语法错误。conf:无法加载模块/mod_ssl。所以进入服务器:/opt/lampp/modules/mod_ssl。所以:无法打开共享对象文件:没有这样的文件或目录 我尝试过在互联网上搜索,但是找不到任何专门针对ubuntu的东西。 任何建议都可能