このサイトにアクセスして Android で Phpcgi を実行できることがわかりました。Android でWeb サーバーを作成しましたが、正常に動作し、Php cgi をインストールしました。両方をリンクして、PHP スクリプトをHTML ページも同様です。どんな助けでも大歓迎です。
アップデート:
私の Request Processor では、out は次のように送信されます。
contentType = guessContentTypeFromName(filename);
Date now = new Date( );
out.write("Date: " + now + "\r\n");
out.write("Server: JHTTP/1.0\r\n");
out.write("Content-length: " + theData.length + "\r\n");
out.write("Content-type: " + contentType + "\r\n\r\n");
out.flush( );
推測コンテ....()
if (name.endsWith(".php")) {
String pathToPhpExecutable = Environment.getExternalStorageDirectory() + "/data" + "/php-cgi";
String phpFile ="" + "/php/myPhpFile.php";
Process process = null;
try {
process = new ProcessBuilder()
.command(pathToPhpExecutable, phpFile)
.redirectErrorStream(true)
.start();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
} finally {
process.destroy();
}