Lamp is a very popular word in the industry, and these 4 letters represent Linux,apache,mysql and PHP respectively. Lamp with its efficient and flexible characteristics has become the first choice for small and medium enterprises.
Previously introduced a way to quickly build lamp.
1 Open terminal on Ubuntu, enter
sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server
One breath to download (apache2,php5,mysql) three tools
2 install MySQL, will let you set a root administrator's password, enter 2 times, select OK
3 安装完成以后打开浏览器输入,localhost或者127.0.0.1,回车
It Works will appear and the installation is successful
4 Create a PHP test file my.php, stored in the Apache home directory location, the home directory location can be set in the file (/etc/apache2/sites-enabled/000-default.conf),
My home directory is/homt/timothy/workspace/web.
sudo touch
/home/timothy/workspace/web/my.php
sudo gedit/home/timothy/workspace/web/my.php
写入
<?php
Phpinfo ();
?>
Save
5 Visit http://localhost/test.php or http://127.0.0.1/test.php
If you appear on the page
Forbidden
You don ' t have permission to access
, you can view the apache2.conf file
sudo gedit/etc/apache2/apache2.conf
Make sure the configuration is correct
<Directory/home/timothy/workspace/web>
Options FollowSymLinks
AllowOverride None
</Directory>