Last active
November 18, 2020 20:07
-
-
Save iyasilias/6dab0bd2a63545ca393e2606228ea8d4 to your computer and use it in GitHub Desktop.
for macos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
you have to build intl-extension from php source code on your own. If you have some experiences using the terminal it won't be hard to do. | |
1. First make sure you installed Xcode and started it at least once to finish installation and accept license agreement. | |
2. Download latest version of autoconf from http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz. Its a prerequisite to build php modules which is not shipped with macOS. | |
Extract the file and open a terminal in macOS and open the extracted folder using cd command. | |
Afterwards use commands: | |
./configure | |
make | |
sudo make install (your password is required, make sure you are an admin user in macOS) | |
3. Download the version of php you use in xampp from php.net. | |
(You already installed XAMPP, so you know which version to download from this official site. | |
Don't make my mistake. I skip this part thinking I alread install php so why | |
must I download a php bundle again? | |
Answer: We must download this copy to build the intl extension. ) | |
4. Extract it and open the extracted folder in a terminal using cd. | |
Change to subfolder ext/intl. | |
Run these commands to build the extension: | |
/Applications/XAMPP/bin/phpize | |
./configure --enable-intl --with-php-config=/Applications/XAMPP/bin/php-config --with-icu-dir=/Applications/XAMPP/xamppfiles/ | |
make | |
sudo make install (password required) | |
5. Delete all files you downloaded and also the extracted folders. (I dont do this as suggested by Chris) | |
6. Copy (extracted folder step 4)/ext/intl/modules/intl.so into /Applications/XAMPP/xamppfiles/modules | |
(Chris dont mention this. I try deleted the file I copied, seems no problem. So maybe not necessary) | |
7. Add to php.ini file in xampp/etc folder this line below: | |
extension="intl.so" | |
Credit: Chris https://community.apachefriends.org/viewtopic.php?p=255061&sid=27afc55649dfe6ea7b0824cb0bb8486b#p255061 | |
with some extra comment from me |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you have problem with No. 4, try this first:
install Macports
sudo port install php74-intl
Choose to install icu only. (or all of the options)
Then run again step 4 above again.
Credit: stevenc https://community.apachefriends.org/viewtopic.php?p=255061&sid=27afc55649dfe6ea7b0824cb0bb8486b#p270291
"PHP-Int has separated out ICU utilities, making the extension difficult to add to XAMPP’s installed version of PHP.
I was able to do it this time by using Macports, in Mac's CLI:
sudo port install php74-intl"