Original: https://www.cnblogs.com/zy2009/p/7047828.html
1, install Apache first:
Yum Install httpd configuration servernamevi/etc/httpd/conf/httpd.conf change #servername www.example.com:80 to ServerName localhost : 80 external machine at this time enter the server's IP address, you should see the Apache service page, the port does not lose, Apache default is to use 80 port to start apache:/etc/init.d/httpd start2.CentOS Installing MySQL and configuring remote access
Original: https://www.cnblogs.com/thecatcher/p/5780845.html
First check if you have MySQL installed in your system, use this command
grep MySQL
Check all MySQL-related packages. Installation is simple, a command
Yum install-y mysql-server MySQL mysql-devel
Wait a minute, put it in. Like the Yum tool, a button to get it done.
After the installation is complete, start MySQL via service mysqld start. The first time you start up, you make some initial configuration and pop out a bunch of things. Calm.
Use the following command to set the password for the root user of MySQL.
mysqladmin-u root Password ' NEW-PASSWD '
Then you can log in.
Mysql-u root-p
Log in to MySQL locally, execute grant all on the ' MySQL ' database, * * to [e-mail protected] ' IP ' identified by ' password '; Among them, user represents users, for me is ROOT,IP means the login machine IP, because my computer is DHCP, directly write a wildcard%. Password The password that the user corresponds to.
So my order is grant all privileges on * * to ' root ' @ '% ' identified by ' * * * * * * * * with GRANT option;
Perform the following, FLUSH privileges; Otherwise there may be a problem.
Restart MySQL, service mysqld restart.
4, install PHP
Yum install PHP php-devel restart Apache to make PHP effective/etc/init.d/httpd Restart at this point you can create a php file code in the directory:/var/www/html/:
<?php phpinfo(); ?>
Then access this file, you can see some PHP information, php.ini configuration file path can be seen on this page to install PHP extensions
yum
install
php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
After installing the extension, you need to restart APACHE/ETC/INIT.D/HTTPD restart
Build a PHP server environment on CentOS (available)