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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Mac version
God-level code editing software (SublimeText3)

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

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.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool
