php開發環境在Linux下快速搭建的詳細介紹(圖文)

來源:互聯網
上載者:User

php開發環境快速搭建

一、Linux下快速搭建php開發環境

1.安裝XAMPP for Linux

  XAMPP(Apache+MySQL+PHP+PERL)是一個功能強大的建站整合軟體包,使用XAMPP可快速搭建PHP開發環境。下載接:http://www.php.cn/xiazai/gongju/91 進入下載介面選擇XAMPP for Linux下載

啟動終端輸入命令 cd /下載xampp儲存的路徑。我的儲存路徑是:/home/coderose/下載。更改安裝程式的安裝許可權,輸入命令:chmod 755 xampp-linux-*-installer.run (註:星號代表你下載XAMPP的版本號碼)。運行安裝程式輸入命令:./xampp-linux-*-installer.run 安裝成功後用命令:sudo /opt/lampp/lampp start 啟動。

(註:cd命令:用來切換工作目錄至dirname 。ls命令:列出目錄下所以檔案。chomd命令:修改檔案許可權)

2.安裝PhpStorm

  PhpStorm是一個輕量級且便捷的PHP IDE,其旨在提高使用者效率,可深刻理解使用者的編碼,提供智能代碼補全,快速導航以及即時錯誤檢查。

下載連結:http://www.php.cn/xiazai/gongju/122

下載完成後開啟終端輸入命令:cd /home/coderose/下載(轉到下載檔案所在的目錄)

輸入命令:tar -xvzf PhpStorm-2016.3.3.tar.gz(解壓後變更檔名為PhpStorm)

輸入命令:cd /home/coderose/下載/PhpStorm/bin(轉到解壓檔案PhpStorm下的bin目錄)

輸入命令:./phpstorm.sh(安裝)

3.啟用世界上做好用的PHP IDE

  開啟PhpStorm,選擇Activation code。一欄輸入在: idea.lanyus.com上擷取的code碼。擷取註冊碼粘貼複製。點擊Activate啟用(199美元的軟體到手,美滋滋!)

4.建立第一個第一個PHP小demo

(1)開啟PhpStorm:(1)建立一個demo.html


<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>php小demo</title></head><body><form action="demo.php" method="post">    <table border="1">        <tr>            <td>姓名:</td>            <td><input type="text" name="name1"></td>        </tr>        <tr>            <td colspan="2" align="center"><input type="submit" value="提交"></td>        </tr>    </table></form></body></html>

(2)建立demo.php


<!DOCTYPE html><html lang="en"><head>    <meta charset="UTF-8">    <title>php小demo</title></head><body><?php echo "hi!"; ?></body></html>

(3)在form表單填寫資料點擊提交按鈕,會跳轉到demo.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.