OSX 10.10 PHP Composer 找不到所需的扩展 intl 和 mcrypt
Posted
技术标签:
【中文标题】OSX 10.10 PHP Composer 找不到所需的扩展 intl 和 mcrypt【英文标题】:OSX 10.10 PHP Composer not finding required extensions intl and mcrypt 【发布时间】:2015-06-25 11:30:28 【问题描述】:我正在尝试使用以下命令在 OSX 10.10 上创建蛋糕 php 应用程序:
php /usr/local/bin/composer.phar create-project --prefer-dist cakephp/app testapp
当我这样做时,我收到以下错误:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- cakephp/cakephp 3.0.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.1.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0-beta3 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0-beta2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0-beta1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0-alpha2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0-alpha1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0-RC2 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0-RC1 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- cakephp/cakephp 3.0.0 requires ext-intl * -> the requested PHP extension intl is missing from your system.
- Installation request for cakephp/cakephp ~3.0 -> satisfiable by cakephp/cakephp[3.0.0, 3.0.0-RC1, 3.0.0-RC2, 3.0.0-alpha1, 3.0.0-alpha2, 3.0.0-beta1, 3.0.0-beta2, 3.0.0-beta3, 3.0.1, 3.1.x-dev, 3.0.x-dev].
我已通过 pear/pecl 安装了 intl 扩展,但仍继续收到此错误。
请有人恢复我对 PHP 的信心。
【问题讨论】:
【参考方案1】:您可能需要运行php5enmod intl
来激活PHP5 模块。
否则,请检查您是否已在 OS X 上正确的 PHP 安装中安装了intl
:有一个标准的 OS X 版本,但如果您在 OS X 版本的旁边安装了 PHP 版本,请检查是否您的 $PATH
变量中有正确的 PHP。
【讨论】:
我如何知道 pear 在哪里安装扩展以及 composer 在哪里寻找它们? 扩展名应该在/usr/share/php/extension
。据我所知,Composer 使用您的全局 php
和 php.ini
来检查扩展,这就是为什么您需要检查您的 $PATH
是否正在运行正确的 PHP 可执行文件。
因此,当我查看 /usr/share/php 目录时,唯一的文件夹名为 'fpm' 并包含一个名为 status.html 的文件...如何更改默认设置以使用此文件以上是关于OSX 10.10 PHP Composer 找不到所需的扩展 intl 和 mcrypt的主要内容,如果未能解决你的问题,请参考以下文章
osx 10.10 Curl POST 到 HTTPS url 给出 SSLRead() 错误
MAC OSX10.10上搭建Apache,PHP,MySQL5.6.22,phpMyAdmin开发环境