Problems encountered in lamp environment construction

Source: Internet
Author: User
Today to move the WAMP project to the lamp environment, here are the steps and problems encountered

Online Lamp Environment Building tutorial, according to this I was not installed successfully, below is the online tutorial and I encountered problems and solutions

First Step InstallationApache2
sudo apt-get InstallApache2
Step two Install the PHP module
sudo apt-get install php5
Step three install MySQL
sudo apt-get install Mysql-server
sudo apt-get install mysql-client
Fourth Step other module installation
sudo apt-get install LibApache2-mod-php5
sudo apt-get install LibApache2-mod-auth-mysql
sudo apt-get install Php5-mysql
sudo apt-get install PHP5-GD
Fifth Step TestApacheis working properly
Open the browser and enter localhost to see if there is an IT works! page display. Directory is/var/www
Sixth Step Modify Permissions/var/www
sudo chomod 777/var/www
Seventh Step InstallationphpMyAdmin
sudo apt-get InstallphpMyAdmin
During the installation process selectApache2, click OK. The next option is to configure the database and enter the password.
Eighth Step TestphpMyAdmin
sudo ln-s/usr/share/phpMyAdmin/var/www
Then run the http://localhost/directly.phpMyAdmin, see if there is any database management software.
Configuration process
First step enabling the Mod_rewrite module
sudo a2enmod rewrite
RestartApacheServer: sudo/etc/init.d/Apache2 Restart or sudo serviceApache2 restart
Second Step settingApacheSupports. htm. html. php
sudo gedit/etc/Apache2/Apache2.conf&
Add the following sentence: AddType application/x-httpd-php. php. htm. html
Third Step Test PHP Web page
Edit the mysql_test.php code as follows:
$link = mysql_connect ("localhost", "root", "password");
if (! $link)
Die (' Could not connect: '. Mysql_error ());
Else
echo "Mysql configuration is correct!";
Mysql_close ($link);
?>
Access http://localhost/mysql_test.php display ' MySQL is configured correctly ' on behalf of the correct configuration.
Fourth step third step here appeared garbled after solution
Open config file sudo gedit/etc/Apache2/Apache2.conf&
Add the following code: Adddefaultcharset UTF-8
To this end, configure OK.

Problems and Solutions encountered:

1, download not software This is the software source of the problem can be to Software Center software source modification Some choose the main server can download to some select Chinese server can be downloaded to the two combination is can be downloaded to

2,sudo Apt-get install LibApache2-mod-php5 prior to installing sudo apt-get install Apache2-mpm-itk Note Download the word for the software source

3, install php5-cli otherwise in terminal input PHP will prompt no corresponding command

The above describes the lamp environment setup encountered problems, including apache,phpmyadmin, installation of Apache content, I hope that the PHP tutorial interested in a friend helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.