PHP交叉编译和移植

2013 年 8 月 16 日3010

PHP交叉编译和移植

ZDNet开发频道 来源: ZDNet开发频道 2013年07月24日 11:05:12

关键词: php

本文摘要

交叉编译(cross-compilation)是指,在某个主机平台上(比如PC上)用交叉编译器编译出可在其他平台上(比如ARM上)运行的代码的过程。配置和编译:此处为最简易的版本,disable掉了所有的扩展模块。

ZDNet至顶网开发频道消息 配置和编译:此处为最简易的版本,disable掉了所有的扩展模块;

  [plain]

  ./configure --prefix=/home/pub/johnny/network/install-php --host=mips-linux-gnu --datadir=/home/pub/johnny/network/install-php/data --disable-FEATURE --disable-all "CC=mips-linux-gnu-gcc -EL" "CFLAGS=-EL" "LDFLAGS=-EL"

  make

  make istall

  ./configure --prefix=/home/pub/johnny/network/install-php --host=mips-linux-gnu --datadir=/home/pub/johnny/network/install-php/data --disable-FEATURE --disable-all "CC=mips-linux-gnu-gcc -EL" "CFLAGS=-EL" "LDFLAGS=-EL"

  make

  make istall

  4、测试:

  1)、修改fastcgi.conf

  添加:

  [plain]

  fastcgi.server += (

  "/test.php" =>

  ((

  "socket" => "/tmp/lighttpd.test.event.socket",

  "bin-path" => "/tmp/network/sbin/php-cgi",

  # "bin-path" => "/home/pub/johnny/network/install-php/bin/php-cgi",

  # "bin-path" => "/tmp/NMP/bin/test.php",

  "max-procs" => 1,

  # "host" => "127.0.0.1",

  # "port" => 8081,

  "check-local" => "disable",

  ))

  )

  fastcgi.server += (

  "/test.php" =>

  ((

  "socket" => "/tmp/lighttpd.test.event.socket",

  "bin-path" => "/tmp/network/sbin/php-cgi",

  # "bin-path" => "/home/pub/johnny/network/install-php/bin/php-cgi",

  # "bin-path" => "/tmp/NMP/bin/test.php",

  "max-procs" => 1,

  # "host" => "127.0.0.1",

  # "port" => 8081,

  "check-local" => "disable",

  ))

  )

  2)、把/home/pub/johnny/network/install-php/bin/php-cgi copy 到开发板/tmp/network/sbin/php-cgi

  3)、在/tmp/network/webpages/下创建test.php

  [php]

  

  phpinfo();

  >

  phpinfo();

  >

  4)、开发板上启动lighttpd

  5)、在PC上输入http://192.168.*.*/test.php,则在浏览器上显示php的信息

本文导航

转发

本文关键词: php

0 0