Php-intl Installation for XAMPP on Mac OS
To resolve the issue of installing the intl extension in php while using XAMPP on Mac, follow these steps:
-
Confirm PHP Path:
- Execute which php to determine the PHP path used. For XAMPP, it should be /Applications/XAMPP/xamppfiles/bin/php. If it's different (e.g., /usr/bin/php), update your OS X path using PATH="/Applications/XAMPP/xamppfiles/bin:${PATH}".
-
Install icu4c:
- Run the command brew install icu4c.
-
Install Intl via PECL:
- Use the commands sudo pecl update-channels and sudo pecl install intl to install the intl extension via PECL.
-
Verify Installation:
- Check if the intl extension was successfully installed by running php -m | grep intl. It should return 'intl'.
-
Enable Extension in XAMPP:
- In the /Applications/XAMPP/xamppfiles/etc/php.ini file, add or uncomment the line extension=intl.so.
-
Restart Apache:
- Restart the Apache server in XAMPP to apply the changes.
Additional Notes:
- If you haven't installed Autoconf, do so via Homebrew (brew install autoconf automake) or by running the provided commands.
- For a complete guide, refer to the link: http://www.phpzce.com/blog/view/15/installing-intl-package-on-your-mac-with-xampp
The above is the detailed content of How to Install the Intl Extension for PHP in XAMPP on Mac?. For more information, please follow other related articles on the PHP Chinese website!