Ubuntu+lighttpd+sqlite+php安装部署

1.安装

sudo apt-get install php7.0

sudo apt-get install php7.0-cgi

sudo apt-get install php7.0-sqlite

sudo apt-get install lighttpd

sudo apt-get install sqlite3

sudo lighttpd-enable-mod cgi fastcgi fastcgi-php

sudo /etc/init.d/lighttpd force-reload

sudo service lighttpd restart

2.配置

sudo vim /etc/lighttpd/lighttpd.conf

server.modules += (

        "mod_rewrite",

)

url.rewrite-once = (

"^/static/(.*)" => "$0",

"^/([^.]+)$" => "/index.php"

)

扩展:

1.设置多站点

sudo vim /etc/lighttpd/lighttpd.conf

$SERVER["socket"] == "0.0.0.0:88" {

         server.document-root = "/var/www/phpinfo"

}

2.解决Error: unable to open database file,数据库没有可写入的权限

sqlite数据库文件所在的文件夹权限也要改成777

你可能感兴趣的:(其他,php,ubuntu,开发语言)