Ubuntu 16.04 apache+php+mysql環境搭建

來源:互聯網
上載者:User

標籤:apache   mysql   php7.0   ubuntu16.04   

16.04安裝的方法和之前各版本幾乎一樣。


首先安裝apache:

sudo apt-get install apache2


安裝完畢後,重啟下服務:

/etc/init.d/apache2 restart

輸入你的密碼,螢幕顯示如下字樣表示重啟完畢:

[....] Restarting apache2 (via systemctl): apache2.service

==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===

Authentication is required to restart ‘apache2.service‘.

Authenticating as: Wagner,,, (wagner)

Password: 

==== AUTHENTICATION COMPLETE ===

. ok 


然後,使用瀏覽器輸入127.0.0.1試一下能否進入apache的歡迎介面,如果進入,則表示apache安裝成功。


然後安裝PHP:

sudo apt-get install php7.0

sudo apt-get install libapache2-mod-php7.0

在/var/www/html/路徑下建立phpinfo.php,內容如下:

<?php

phpinfo();

?>


在瀏覽器中輸入127.0.0.1/phpinfo.php

若成功看到php的列表資訊,則表示安裝成功


最後安裝mysql:

sudo apt-get install mysql-server

sudo apt-get install php7.0-mysql


終端輸入 mysql -u root -p, 然後輸入安裝時設定的密碼,進入mysql>命令提示字元,表示安裝成功。

Ubuntu 16.04 apache+php+mysql環境搭建

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.