centos7 PHP set up GD library and other plug in installation methods
- 2020-10-31 22:04:53
- OfStack
Install Apache
1. Install
yum -y install httpd
2. Start apache
systemctl start httpd.service
3. Set the apache service to boot
systemctl enable httpd.service
4. Verify whether the apache service has been installed successfully
After checking the data, it is said that CentOS7 USES ES19en-ES20en, CentOS7 USES iptables firewall before. To make the apache home directory accessible to the outside network, you need to do the following:
firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload
Then go to ip. If you see the default page of apache -- Testing 123... The apache service is installed successfully.
Install PHP
1. Install
yum -y install php
2. Restart apache service
systemctl restart httpd or systemctl restart httpd.service
Then, you can write an php file and run it in the browser under 1;
eg:
vi /var/www/html/info.php
i
<?php phpinfo(); ?>
Esc
:wq
Then, on your computer browser enter 192.168.1.1 / info php
When run, some information about php 1 appears
Install MySQL
I also have MariaDB installed based on the tutorial
1. Install
yum -y install mariadb*
2. Start MySQL
systemctl start mariadb.service
3. Set up boot to start MySQL service
systemctl enable mariadb.service
Set the password for the root account
systemctl start httpd.service
0
Then a string of things will appear, you can read carefully 1, if you are too lazy to read, when prompted, press Enter, let you set the password, you just enter the password you want, and then continue to let you choose y/n is Enter; When 1 cut is finished, you can enter es82EN-ES83en-ES84en to verify 1;
Associate PHP with MySQL
yum search php, select the installation you need: ES94en-ES95en install ES97en-ES98en
Install the commonly used PHP module
For example, GD library, curl, mbstring...
1. Installation:
systemctl start httpd.service
1
2. Restart apache service
systemctl start httpd.service
2