dongshi3361 2013-10-24 18:56
浏览 42
已采纳

如何使作曲家识别intl php扩展

I'm trying to install some symfony bundles to create an admin tool found in this tutorial: http://www.ens.ro/2012/07/13/symfony2-jobeet-day-12-the-admin-bundle/

I'm using symfony 2.3.* and am using composer for my dependencies as described here: Cannot setup sonata using composer

but when I try to update my symfony buid as described in the above composer file (php composer.phar update) , I get this error:

  • Installation request for sonata-project/intl-bundle dev-master -> satisfiable by sonata-project/intl-bundle[dev-master].
    • sonata-project/intl-bundle dev-master requires ext-intl * -> the requested PHP extension intl is missing from your system.

now I know that the php intl extension is installed because it shows up in my info.php file (pictured here): http://johnpaulwhatnow.com/intl.png

so why does composer/symfony think the intl extension isn't installed?

Specs: Mamp| php 5.4.10| symfony 2.3.6

EDIT: I did find this error in my php error log:

[24-Oct-2013 14:05:11 America/Chicago] PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/intl.so' - dlopen(/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/intl.so, 9): Symbol not found: _zend_new_interned_string Referenced from: /Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/intl.so Expected in: flat namespace in /Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/intl.so in Unknown on line 0

Solved

I had to tell my CLI to use mamp's php, which had intl.so installed. I did this by creating a alias: alias phpmamp='/Applications/MAMP/bin/php/php5.4.19/bin/php'

then running the command I needed: phpmamp composer.phar update --prefer-dist

thank you for your answers!

  • 写回答

2条回答 默认 最新

  • dsdt66064367 2013-10-24 22:22
    关注

    Because you probably have two php.ini... one for cli and apache.

    You have to load intl extension in both.

    EDIT

    To find the php.ini that is used when php scripts run from cli use this command in the terminal:

    php -r 'phpinfo();' | grep 'php.ini'
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?