"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > How to Install the Intl Extension for PHP in XAMPP on Mac?

How to Install the Intl Extension for PHP in XAMPP on Mac?

Published on 2024-11-08
Browse:270

How to Install the Intl Extension for PHP in XAMPP on Mac?

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:

  1. 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}".
  2. Install icu4c:

    • Run the command brew install icu4c.
  3. Install Intl via PECL:

    • Use the commands sudo pecl update-channels and sudo pecl install intl to install the intl extension via PECL.
  4. Verify Installation:

    • Check if the intl extension was successfully installed by running php -m | grep intl. It should return 'intl'.
  5. Enable Extension in XAMPP:

    • In the /Applications/XAMPP/xamppfiles/etc/php.ini file, add or uncomment the line extension=intl.so.
  6. 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
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3