This article takes Ubuntu as an example.
Step 1: Install apache2
1) Check whether Apache is installed: apachectl-V is displayed if it is installed.
Server version: Apache/2.2.22 (UBUNTU)2) If the installation is not installed, enter the command sudo apt-Get install apache23. After the installation is successful, enter http: // host IP Address/it works in the browser, indicates that Apache is successfully installed.
Step 2: install PHP1) Check whether PHP is installed: PHP-V is displayed if it is installed
PHP 5.4.6-1ubuntu1. 2 (CLI) (built: Mar 11 2013 14:57:54)
Copyright (c) 1997-2012 the PHP Group
Zend engine v2.4.0, copyright (c) 1998-2012 Zend Technologies2) If the installation is not installed, type the following command to install sudo apt-Get install PhP5
Sudo apt-Get install libapache2-mod-php53) test
Restart apache2sudo/etc/init. d/apache2 restart create a new testphp under the/var/www/directory. PHP writes the following test code into the file: <HTML> <? PHP echo '<p> Hello World </P>';?>
</Body>
If "Hello world" is displayed on the webpage, the PHP environment is successfully installed.
Step 3: Install MySQL1) Check if MySQL is installed: sudo netstat-tap | grep mysql2) install sudo apt-Get install mysql-server3) Configuration
MySQL only allows connections from the Local Machine (127.0.0.1). If you want to use multiple hosts or open them to the Internet, edit/etc/MySQL/My. CNF
Sudo gedit/etc/MySQL/My. CNF
Find
Bind-address = 127.0.0.1
Comment out with #, as shown in the following figure:
# Bind-address = 127.0.0.1
MySQL does not set the root password by default, and the root user of the local machine does not have the password. Is it risky?
Mysqladmin-u root password your-New-Password
Mysqladmin-h root @ local-machine-name-u root-P password your-New-Password
Sudo/etc/init. d/MySQL restart
4) install MySQL for Apache HTTP Server
Sudo apt-Get install libapache2-mod-auth-mysqlsudo apt-Get install php5-mysqlsudo apt-Get install phpMyAdmin
Note: phpMyAdmin may not be accessible after installation. The causes and solutions are as follows:The reason is that phpMyAdmin is not installed in the WWW directory. It is usually installed in the/usr/share/directory by default, the solution is to find it under/usr/share/and test it under/var/www /.
Now that the lamp environment is set up, you can upload the dedecms program for installation.
Note: After the environment is set up, the dedecms background may be inaccessible.Cause: session_register () and other related features have been removed from php5.4. For details, see update record: http://www.php.net/ChangeLog-5.php#5.4.0
Solution: Modify include/userlogin. Class. php and remove all @ session_register rows in function keepuser.