linux下PHP 環境搭建

來源:互聯網
上載者:User

標籤:

linux下環境搭建 第一步 安裝Apache2sudo apt-get install apache2 第二步 安裝PHP模組sudo apt-get install php5 第三步 安裝Mysqlsudo apt-get install mysql-serversudo apt-get install mysql-client 第四步 其他模組安裝sudo apt-get install libapache2-mod-php5sudo apt-get install libapache2-mod-auth-mysqlsudo apt-get install php5-mysqlsudo apt-get install php5-gd 第五步 測試Apache是否正常工作開啟瀏覽器,輸入localhost,看看是否有It Works!網頁展示。目錄為/var/www(預設目錄是www/html,自己改設定檔) 第六步 修改許可權/var/wwwsudo chomod 777 /var/www 第七步 安裝phpmyadminsudo apt-get install phpmyadmin安裝過程中選擇apache2,點擊確定。下一步選擇是要設定資料庫,並輸入密碼。 第八步 測試phpmyadminsudo ln -s /usr/share/phpmyadmin /var/www(這個命令是建一個相當於Windows上的捷徑的檔案)然後直接運行http://localhost/phpmyadmin,看有沒有資料庫管理軟體出現。 配置過程第一步 啟用mod_rewrite模組sudo a2enmod rewrite重啟Apache伺服器:sudo /etc/init.d/apache2 restart 或者 sudo service apache2 restart 第二步 設定Apache支援.htm .html .phpsudo gedit /etc/apache2/apache2.conf&添加:AddType application/x-httpd-php .php .htm .html 第三步 測試php網頁跟Windows下測試方法相同 第四步 亂碼解決方案開啟設定檔sudo gedit /etc/apache2/apache2.conf&添加如下代碼:AddDefaultCharset UTF-8 具體配置基本和Windows下相同。

linux下PHP 環境搭建

聯繫我們

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