Rectangle 27 40

Install the PHP intl extension

First of all, you will need the PHP intl extension, as the Twig extension is built on top of that. The Twig Intl extension will throw an Exception if the PHP intl extension is not enabled. Installation instructions can be found in the official PHP documentation.

On Ubuntu/Debian machines, this is as easy as running the following command:

sudo apt-get install php5-intl

On Windows machines, you probably have to uncomment the following line in php.ini:

extension=php_intl.dll

...and then restart the web server.

Next, you will need the Twig Extensions package (that contains the Intl extension, amongst others) which can be installed using Composer. Run this command in the command line:

composer require twig/extensions ^1.2
composer.json

Note: the localizednumber and localizedcurrency filters were introduced in version 1.2.0, so you need at least that version if you want to use them.

If you are using Twig in a simple PHP project, you can add the extension using the addExtension() method.

$twig = new Twig_Environment($loader);
$twig->addExtension(new Twig_Extensions_Extension_Intl());

If you are using a Symfony application, you can add the extension to Twig using the service configuration in app/config/services.yml:

services:
    twig.extension.intl:
        class: Twig_Extensions_Extension_Intl
        tags:
            - { name: twig.extension }
Locale::setDefault('nl-NL');
app/config/config.yml
parameters:
    locale: nl

php - How to install the Intl extension for Twig - Stack Overflow

php twig intl twig-extension
Rectangle 27 40

Install the PHP intl extension

First of all, you will need the PHP intl extension, as the Twig extension is built on top of that. The Twig Intl extension will throw an Exception if the PHP intl extension is not enabled. Installation instructions can be found in the official PHP documentation.

On Ubuntu/Debian machines, this is as easy as running the following command:

sudo apt-get install php5-intl

On Windows machines, you probably have to uncomment the following line in php.ini:

extension=php_intl.dll

...and then restart the web server.

Next, you will need the Twig Extensions package (that contains the Intl extension, amongst others) which can be installed using Composer. Run this command in the command line:

composer require twig/extensions ^1.2
composer.json

Note: the localizednumber and localizedcurrency filters were introduced in version 1.2.0, so you need at least that version if you want to use them.

If you are using Twig in a simple PHP project, you can add the extension using the addExtension() method.

$twig = new Twig_Environment($loader);
$twig->addExtension(new Twig_Extensions_Extension_Intl());

If you are using a Symfony application, you can add the extension to Twig using the service configuration in app/config/services.yml:

services:
    twig.extension.intl:
        class: Twig_Extensions_Extension_Intl
        tags:
            - { name: twig.extension }
Locale::setDefault('nl-NL');
app/config/config.yml
parameters:
    locale: nl

php - How to install the Intl extension for Twig - Stack Overflow

php twig intl twig-extension
Rectangle 27 21

Had to disable the System Integrity Protection like Dan Willis suggested.

php - Failed to write error when installing intl extension on Os x El ...

php pecl osx-elcapitan intl
Rectangle 27 3

You need to install PHP intl extension.i had the same error

$count      =   Yii::$app->db->createCommand('
                    SELECT COUNT(*) FROM screen_ticket_booking_history WHERE status=:status
                    ', [':status' => 0])->queryScalar();

                    $sql =  "SELECT A1.booking_id As Booking_id,
                                A1.booking_date As Booking_date,
                                A2.movie_name As Movie,
                                A3.theatre_name As Theatre,
                                A1.amount As Amount

                                FROM 
                                screen_ticket_booking_history A1

                                LEFT OUTER JOIN movies A2 ON A1.movie_id=A2.id
                                LEFT OUTER JOIN theatres A3 ON A1.theatre_id=A3.id
                                LEFT OUTER JOIN users_backend A4 ON A3.users_backend_id=A4.id

                                WHERE A1.booking_date = '{$day}'
                                AND   A1.movie_id='{$movies->id}'";


                    //~ $models = $dataProvider->getModels(); //print_r($models);die();
                    if( $userid != '1')
                    { 
                        $sql .= " AND A3.users_backend_id = '{$userid}' ";
                    }

                    $dataProvider = new SqlDataProvider([
                    'sql' => $sql,
                    'totalCount' => $count,
                    ]);
                    return $this->render('index',
                    [   'model'             => $model,
                        'dataProvider'      => $dataProvider,
                    ]);
                }
<?= GridView::widget([
       'dataProvider' => $dataProvider,
       'columns' => [
           ['class' => 'yii\grid\SerialColumn'],

           'Booking_id',
           'Booking_date',
           'Movie',
           'Theatre',
           'Amount',
           //~ ['class' => 'yii\grid\ActionColumn'],
       ],
   ]); ?>

php - Yii2 custom sql query in gridview - Stack Overflow

php sql gridview yii yii2
Rectangle 27 1

It looks like you need to install two PHP extensions to make this work: curl and intl (which provides the lib-icu required by symfony/icu). Since you are using Windows, I recommend the official guide on how to install extensions on Windows systems. You can find the intl extension in the PECL repository here.

curl

Curl is enabled. and intl is enabled. Now relaunching clonization of Sylius...

If you run php -i, it should show you a (long) list of the active PHP extensions. Are curl and intl in that list?

i did php -i and redirect the output in a text file, then did a search for intl and curl. Result --> " Cannot find curl" and also intl. intl and curl both have a tick in Wamp Server

php - Installing Sylius - Stack Overflow

php symfony frameworks sylius
Rectangle 27 3

I had the same problem with XAMPP. I tried several answers but without success. Could solve lowering an alternative library http://php-osx.liip.ch/. This library php, comes already installed intl and several other package. After downloading went to httpd.conf in xampp and LoadModule php5_module pointed to these packages in /usr/local/php5/libphp5.so

could be a solution, I'll try as soon as possible, thanks

I've just tried this - it worked! Thanks! I also had to add /usr/local/php5/bin to the front of the PATH variable. Once I'd done that, it all seemed to go ok. I've been trying all sorts of things for 2 days now, and this seems to have cracked it for me!

macos - Php-intl installation on XAMPP - Stack Overflow

php macos apache cakephp
Rectangle 27 2

In my case, PHP GD was not installed in the Vagrant config. So in the PHP section of my Puphpet config, i added:

php:
    install: '1'
    version: '55'
    composer: '1'
    composer_home: ''
    modules:
        php:
            - cli
            - intl
            - mcrypt
            - gd
    pear: {  }
    pecl:
        - pecl_http
ini:
    display_errors: On
    error_reporting: '-1'
    session.save_path: /var/lib/php/session
timezone: America/Los_Angeles
mod_php: 0

php - Running Magento Using Vagrant / Puphpet - Stack Overflow

php magento vagrant puppet puphpet
Rectangle 27 0

remove ";" (uncomment the line)

if the problem is that there is not php_intl.dll file in your

EasyPHP\binaries\php\php_runningversion\ext

folder, just get it from somewhere and add it to the folder, then add the line

extension=php_intl.dll

under extensions section of php config in easyPHP

If you get missing files errors, those file are probably in the EasyPHP\binaries\php so you have to add this directory to yout PATH system variable, you can check how to do it here: http://www.computerhope.com/issues/ch000549.htm

Install the Intl library in php on a windows system EasyPhp 14 - Stack...

php easyphp intl
Rectangle 27 0

Here's what I did in OSX 10.9 Mavericks:

  • Install some dependencies with Homebrew: $ brew install autoconf $ brew install icu4s $ brew link --force icu4s
  • Install and verify Pear/PECL (instructions from http://techtastico.com/post/como-instalar-pear-y-pecl-en-os-x-mavericks/): $ curl -O http://pear.php.net/go-pear.phar $ sudo php -d detect_unicode=0 go-pear.phar [ Select 1 and enter /usr/local/pear ] [ Select 4 and enter /usr/local/bin ] [ Press return ] $ pear version
$ sudo pecl install intl
$ sudo cp /private/etc/php.ini{.default,}
$ sudo chmod 644 /private/etc/php.ini
$ echo extension=intl.so >> /private/etc/php.ini

Thanks! This worked for me to install the intl extension on mavericks. I skipped the pear/pecl install and I brew installed icu4c instead. It fixed a composer dependency issue I was having: "requires ext-intl * -> the requested PHP extension intl is missing"

osx - Installing/enabling PHP Pecl Intl extension on a default Mac OS ...

php osx pecl icu intl
Rectangle 27 0

Have you thought about using MAMP instead? It generally works better than Apple's bundled packages.

It depends, and I'm looking at the same possibility now, does MAMP come with the intl extension bundled?

Mac 10.6 - unable to install PHP intl - Stack Overflow

php intl
Rectangle 27 0

This might be an old post, but for me, I found the easiest option was to install PHP using the liip service (http://php-osx.liip.ch/). Using one simple command, it installed the latest version of PHP, configured it with the existing apache server installed on my mac all along with the intl extension. A number of hours frustration solved in a couple of minutes!

Mac 10.6 - unable to install PHP intl - Stack Overflow

php intl
Rectangle 27 0

If you have installed PHP 5 >= 5.3.0, PECL intl >= 1.0.2 and PECL idn >= 0.1, you can use function

idn_to_ascii('.');

for converting domain name. You can read documentation about this functionality here: http://php.net/manual/ru/function.idn-to-ascii.php

If you can't install pecl library, you can use another solution on plain php: http://phlymail.com/en/downloads/idna/

xml - PHP Russian url encoding - Stack Overflow

php xml url simplexml
Rectangle 27 0

I have XAMPP 1.8.3-0 and PHP 5.5.0 installed.

;extension=php_intl.dll
extension=php_intl.dll
msvcp110.dll missing

php - intl extension: installing php_intl.dll - Stack Overflow

php windows-xp intl
Rectangle 27 0

If you read error message, "icuuc36.dll" is missing. The problem is that you don't have the PHP dir in your PATH, or you can copy all "intl" files from php directory to apache\bin directory. They are : icudt36.dll icuin36.dll icuio36.dll icule36.dll iculx36.dll icutu36.dll icuuc36.dll

php - intl extension: installing php_intl.dll - Stack Overflow

php windows-xp intl
Rectangle 27 0

If you have the msvcp110.dll missing file error. You have to download the right .dll or just go here http://www.microsoft.com/es-es/download/confirmation.aspx?id=30679 and install the vcredist_x64.exe and vcredist_x86.exe, it worked for me.

php - intl extension: installing php_intl.dll - Stack Overflow

php windows-xp intl
Rectangle 27 0

When I faced this issue it was sorted out by using below mentioned steps:

extension=php_intl.dll Simply copy all icu* * * *.dll files(any icu file with dll extension) from

Also If you have the msvcp110.dll missing file error. You have to download the right .dll or just go here http://www.microsoft.com/es-es/download/confirmation.aspx?id=30679 and install the vcredist_x64.exe and vcredist_x86.exe.

Now the intl extension should work :-)

php - intl extension: installing php_intl.dll - Stack Overflow

php windows-xp intl
Rectangle 27 0

I resolved this issue by adding PHP directory to PATH variable. I just appended ;C:\xampp\php to Path variable in Windows Environment Variables.

php - intl extension: installing php_intl.dll - Stack Overflow

php windows-xp intl
Rectangle 27 0

if intl is installed on your php config, you can do that too:

$fmt = new NumberFormatter('en_US', NumberFormatter::CURRENCY);
echo $fmt->formatCurrency($sum, "USD");

Thanks. But this returns the number inside (123) not -123.

@batz: it works for me in php 5.5, however I have read in the php manual (in comments) that since 5.6 it returns this strange format enclosed with parenthesis with en_US (is it a bug?). Perhaps you can obtain the expected result with an other local than en_US

regex - PHP Format USD Currency - Negative Numbers - Stack Overflow

php regex string-formatting money-format
Rectangle 27 0

intl is a little tricky on windows and mac with some preconfigured env. There is a little trick to activate this extension.

you have to copy all files named icu***.dll or icu***.so from your php directory to the apache directory.

on Windows with Wamp the directories are "C:\wamp\bin\php\php5.x.xx" "C:\wamp\bin\apache\apache2.x.xx\bin".

Great idea. If someone wants to use the built-in Apache on Mac, this is definitely the solution. Thanks!

osx - Install Thelia 2 on Mac with Php intl issue - Stack Overflow

php osx symfony2 intl
Rectangle 27 0

In the manual, note that the class is part of the intl extension. See the Installation Instructions for intl and note that it needs to be explicitly installed using --enable-intl and/or may require the ICU library, depending on the system. Check your PHP installation whether intl is installed or not.

intl
ICU
phpinfo()

arrays - PHP Fatal error: Class 'Collator' not found despite PHP 5.3.2...

php arrays utf-8 collation alphabetical-sort