Search code examples
xcodemacososx-lionportphp-extension

Installing php-module using port on osx lion


I am trying install php5-intl on my osx lion.

I did install also Xcode.

When I run the command to install the module I get the following message.

> sudo port install php5-intl
--->  Computing dependencies for php5-intl
--->  Cleaning php5-intl

> locate *intl*|grep so\$
/opt/local/lib/php/extensions/no-debug-non-zts-20090626/intl.so

> sudo apachectl restart

My question is:

Is the php5-intl module installed and ready to be used in my apache?

P.S.:
If I look to my phpinfo() I don't see any reference to php-intl. Is it normal?


If I run

> php -m | grep intl
PHP Warning:  Module 'intl' already loaded in Unknown on line 0
intl

Then If I try to use it in Synfony2 I get the following error:

The Symfony\Component\Locale\Stub\StubLocale::getDisplayLanguage() is not implemented. 
Please install the 'intl' extension for full localisation capabilities

If I look to my phpinfo, no trace of php5-intl.


Solution

  • If it's not listed in phpinfo() (or php -m on the command line) then no, the module isn't enabled.

    If I were you I'd get this working on the command line first, since if I remember right Port uses it's own version of PHP (and Apache?), which could cause confusion.

    You'll need to enable the module with extension=php5-intl.so in your php.ini file, after adding that php -m should include intl, and you know the extension is working on the command line.

    Edit:

    PHP Warning:  Module 'intl' already loaded in Unknown on line 0
    

    This sounds like you maybe have the module enabled twice, though I don't think that's necessarily your problem.

    Try running a simple command line script that calls an intl function, it sounds to me like it's enabled for the command line but not for apache.