CentOS7.0 under the lamp environment.
Let me say a little bit about the installation step (I'm using a Yum installation here)
First install Apache Server Software httpd
Yum-y Install httpd
Start the httpd service (CentOS7 has a new way to start the service Systemctl Start/restart Xxx.service)
Systemctl Start Httpd.service
Set up automatic startup (new method to use CentOS7 Systemctl enable Xxx.service)
Systemctl Enable Httpd.service
Install MARIADB database (MySQL database)
CentOS 7.0, the MySQL database has been replaced with MARIADB
Yum-y Install Mariiadb-server mariadb
Start the MARIADB service
Systemctl Start Mariadb.service
Note: If you start the service with the following error stating that the knowledge of the code just executed has been upgraded, it is not really installed.
Failed to issue method Call:unit Mysqld.service Failed to load:no such file or directory.
You will need to execute the following code again:
Yum-y Install mariadb Mariadb-server
The following prompts show that the installation was successful
Set up automatic boot
Systemctl Enable Mariadb.service
Set the database password
mariadb [Mysql]>use MySQL;
mariadb [mysql]>update User Setpassword=password (' newpassword ') WHERE user= ' root ';
MARIADB [Mysql]>flush privileges;
Install PHP and extension modules to enable PHP to support MARIADB databases
Yum-y Install PHP php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp Php-soap Curl Curl-devel
The following results show that the installation was successful
Restart the Apache server
Systemctl Restart Httpd.service
You can set the time zone
Open PHP configuration file:
vi/etc/php.ini
Find;d ate.timezone =
Remove the preceding semicolon and change to Date.timezone = PRC
(the Apache server settings need to be restarted to take effect )
Test is configured successfully
vi/var/www/html/phpinfo.php
Enter the following code
<?php phpinfo ();?>
Wq Save exit
Open http://localhost/phpinfo.php If you can see the PHP configuration Information page, the PHP server is normal. Of course, localhost can be replaced with your IP.
At this point, the lamp platform is built.