Openwrt里架设Lighttpd+PhP5+MYSQL环境标准教程
时间:2025-07-12
时间:2025-07-12
Openwrt里架设Lighttpd+PhP5+MYSQL环境标准教程
Lighttpd+PhP5+MYSQL标准教程
一:硬件准备
路由一台,内存最少64m,推荐128m以上!优盘一个,不推荐多功能读卡器! 二:软件准备
刷好OPenwrt系统,挂载好优盘并且确保识别为/mnt/sda1(需要扩展系统的提前准 备 好)(一般的系统都会默认自动挂载到/mnt/sda1下面,教程以此为基础)
三:GO-->
■■■■■■■■■■安装web服务程序和php程序■■■■■■■■■■ 1,更新和安装组件
opkg update
opkg install lighttpd-mod-fastcgi lighttpd-mod-access
lighttpd-mod-alias lighttpd-mod-redirect lighttpd-mod-rewrite
opkg install php5-fastcgi php5-mod-gd php5-mod-xml php5-mod-ctype php5-mod-session php5-mod-sockets php5-mod-tokenizer
opkg install php5-mod-mcrypt php5-mod-mbstring php5-mod-pdo
php5-mod-curl lighttpd-mod-evasive
2,建立/mnt/sda1/web
3,修改lighttpg.conf 文件相应信息
server.modules = (
"mod_alias",
"mod_access",
"mod_evasive",
"mod_rewrite",
"mod_redirect",
"mod_fastcgi"
)
server.document-root = "/mnt/sda1/web/"
server.errorlog = "/var/log/lighttpd/error.log"
server.port = 88
s = ( "index.php", "index.html","default.html", "index.htm", "default.htm" )
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-fcgi",
"max-procs" => 2,
"bin-environment" => (