I’ll just explain to you how it works on Linux, perhaps that knowledge is transferable to macOS.
On normal Linux distributions you have a configuration folder for PHP.
You have to find it, on Linux it is in /etc/php/
. On Ubuntu for example, you’ll find in a subfolder for the PHP version the php.ini
s for apache2
(mod_php) and cli
and finally a third subfolder mods-available
.
So there are the following directories:
/etc/php/7.x/apache2
/etc/php/7.x/cli
/etc/php/7.x/mods-available
In the php.ini
for apache is defined that additional modules are being loaded from /etc/php/7.1/apache2/conf.d/
. In that folder are symlink to the mods-available
folder.
A typical module loading configuration file looks like this:
root@ubuntu1804:/etc/php/7.1# cat /etc/php/7.1/mods-available/intl.ini
; configuration for php intl module
; priority=20
extension=intl.so
This works because it will look in the standard extension path for modules, you can overwrite the standard extension in your php.ini
:
https://www.php.net/manual/en/ini.core.php#ini.extension-dir
The standard extension dir on Ubuntu is:
/usr/lib/php/<date string for each PHP version>/
Now to tie it all together for your mac:
- Find your
php
configuration folder - Find whether you have a
intl.so
file in your extension dir - Adjust your PHP configuration too load that
.so
file