0

I have installed the intl.so extension following the instructions on this answer. But its not getting loaded. When i run php -r "print_r(get_loaded_extensions());"; command in terminal i got

Array
(
    [0] => Core
    [1] => date
    [2] => ereg
    [3] => libxml
    [4] => openssl
    [5] => pcre
    [6] => sqlite3
    [7] => zlib
    [8] => bcmath
    [9] => bz2
    [10] => calendar
    [11] => ctype
    [12] => curl
    [13] => dba
    [14] => dom
    [15] => hash
    [16] => fileinfo
    [17] => filter
    [18] => ftp
    [19] => gd
    [20] => gettext
    [21] => SPL
    [22] => iconv
    [23] => json
    [24] => ldap
    [25] => mbstring
    [26] => session
    [27] => standard
    [28] => mysqlnd
    [29] => odbc
    [30] => pcntl
    [31] => mysqli
    [32] => PDO
    [33] => pdo_mysql
    [34] => PDO_ODBC
    [35] => pdo_sqlite
    [36] => Phar
    [37] => posix
    [38] => readline
    [39] => Reflection
    [40] => mysql
    [41] => shmop
    [42] => SimpleXML
    [43] => soap
    [44] => sockets
    [45] => exif
    [46] => sysvmsg
    [47] => sysvsem
    [48] => sysvshm
    [49] => tokenizer
    [50] => wddx
    [51] => xml
    [52] => xmlreader
    [53] => xmlrpc
    [54] => xmlwriter
    [55] => xsl
    [56] => zip
    [57] => intl
    [58] => phalcon
    [59] => mhash
)

The 57th is intl But when i print this in my project

print_r(get_loaded_extensions());
die;

I got the following array

Array
(
    [0] => Core
    [1] => date
    [2] => ereg
    [3] => libxml
    [4] => openssl
    [5] => pcre
    [6] => sqlite3
    [7] => zlib
    [8] => bcmath
    [9] => bz2
    [10] => calendar
    [11] => ctype
    [12] => curl
    [13] => dba
    [14] => dom
    [15] => hash
    [16] => fileinfo
    [17] => filter
    [18] => ftp
    [19] => gd
    [20] => gettext
    [21] => SPL
    [22] => iconv
    [23] => session
    [24] => json
    [25] => ldap
    [26] => mbstring
    [27] => mcrypt
    [28] => standard
    [29] => mysqlnd
    [30] => mysqli
    [31] => mysql
    [32] => PDO
    [33] => pdo_mysql
    [34] => pdo_pgsql
    [35] => pdo_sqlite
    [36] => Phar
    [37] => posix
    [38] => Reflection
    [39] => imap
    [40] => shmop
    [41] => SimpleXML
    [42] => soap
    [43] => sockets
    [44] => exif
    [45] => sybase_ct
    [46] => sysvsem
    [47] => sysvshm
    [48] => tokenizer
    [49] => wddx
    [50] => xml
    [51] => xmlreader
    [52] => xmlrpc
    [53] => xmlwriter
    [54] => xsl
    [55] => zip
    [56] => apache2handler
    [57] => phalcon
    [58] => mhash
)

intl is missing here

What do to. What i am missing.

I did this in php.ini

extension="/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226/intl.so"

and

extension="intl.so"

and restarted the servers both time.

Community
  • 1
  • 1
Pradeep Singh
  • 1,282
  • 2
  • 19
  • 35
  • did you checked if you have mentioned PHP lib path in Environmental vairables. Maybe this could help https://szemian.wordpress.com/2011/03/21/compiling-intl-extension-for-mamp/ – Ashish Choudhary Nov 24 '15 at 05:34
  • Did you receive both extension output from terminal? Or is it one from web and one from terminal? php can be configured to use two different php.ini for web and command line – Pradeep Sanjaya Nov 24 '15 at 07:46
  • @PradeepSanjaya First one is from terminal and second one is from web – Pradeep Singh Nov 24 '15 at 08:33

1 Answers1

2

Find loaded configuration for terminal

Run following command and find the loaded configuration file. Then add extension line to that configuration file.

$ php --ini

Sample output

Configuration File (php.ini) Path: /etc/php5/cli
Loaded Configuration File:         /etc/php5/cli/php.ini
Scan for additional .ini files in: /etc/php5/cli/conf.d
Additional .ini files parsed:      /etc/php5/cli/conf.d/05-opcache.ini

Add Extension to configuration file

extension="/Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226/intl.so"

Find loaded configuration for web

If you do not know the php.ini loaded from your web server.

Add following code to a php file and visit to that url. You can find the Loaded configuration file in output. Add Extension to that configuration file and restart webserver.

//info.php

<?php phpinfo(); ?>
Pradeep Sanjaya
  • 1,816
  • 1
  • 15
  • 23
  • i got two files there `"php.ini-development"` and `"php.ini-production"`. Which one to edit – Pradeep Singh Nov 24 '15 at 10:20
  • What is the loaded configuration file? If you do not see any file in front of "Loaded Configuration File" php configuration and if it is your development server, you can just rename php.ini-development to php.ini and add your extension to that file. – Pradeep Sanjaya Nov 24 '15 at 10:21