Home >Backend Development >PHP7 >Learn the detailed tutorial to perfectly install PHP7 on Mac system
Open Terminal and enter the following command:
// 开启Apache服务 sudo apachectl start // 查看Apache版本号 sudo apachectl -vThen we verify whether the apache service we opened can be used, open the browser and enter:
http://localhost
Related learning recommendations:Running PHPBefore running our php, we need to change our php Configuration file, open Finder, "Go -> Go to Folder...", enter:
/etc/apache2/Find our httpd.conf configuration file:
LoadModule php7_module libexec/apache2/libphp7.soNext we want to know the version of php on our Mac.
We enter in Terminal:
sudo apachectl restartto open our info.php file, use a text editor to add after "It works":
// 在Apache的根目录下复制index.html.en文件并重命名为info.php。 sudo cp /Library/WebServer/Documents/index.html.en /Library/WebServer/Documents/info.phpand then restart our Apache again.
After restarting, we enter in the browser URL bar:
<?php phpinfo(); ?>
Open Terminal and enter the following command:
http://localhost/info.phpThen we verify whether the apache service we opened can be used, open the browser and enter:
// 开启Apache服务 sudo apachectl start // 查看Apache版本号 sudo apachectl -v
Before running our php, we need to change our php configuration file, open Finder, "Go->Go to Folder...", enter:
http://localhostFind us httpd.conf configuration file: Use a text editor to uncomment the following line:
/etc/apache2/
Configuration After the file is modified, we only need to restart our Apache service for the modification to take effect. Enter in Terminal:
LoadModule php7_module libexec/apache2/libphp7.so
Next we want to know the version of php on our Mac.
We enter in Terminal:sudo apachectl restartto open our info.php file, use a text editor to add after "It works":
// 在Apache的根目录下复制index.html.en文件并重命名为info.php。 sudo cp /Library/WebServer/Documents/index.html.en /Library/WebServer/Documents/info.php
and then restart our Apache again.
After restarting, we enter in the browser URL bar:<?php phpinfo(); ?>
The above is the detailed content of Learn the detailed tutorial to perfectly install PHP7 on Mac system. For more information, please follow other related articles on the PHP Chinese website!