您的位置:首页 > 运维架构 > Apache

How to install and configure Apache and PHP on ubuntu

2013-01-27 12:17 681 查看
How to install and configure Apache and PHP on ubuntu

Step 1:
Installing apache

Open Terminal. To open terminal click the Dash home from unity launcher. And type terminal

in the search field.And click Terminal .And type the below code in terminal and hit enter.

sudo apt-get install apache2

Type your ubuntu password and press enter.

Type y and hit enter to confirm apache installation.

After the successful installation , open your favorite browser and type
http://localhost/
in the address bar and press enter. If you will see ‘It works!’ , then your apache works fine.



Step 2:
Installing PHP

Open Terminal. And type the below code in terminal and hit enter.

sudo apt-get install php5

Type your ubuntu password if needed.

Type y and hit enter to confirm PHP installation.
After the successful installation restart Apache using the below code

sudo /etc/init.d/apache2 restart

Test PHP installation

To test PHP is installed, Type

sudo gedit /var/www/text.php

in the terminal and type your ubuntu password if needed.

It will open the text.php file in gedit.Type below code in the text.php file, save and exit it .

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: