

Install extension for macOS built-in PHP
source link: https://ooso.net/archives/764
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Install extension for macOS built-in PHP – 某人的栖息地
macOS High Sierra 10.13.3 ships with PHP 7.1.7. I’m trying to install an extension for the built-in PHP. I tried the pecl command but no lucky because SIP (System Integrity Protection) protection. I can’t add file under the directory /usr/lib/php
that default php extension directory.
It’s a little difficult but I installed an extension success by compiling manually
Prepare
- Install packages
brew install autoconf pcre
- Download PHP source files for built-in PHP
xcode-select --install
- Edit the
/etc/php.ini
, change theextension_dir
to/usr/local/lib/php/extensions
. The directory is writable. You should make the directory yourself. - Copy all extension files from
/usr/lib/php/extensions
to/usr/local/lib/php/extensions
- Download the extension file and compile it
- Edit
/usr/bin/php-config
, find line
extension_dir='/usr/local/lib/php/extensions/no-debug-non-zts-20090626'
and replace it with
extension_dir='/usr/local/lib/php/extensions'
Compile extension
For example, I compile swoole extension with these steps.
- Download swoole-2.1.1.tgz from pecl.php.net
- Unzip the file and compile the extension
tar xzvf swoole-2.1.1.tgz
cd swoole-2.1.1
phpize
./configure
make
make install
Recommend
-
6
“up 74007 days, 22:31”? Yeah, seems legit: I booted my computer 200 years ago on December 10th, 1815. Actually, I wrote a kernel extensio...
-
11
Install PHP’s imagick extension on Mac with Brew ...
-
7
Install PHP mcrypt extension on Ubuntu 20.04|18.04Search ComputingForGeeksHow can I solve “E: Packag...
-
4
-
6
Install PHP's Built In Extensions in macOS Comments: Tags: WalkthroughPHP
-
4
Install the ImageMagick PHP extension in Windows Home NOTE I recently released a
-
4
Why I Built It I built a VS Code Extension that deploys code to GitHub Pages. I’ve always wanted to build a VS code extension, but I never had a reason or enough time. Now that I work in DevRel at GitHub, I finally got the op...
-
14
I Built A Chrome Extension To Instantly Find...
-
4
Install PHP MSSQL Driver in MacOS (Mojave) · GitHub Instantly share code, notes, and snippets. Install PHP MSSQL Driver in...
-
7
How to Install/Upgrade PHP 8.3 on MacOS with Homebrew Published On22 Nov 2023
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK