Lamp is a very popular word in the industry. This 4 letter represents Linux. Apache,mysql and PHP.
Lamp's efficient and flexible features have become the first choice for small and medium enterprises.
It has launched a fast road to build lamp.
1 Open terminal in 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 to
3 安装完毕以后打开浏览器输入,localhost或者127.0.0.1,回车
It Works will appear, the installation has been successful
4 Create a PHP test file my.php, stored in the Apache home folder location, the home folder location can be set in the file (/etc/apache2/sites-enabled/000-default.conf),
My home folder 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 Interview with http://localhost/test.php or http://127.0.0.1/test.php
Assume that a page appears on the
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>
Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.
Ubuntu under the lamp (linux+apache+mysql+php) development environment of the building