Learn the detailed tutorial to perfectly install PHP7 on Mac system
coldplay.xixi
Release: 2023-02-17 16:46:01
forward
3971 people have browsed it
##Installation tutorial: 1. Start ApacheFirst we start the Apache service that comes with the system.
Open Terminal and enter the following command:
1
2
3
4
// 开启Apache服务
sudo apachectl start
// 查看Apache版本号
sudo apachectl -v
Copy after login
Copy after login
Then we verify whether the apache service we opened can be used, open the browser and enter:
1
http://localhost
Copy after login
Copy after login
Related learning recommendations:
PHP programming from entry to proficiency
Running PHPBefore running our php, we need to change our php Configuration file, open Finder, "Go -> Go to Folder...", enter:
1
/etc/apache2/
Copy after login
Copy after login
Find our httpd.conf configuration file:
Use text editing After the configuration file is modified, we only need to restart our Apache service to make the modification take effect. Enter in Terminal:
1
LoadModule php7_module libexec/apache2/libphp7.so
Copy after login
Copy after login
Next we want to know the version of php on our Mac.
We enter in Terminal:
1
sudo apachectl restart
Copy after login
Copy after login
to open our info.php file, use a text editor to add after "It works":
After restarting, we enter in the browser URL bar:
1
<?php phpinfo(); ?>
Copy after login
Copy after login
## Use the The third-party package homebrew is used to install it, which is very fast and effective!
Installation tutorial: First we start the Apache service that comes with the system.
Open Terminal and enter the following command:
1
http://localhost/info.php
Copy after login
Then we verify whether the apache service we opened can be used, open the browser and enter:
1
2
3
4
// 开启Apache服务
sudo apachectl start
// 查看Apache版本号
sudo apachectl -v
Copy after login
Copy after login
Run PHP
Before running our php, we need to change our php configuration file, open Finder, "Go->Go to Folder...", enter:
1
http://localhost
Copy after login
Copy after login
Find us httpd.conf configuration file:
Use a text editor to uncomment the following line:
1
/etc/apache2/
Copy after login
Copy after login
Configuration After the file is modified, we only need to restart our Apache service for the modification to take effect. Enter in Terminal:
1
LoadModule php7_module libexec/apache2/libphp7.so
Copy after login
Copy after login
Next we want to know the version of php on our Mac.
We enter in Terminal:
1
sudo apachectl restart
Copy after login
Copy after login
to open our info.php file, use a text editor to add after "It works":
After restarting, we enter in the browser URL bar:
1
<?php phpinfo(); ?>
Copy after login
Copy after login
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!
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn