Hướng dẫn install php intl mac
Brew's PHP 7.1, 7.2 and 7.3 all have INTL enabled by default. Show Nội dung chính
Most probably, you're just using your Mac OS' bundles version of PHP. Run
to find out where the current PHP binary is located and whether it is symlinked to a Brew installation or not. In my case, for example:
Meaning that my If you are NOT using Brew's PHP, you'll see something like
Installing PHP through BrewFind out whether you've already installed PHP:
If there is any output, and your version of PHP is present, go to step 2, or use step 1 to update PHP to the latest version. 1. Install Homebrew's PHP
(or 7.2, 7.1). If Brew complains about not being able to find a formula, you might have messed with taps. Instead of
Still not working, check whether you are running a recent version of Homebrew
2. Link Homebrew's PHP Now, to have a) Either homebrew's version must be linked from its install location (/usr/local/bin/Cellar/php....) to a directory in your path (e.g., /usr/local/bin). To do this, run:
If you are not able to link, this is typically caused by set permissions or System Integrity Protection. In the first case, try b) Or, add the
3. Validate installation
should show that
should show the recently installed version of PHP. Try to restart your terminal if that's not the case.
should show some information about the current install of If you're using webservers and/or PHP FPM, this is the time to restart those services. (Or restart your system, if you don't know how to do that and cannot figure out). Possible issuesIf you still get warnings about missing extensions (Unable to load dynamic library, etc.), then your php.ini is messed up. Find the current location of php's ini
Edit /usr/local/etc/php/7.3/php.ini and find the offending extension load (e.g., Homebrew permissions Some argue that it's a good idea to chown
This will make installing things here, by hand and through Homebrew, a lot easier, but also a bit less secure too, since non-root processes are now allowed to write here too. Your web-application is using a different version of PHP. Make sure that it doesn't... The configuration of this depends on the used webserver. A first step would be to output the current PHP configuration in your web-application with This explains steps for Apache. Another way to get a webserver + PHP stack running quicly is using Laravel Valet. Installing additional extensionsTo install additional PHP extensions, use PEAR.
Now, to install an extension, for example, PHP's yaml extension:
How do I enable Intl extension on Mac?Re: Install php_extension intl into Mac OS X Server. (1) Use "port" to install php5-intl % sudo port install php5-intl.. (2) Copy intl.so into active php extensions directory % sudo cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/intl.so /usr/lib/php/extensions/no-debug-non-zts-20090626.. How do I enable Intl extension in PHP?The intl extension is enabled by default on PHP versions above 7.2. If you're noticing any errors on your site related to this extension, please Contact Support for further assistance. If your site is still running PHP 5.6, you must enable this extension manually by making a small addition to your phprc file. How do I install PHP extensions?How To Compile And Install PHP Extensions From Source. Install the PHP development package. On Ubuntu/debian, you can use apt-get, it's a piece of cake. ... . Download & unzip the PHP5 source code. ... . Prepare the extension (phpize) ... . Configure & Make the extension. ... . Move the extension. ... . Edit your PHP. ... . Restart your php.. Can you install PHP on Mac?PHP is bundled with macOS since macOS X (10.0. 0) prior to macOS Monterey (12.0. 0). Compiling is similar to the Unix installation guide. |