debian7上安装llp(linux+lighttpd+php)

平台:debian7 x86_64

用的php-fpm管理fastcgi

更新系统
apt-get update
apt-get upgrade -y

安装php-fpm和lighttpd
apt-get install -y lighttpd php5 php5-fpm php5-gd php5-common php5-intl php5-xmlrpc php-pear php5-mysql php5-curl libcurl3 php5-mcrypt php5-mhash php5-xcache vim vim-runtime

sed -i 's/expose_php = On/expose_php = Off/g' /etc/php5/fpm/php.ini
sed -i 's/;date.timezone =/date.timezone = PRC/g' /etc/php5/fpm/php.ini
sed -i 's/disable_functions =.*/disable_functions = passthru,exec,system,chroot,scandir,chgrp,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server/g' /etc/php5/fpm/php.ini


简单配置
sed -i 's/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=1/g' /etc/php5/fpm/php.ini

mkdir /var/www/html
chown www-data:www-data /var/www/html/

vi /etc/lighttpd/lighttpd.conf

server.document-root        = "/var/www/html"
server.username             = "www-data"
server.groupname            = "www-data"

vi /etc/php5/fpm/pool.d/www.conf

;listen = /var/run/php5-fpm.sock

listen = 127.0.0.1:9000

cd /etc/lighttpd/conf-available/
cp 15-fastcgi-php.conf 15-fastcgi-php.conf.bak

vi /etc/lighttpd/conf-available/15-fastcgi-php.conf 
修改fastcgi.server
fastcgi.server += ( ".php" =>
    ((
        "host" => "127.0.0.1",
        "port" => "9000",
        "broken-scriptfilename" => "enable",
    ))
)
若用Unix socket做如下修改
fastcgi.server += ( ".php" =>
        ((
                "socket" => "/var/run/php5-fpm.sock",
                "broken-scriptfilename" => "enable",
        ))
)

开启fastcgi模块

lighttpd-enable-mod fastcgi
lighttpd-enable-mod fastcgi-php

重启服务

service php5-fpm restart
service lighttpd force-reload

测试
echo "<?php phpinfo(); ?>" > /var/www/html/index.php

http://IP/看到phpinfo结果即搭建成功

转载于:https://my.oschina.net/u/2404183/blog/748714

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值