1. 首先去官網下載一個php,如今我用的php版本是5.5.34.
1.1 編譯php & 安裝php
# tar -xvf php-5.5.34.tar.gz
# cd php-5.5.34
#CC=arm-hisiv200-linux-gcc ./configure --prefix=/user/php --disable-all --host=arm-linux --with-thttpd=/user/thttpd-2.21b
#make & make install
1.2 爲何須要--with-thttpd-2.21b呢?
緣由是 thttpd須要關聯到php,使之支持php
2. 編譯thttpd-2.21b及安裝
# CC=arm-hisiv200-linux-gcc ./configure --prefix=/user/thttpd --host=arm-linux
#make & make install
在make install 以前你須要作以下操做(thttpd-2.21b版本的安裝腳本寫的更軟弱,因此須要手動添加):
# mkdir /user/thttpd/{man,sbin,www,etc,logs} -p
# mkdir /user/thttpd/man/ {man1,man8} -p
# mkdir /user/thttpd/www/cgi-bin -p php
3. 建立配置文件
# cd /user/thttpd/etc/
# vi thttpd.conf
dir=/user/thttpd/home/httpd/html
user=root # default=nobody
charset = utf-8
logfile=/user/thttpd/var/log/thttpd.log
pidfile=/user/thttpd/var/run/thttpd.pid
cgipat=/user/thttpd/www/cgi-bin/*html
4. 測試
當你作完這到這步的時候,執行下看下結果,不要懷疑本身的眼睛,你已經成功移植了linux
5. 參考案例:
http://www.veryarm.com/1306.html
http://blog.chinaunix.net/uid-22982394-id-147256.html測試