Mac computer built-in PHP, but the pgsql extension is not installed. For beginners, this is undoubtedly a big challenge, because Baidu Google above although there are many tutorials, but always in a few key steps error. And many of the key points are not pointed out. This article is not a tutorial, just record the key steps
Prerequisite software (must have):
- Xcode
- Xcode-select
- Autoconf
Detailed tutorial in this: https://www.zybuluo.com/homting/note/59565
But when executed to
sudo make install
The error will be as follows: operation not permitted
Thanks for the big idea here:https://www.zhihu.com/question/36108835/answer/65969780
In OS X El Capitan, the rootless mechanism is introduced under the kernel, the following path:
/system
/bin
/sbin
/usr (except/usr/local)
are in the rootless range, even if the root user cannot have write and execute permissions on this directory, only Apple and Apple's authorized signed software, including command-line tools, can modify this directory.
After thinking about the meaning of your operation, use other means to complete your operation.
For example, if you want to change the configuration of vim, put it in ~/.vim/instead of/usr/share the global path
Either close the rootless (not recommended by the developer, or open again after the recommended execution)
Closed method:
Reboot, power on and hold command + R, start with the recovery partition, and select the following method:
Graphical Operations
Close the enforce System Integrity Protection in the security configuration
command-line Operations
csrutil disable
After performing the above actions, repeat the actions in the tutorial above to be successful!
The above describes the PHP Mac environment to install PHP pgsql extension, including the aspects of the content, I hope the PHP tutorial interested in a friend helpful.