您的位置:首页 > 理论基础 > 计算机网络

web服务器lighttpd 对php的支持

2016-08-05 14:26 197 查看

一、前言

前面已经介绍过lighttpd的交叉编译过程了《嵌入式web服务器lighttpd的交叉编译及配置--xilinx
zynq》

二、配置lighttpd支持php

1. 修改刚复制过来的conf.d/fastcgi.conf文件
在server.modules += ( "mod_fastcgi" )下面添加如下:
fastcgi.server = (
".php" =>
( "localhost" =>
(
"socket" => "/home/cq/web/lighttpd/lighttpd.player.server.socket",
"bin-path" => "/home/cq/web/lighttpd/bin/php-cgi",
"max-procs" => 1,
"check-local" => "disable"
))
)

2、PHP的移植

2.1、在编译PHP前要先编译libxml

配置 CC=arm-xilinx-linux-gnueabi-gcc ./configure --prefix=/home/cq/web/lighttpd/ --host=arm-xilinx-linux-gnueabi --with-shared
编译安装
make && make install2.2、php的配置,这里开启了socket,json的支持
'./configure' '--prefix=/home/cq/web/lighttpd/' '--host=arm-xilinx-linux-gnueabi' '--disable-all' '--datadir=/home/cq/web/lighttpd/data' 'CC=arm-xilinx-linux-gnueabi-gcc' 'CFLAGS=-I/home/cq/web/lighttpd/include' 'LDFLAGS=-L/home/cq/web/lighttpd/lib' '--with-libxml-dir=/home/cq/web/lighttpd/' '--with-zlib-dir=/home/cq/bluez' '--enable-sockets' '--enable-json' '--enable-shared' 'host_alias=arm-xilinx-linux-gnueabi'2.3、运行测试
在webpages下创建phpinfo.php,加入如下代码:<?php
echo phpinfo();
?>在浏览器打开卡发板ip 看到下图



by:acr_28 转载请注明出处
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  lighttpd web php socket json