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

Susan Sarandon
Release: 2024-11-02 06:26:02
Original
311 people have browsed it

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

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!