分享

How to install ligh-t-t-pd with php?

 wedone 2013-07-18

I've installed lighttpd, and it is working fine. I've tried to install php5, as it is described here but when I try the last step

sudo service lighttpd force-reload

I get:

[FAIL] Reloading web server configuration: lighttpd failed!

and php is not working.

My lighttpd configuration can be found at http:///eagG4SwF:

server.modules = (
        "mod_fastcgi",
        "mod_access",
        "mod_alias",
        "mod_compress",
        "mod_redirect",
#       "mod_rewrite",
)

        server.document-root        = "/mnt/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"
server.port                 = 80
        server.follow-symlink       = "enable"
        server.dir-listing          = "enable"
        dir-listing.encoding = "utf-8"

index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny             = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

compress.cache-dir          = "/var/cache/lighttpd/compress/"
compress.filetype           = ( "application/javascript", "text/css", "text/html", "text/plain" )

# default listening port for IPv6 falls back to the IPv4 port
include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
shareimprove this question
1 
There is a problem with the configuration file; please post it. – Alex Chamberlain Jul 19 '12 at 14:00
here is my lighttpd configuration /eagG4SwF – Euphorbium Jul 19 '12 at 14:16

I've got mine working by following instruction from Running a lightweight webserver on the Raspberry Pi (lighttpd).

Summary of the steps required following the link above.

  1. Install lighttpd -> sudo apt-get install lighttpd

  2. Install mysql database (optional) -> sudo apt-get install mysql-server mysql root password will be prompt upon completion of installation

  3. Install PHP -> sudo apt-get install php5-common php5-cgi php5 php5-mysql

    NOTE it's important to install in the order listed above. If you try to install php5 without first installing the php5-cgi package then it will install Apache as well, which we don't want for this light-weight lighttpd server.

  4. Install php mysql libraries -> sudo apt-get install php5-mysql

  5. Enable lighttpd to handle php -> sudo lighty-enable-mod fastcgi-php followed by reloading lighttpdsudo service lighttpd force-reload

  6. Set permission for /var/www -> sudo chown www-data:www-data /var/www, then allow group to write to the dir sudo chmod 775 /var/www, followed by adding pi to the www-data group sudo usermod -a -G www-data pi

  7. Logout/Login to pickup group permission so pi can also write to the /var/www dir



    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多