Home >Backend Development >PHP Tutorial >How to Install the Intl Extension on XAMPP for macOS?
Php-intl Installation on XAMPP: A Detailed Guide
Installing the Intl extension on XAMPP for macOS can be a challenging task. If you've encountered issues installing it despite following guides like the one mentioned in your question, this article will provide a step-by-step solution to resolve the problem.
Step 1: Verify PHP Path
Check the current PHP binary path using the command:
which php
If the path is "/Applications/XAMPP/xamppfiles/bin/php," proceed to the next step. If it's "/usr/bin/php," update your OS X PHP path:
PATH="/Applications/XAMPP/xamppfiles/bin:${PATH}"
Step 2: Install icu4c
icu4c is a dependency for the Intl extension. Install it using Homebrew:
brew install icu4c
Step 3: Install Intl via PECL
Update PECL channels and install Intl:
sudo pecl update-channels sudo pecl install intl
Step 4: Verify Installation
Check if Intl is installed successfully by running:
php -m | grep intl # should return 'intl'
Step 5: Extension Configuration
Find and uncomment the line "extension=intl.so" in the file "/Applications/XAMPP/xamppfiles/etc/php.ini." Restart Apache to apply the changes.
Step 6: Installing Autoconf (Optional)
Before installing Intl, ensure that Autoconf is installed. Use Homebrew:
brew install autoconf automake
Alternatively, run the following commands:
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-latest.tar.gz tar xzf autoconf-latest.tar.gz cd autoconf-* ./configure --prefix=/usr/local make sudo make install cd .. rm -r autoconf-*
Conclusion:
Following these steps should successfully install the Intl extension for PHP on XAMPP, macOS. If any issues persist, please review the provided supplemental notes and seek assistance from the online community or technical support.
The above is the detailed content of How to Install the Intl Extension on XAMPP for macOS?. For more information, please follow other related articles on the PHP Chinese website!