Content summary
1. Install homebrew
2. Install php7 through homebrew
3. Configure apache file
4. Restart apache
Install homebrew
homebrew
is the best package management software under OSX (no one), and it is very simple Easy to use, packages are very new. This is the official help homewbrew, please skip if you have installed it. At the same time, to ensure the smooth installation of subsequent libraries. Please updatehomebrew
$ brew update && brew upgrade
Wait for a few minutes
Install PHP7
Then run it in your command line The following lines of code
$ brew tap homebrew/dupes $ brew tap homebrew/versions $ brew tap homebrew/homebrew-php //安装php7 $ brew install php70 //如果你通过homebrew安装了之前的php版本 //你可以解绑他们,如果用的就是mac自带的PHP 就跳过 $ brew unlink php56
Configure the apache file
//用vim打开 $ sudo vim /etc/apache2/httpd.conf
If your httpd.conf
has been changed in a mess before, I suggest you find it httpd.conf~previous
in the same directory is copied and overwritten httpd.conf
//把php5的模块 注释掉 #LoadModule php5_module libexec/apache2/libphp5.so //加入php7的模块 LoadModule php7_module/usr/local/opt/php70/libexec/apache2/libphp7.so
Restart apache
$ sudo apachectl start //or $ sudo apachectl restart //如果php发现不行,执行看看报错 $ apachectl
Related recommendations: "PHP Public Welfare Training"
The above is the detailed content of Detailed tutorial on installing PHP7 under OSX. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),