开源中文网

您的位置: 首页 > Debian Linux > 正文

Debian中安装Lighttpd/SQLite/PHP环境步骤

来源: 网络整理  作者: 佚名

我们知道Debian中安装Lighttpd/SQLite/PHP环境方法非常的简单,只需要简单的几步就可以实现了,下面小编给各位介绍一下吧。
第一、升级debian环境

apt-get update && apt-get -y upgrade
我们需要先升级最新的debian环境状态,因为不升级可能下面的环境包也不好安装。
第二、安装Lighttpd和SQLite数据库

apt-get install lighttpd #安装Lighttpd
apt-get install sqlite #安装SQLite
第三、安装PHP环境需要的组件

apt-get install php5-cgi php5-curl php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-mhash php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
第四、修改php.ini配置文件(vi /etc/php5/cgi/php.ini)
cgi.fix_pathinfo启动且值修改成1

第五、配置/etc/lighttpd/lighttpd.conf文件

server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
"mod_rewrite",
"mod_fastcgi",
)
server.document-root = "/var/www"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm",
" index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
include_shell "/usr/share/lighttpd/use-ipv6.pl"
dir-listing.encoding = "utf-8"
server.dir-listing = "enable"
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/x-javascript", "text/css", "text/html", "text/plain" )
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
fastcgi.server = ( ".php" => ((
"bin-path" => "/usr/bin/php5-cgi",
"socket" => "/tmp/php.socket",
"max-procs" => 1,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "4",
"PHP_FCGI_MAX_REQUESTS" => "1000"
),
)))
斜体部分是我添加和修改的,其他不变。
第六、重启Lighttpd

/etc/init.d/lighttpd restart
这样,老左在debian系统下创建/搭建Lighttpd/SQLite/PHP建站换完毕。后面我们就可以创建站点、安装网站。

Tags:中安 步骤 环境
关于开源中文网 - 联系我们 - 广告服务 - 网站地图 - 版权声明