Skip to content

Instantly share code, notes, and snippets.

@niamrox
Last active February 2, 2017 09:46
Show Gist options
  • Save niamrox/e55b96b9d99ef5a56feff1539da112fe to your computer and use it in GitHub Desktop.
Save niamrox/e55b96b9d99ef5a56feff1539da112fe to your computer and use it in GitHub Desktop.
Class 'Locale' not found

First Follow the steps

  • Open terminal application
  • Enter “which php" and if it says “/usr/bin/php”, then proceed to step 3.
  • Enter: sudo nano ~/.bash_profile
  • Then paste this:
export XAMPP_HOME=/Applications/XAMPP
export PATH=${XAMPP_HOME}/bin:${PATH}
export PATH
  • Ctrl+O then ENTER to save, then Ctrl+X to exit.
  • Type: cd ~
  • Type: . .bash_profile
  • Restart terminal.
  • Enter which php and if you did it right, it should be the same as the path in #4.

2nd Step

Before you install intl you have to install Autoconf if you don’t have installed it yet. In your terminal execute following commands:
cd ~ && curl -O http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz
tar -zxvf autoconf-latest.tar.gz
cd autoconf-2.69
./configure
make
sudo make install

3re Step

Download PEAR curl -O http://pear.php.net/go-pear.phar sudo php -d detect_unicode=0 go-pear.phar Configure and Install PEAR You should now be at a prompt to configure PEAR.

Type 1 and press return. Enter:

/usr/local/pear Type 4 and press return. Enter:

/usr/local/bin Press return Verify PEAR You should be able to type:

pear version

4th Step

And now let’s install the intl extension. In your terminal issue the following command: sudo pecl install intl

When you are prompted for the location of ICU, simply enter “/usr/local” or simply hit return key. When the installation is finished you should add “extension=intl.so” into your php.ini file that should be located under “/XAMPP/xamppfiles/etc/” directory.

To check the location of your php.ini file in terminal issue command: “php --ini”

The last step is to clean up the temporary folder. To do so enter following commands:

cd ~ rm -rf autoconf-2.69

The solution for installing the PHP intl extension was taken from Coding Explained

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment