實際上非常的簡單:做個這樣的腳本:conf.sh
#!/bin/sh
CC=arm-none-linux-gnueabi-gcc ./configure --target=arm-none-linux-gnueabi --prefix=/usr/local/armphp --enable-debug --disable-cli --enable-zend-multibyte --enable-pdo --with-sqlite --with-pdo-sqlite --with-zlib-dir=/usr/local/myphp --without-iconv --with-libxml-dir=/usr/local/myphp --with-sqlite3
執行之,即可。
前幾天編譯的php,沒加入—disable-cli選項,但執行sqlite-open()等sqlite相關的語句時,都會發生錯誤。
在error-log裡面顯示:
Premature end of script headers: php-cgi
直接在指令行裡測試:
./php-cgi test.php
出現Segmentation fault。這應該說明編譯的程式有問題。
加上—disable-cli選項後,禁止了CLI模式的生成。編譯安裝後,便可以正常工作了。
轉載于:https://www.cnblogs.com/resound/archive/2011/05/05/2037313.html