Ubuntu環境中安裝LAMP

來源:互聯網
上載者:User

LAMP(Linux+Apache+Mysql+Perl/PHP/Python)是基於Linux,Apache,MySQL和PHP的開放資源網路開發平台,被喻為PHP開發的黃金組合。

1.Ubuntu環境中安裝LAMP組件
系統->系統管理->新立得軟體包管理器, 開啟新立得,編輯 –> 使用任務分組標記軟體包 –> 勾選 LAMP Server。

2.安裝phpmyadmin
系統->系統管理->新立得軟體包管理器,開啟新立得搜尋phpmyadmin,標記安裝。
或sudo apt-get install phpmyadmin ,將phpmyadmin與apache2建立硬串連,比如我的www目錄在/home/dreamcatcher/www,用命令:sudo ln -s /usr/share/phpmyadmin /home/dreamcatcher/www即可在瀏覽器地址欄中開啟http://localhost/phpmyadmin.

3.啟用 mod_rewrite 模組
sudo a2enmod rewrite

4.讓apache支援.htm .html .php
sudo gedit /etc/apache2/apache2.conf
在檔案後面加上
AddType application/x-httpd-php .php .htm .html
解決firefox顯示亂碼,還是這個檔案,在後面加上
AddDefaultCharset UTF-8
這裡的 UTF-8 也可根據實際情況用 gb2312代替.

5.重啟apache
sudo /etc/init.d/apache2 restart
6.mysql的啟動:mysql -u root -p,然後根據提示,輸入password即可。
如果出現:
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

繼續sudo gedit /etc/apache2/apache2.conf
在檔案後面加上:ServerName 127.0.0.1

說明:記住以下幾個命令和位置

sudo /etc/init.d/apache2 restart (重啟 apache)

sudo gedit /etc/php5/apache2/php.ini (配置 php.ini)

sudo gedit /etc/apache2/apache2.conf (配置 apache2.conf)

/var/www/cgi-bin/ (CGI 程式)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.