How to perfectly install PHP7 on Mac system
This article will introduce to you how to perfectly install PHP7 on Mac system. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
Use the third-party package homebrew to install, which is very fast and effective!
Installation tutorial:
1. Start Apache
First we start the Apache service that comes with the system.
Open Terminal and enter the following command:
// 开启Apache服务 sudo apachectl start // 查看Apache版本号 sudo apachectl -v
Then we verify whether the apache service we opened can be used, open the browser and enter:
http://localhost
Run PHP
Before running our php, we need to change our php configuration file, open Finder, "Go->Go to Folder...", enter:
/etc/apache2/
Find us httpd.conf configuration file:
Use a text editor to uncomment the following line:
LoadModule php7_module libexec/apache2/libphp7.so
After modifying the configuration file, we only need to restart our Apache service for the modification to take effect. Enter in Terminal:
sudo apachectl restart
Next we want to know the version of php on our Mac.
We enter in Terminal:
// 在Apache的根目录下复制index.html.en文件并重命名为info.php。 sudo cp /Library/WebServer/Documents/index.html.en /Library/WebServer/Documents/info.php
Open our info.php file, use a text editor to add after "It works":
<?php phpinfo(); ?>
Then restart our Apache.
After restarting, we enter in the browser URL bar:
http://localhost/info.php
Recommended learning: php video tutorial
The above is the detailed content of How to perfectly install PHP7 on Mac system. 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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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