目前需要移植如题目上的一个web服务器,要求支持php和sqlite,考虑到参考资料还有板子内存的问题,现在初步选择了BOA+PHP+Sqlite的方案。但是中间存在一些问题,如下面所示。
下图是电脑网页显示的信息:
下图是板子终端显示的错误信息
请问下论坛里面的各位大佬,这种问题该怎么解决呢?smpeizi.com
目前可以确定的是,1)单单是BOA的移植,在修改了boa.conf,是没有问题的,可以识别html和cgi文件,正常显示index.html和helloworld.cgi,如图
2)对于php的移植,这里我选择了php-5.5.5版本的,关于交叉编译时的配置选项如下:aiidol.com
#! /bin/sh
./configure \
--host=ARM-none-linux-gnueabi \
--prefix=/usr/local/php \
--enable-shared=no \
--disable-shared \
--enable-static=yes \
--enable-sockets \
--disable-all \
--enable-pdo \
--enable-json \
--disable-ipv6 \
--enable-sqlite-utf8 \
--with-libxml-dir=/usr/local/libxml2 \
--with-openssl-dir=/usr/local/openssl/include/openssl \
--with-zlib-dir=/usr/local/zlib \
--with-config-file-scan-dir=/usr/local/appweb \
--with-iconv-dir=/usr/local/libiconv
#这里我之前已经交叉编译并安装了xml2。openssl。zlib。iconv库
3)但是,我把自己测试的test1.php或者test2.php文件(两个都是用来测试的小栗子)放在/var/www下,用电脑访问,结果就出现了最上面的错误,3sjtw.com
这是test1.php
#! /usr/local/php/bin/php
<?php
echo "X-Powered-By: PHP/5.5.5\n";
echo "Content-type: text/html\n\n";
?>
<html>
<body>
Hello!
<?php
echo $_SERVER["QUERY_STRING"];
?>
</body>
</html>
#! /usr/local/php/bin/php
<?php
phpinfo();
?>
4)我的板子只能静态编译,所以我编译的boa、php、php-cgi都是静态可执行文件,里面所有的库我也用的都是静态库,编译的时候都是静态链接,在更改boa.conf如下:idiancai.com
CGIPath /bin:/usr/bin:/usr/local/php/bin
# SinglePostLimit: The maximum allowable number of bytes in
# a single POST. Default is normally 1MB.
# AddType: adds types without editing mime.types
# Example: AddType type extension [extension ...]
# Uncomment the next line IF you want .cgi files to execute from anywhere
#AddType application/x-httpd-cgi cgi
# Redirect, Alias, and ScriptAlias all have the same semantics -- they
# match the beginning of a request and take appropriate action. Use
# Redirect for other servers, Alias for the same server, and ScriptAlias
# to enable directories for script execution.
# Redirect allows you to tell clients about documents which used to exist in
# your server's namespace, but do not anymore. This allows you to tell the
# clients where to look for the relocated document.
# Example: Redirect /bar http://elsewhere/feh/bar
# Aliases: Aliases one path to another.
# Example: Alias /path1/bar /path2/foo
Alias /doc /usr/doc
# ScriptAlias: Maps a virtual path to a directory for serving scripts
# Example: ScriptAlias /htbin/ /www/htbin/
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
ScriptAlias /php/ /var/www/
AddType application/x-httpd-cgi php