• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

lighttpd+php安装配置记录

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

博客已经搬家,请访问如下地址:http://www.czhphp.com

1. 下载 lighttpd , pcre , php , 其他相关扩展包
2. 安装 pcre
    ./configure & make & make install


    安装 php
    ./configure --prefix=/usr/local/php/ --with-mysql=/usr/local/mysql --with-gd=/usr/local/gd --with-libxml-dir --with-zlib=/usr/local/zlib --with-curl --with-libxml-dir=/usr/local/libxml --enable-exif --enable-soap --enable-sockets --with-jpeg-dir=/usr/local/jpeg --with-png-dir=/usr/local/png --with-ttf --with-freetype-dir=/usr/local/freetype --with-ming=/usr/local/libming --enable-sqlite-utf8 --with-xsl=/usr/local/libxslt --enable-zend-multibyte --enable-shared --enable-mbstring --enable-zend-multibyte --with-xmlrpc --enable-fastcgi --enable-force-cgi-redirect  
   
    注意 :
    扩展 --enable-fastcgi --enable-force-cgi-redirect , 会生成 (bin/php-cgi 执行文件)
    不要带--with-apxs2=/usr/local/apache2/bin/apxs (带上后,安装出来的php执行文件是cli模式的)

    # make & make install
  
    安装 lighttpd
    
     ./configure --prefix=/usr/local/lighttpd & make & make install

3. 创建或复制 lighttpd.conf 启动配置文件
       切换到源码包的根目录/doc
      # cp lighttpd.conf /usr/local/lighttpd/lighttpd.conf   
      
     启动 lighttpd 方法:
      # /usr/local/lighttpd/sbin/lighttpd -f /usr/local/lighttpd/lighttpd.conf

      此时安装成功,并可以正常访问了!

4. 配置为系统服务
      每次启动切换到 /usr/local/lighttpd/sbin 执行 ./lighttpd -f /usr/local/lighttpd/lighttpd.conf 比较麻烦, 而且不方便重新启动!

      切换到源码包的根目录下:
      # cd doc
      # cp sysconfig.lighttpd /etc/sysconfg/lighttpd
      # cat /etc/sysconfg/lighttpd
       
内容如下: LIGHTTPD_CONF_PATH=/etc/lighttpd/lighttpd.conf , 修改到对应的配置文件目录 /usr/local/lighttpd/lighttpd.conf
      # cp rc.lighttpd.redhat /etc/init.d/lighttpd
      # cat /etc/init.d/lighttpd
       
修改 lighttpd="/usr/sbin/lighttpd" 到安装目录 /usr/lcoal/lighttpd/sbin/lighttpd

      希望服务器启动的时候就启动lighttpd:
      # chkconfig lighttpd on

      命令操作: service lighttpd [command] : [start|stop|restart|condrestart|reload|status]

5. 配置lighttpd 支持 php, cgi 等。。。
   
fastcgi.server             = ( ".php" =>
                               ( "localhost" =>
                                 (
                                   "socket" => "/tmp/php-fastcgi.socket",
                                   "bin-path" => "/usr/local/php/bin/php-cgi"
                                 )
                               )
                            )

6. 安装 spawn-fcgi, 管理fastcgi进程
# ./configure --prefix=/usr/local/spawn-fcgi & make & make install

    
     进入 lighttpd 源码包的根目录下:
     # cd doc
     # cp spawn-php.sh /usr/local/lighttpd/spawn-php.sh

      修改里面的内容
      ## ABSOLUTE path to the spawn-fcgi binary
SPAWNFCGI="/usr/local/lighttpd/bin/spawn-fcgi"

   ## ABSOLUTE path to the PHP binary
FCGIPROGRAM="/usr/local/php/bin/php-cgi"
    

博客已经搬家,请访问如下地址:http://www.czhphp.com


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
php中的func_num_args、func_get_arg与func_get_args函数发布时间:2022-07-10
下一篇:
php将时间戳转化为天小时分秒发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap