dongzhao5970 2017-01-04 20:26
浏览 106
已采纳

已安装PHP intl扩展,但CakePHP安装表示它已丢失

For over a day I have been trying to start a CakePHP 3 project. When I run the composer install command, I get the following error:

cakephp/cakephp 3.3.x requires ext-intl * -> the requested PHP extension intl is missing from your system.

I am using MacOS Sierra 10.12.2. XCode and all that jazz are fully up-to-date. I am running PHP 5.6.25 via MAMP Pro 4.0.1 (3985). And I am trying to install CakePHP 3.3.x through my terminal, which is using ZSH instead of Bash.

I've spent quite a while trying to get intl installed. And by now I'm pretty confident that it is indeed installed:

  1. When I run php -m I see intl in the list of PHP modules.
  2. I have extension=intl.so in my php.ini, located in /Applications/MAMP/bin/php/php5.6.25/conf/php.ini.
  3. The file intl.so is located in the directory /Applications/MAMP/bin/php/php5.6.25/lib/php/extensions/no-debug-non-zts-20131226.
  4. On MAMP's phpinfo page I can see '--enable-intl' in the Configure Command cell. Further down the page, it has its own table, showing that internationalization is supported with version 1.1.0. However, in this table, for the row intl.default_locale the value is no value. Could this be my problem?
  5. In my ~/.zshrc file I have alias php="/Applications/MAMP/bin/php/php5.6.25/bin/php" so I can be sure I'm using the correct version and installation of PHP.

I hope I haven't ruined anything by trying to use so many articles and StackOverflow answers to get this working. I know there are a number of similar intl questions here, but so far I've had no luck with any answers.

So I suppose here are my two main questions:

  1. Is the evidence I listed above enough to suggest I truly have the intl extension correctly installed, and why does CakePHP still complain about the extension being missed if it is correctly installed?
  2. If it is not correctly installed, how can I correct this and get CakePHP to install?

Thank you!

  • 写回答

2条回答 默认 最新

  • dongpo7467 2017-01-05 17:03
    关注

    Thank you to everyone who lent a hand in the comments. But a special thank you to Aman Rawat for pointing me to this answer. I've read through that thread a number of times, but apparently overlooked it.

    I added export PATH="/Applications/MAMP/bin/php/php5.6.25/bin:$PATH" to ~/.zshrc.

    I was then able to install CakePHP via composer.\

    I assumed I had MAMP's PHP in my path. I had it as an alias, so php in terminal would correctly point to MAMP's PHP install, but it turns out that PHP was never actually in my PATH.

    Oops!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线