Lighttpd + PHP インストールメモ
よーわかってないけど、備忘のためにメモ
インストールしたもの
sudo aptitude install lighttpd lighttpd-dev lighttpd-doc sudo aptitude install php5-cgi
lighttpd で fastcgi を有効にする。
/etc/lighttpd/lighttpd.conf を修正するかと思いきや、すでに用意されているコマンドをたたくだけ
sudo lighttpd-enable-mod fastcgi sudo lighttpd-enable-mod fastcgi-php
すると、/etc/lighttpd/conf-enabled に設定ファイルがリンクされて、それが追加で読み込まれるぽい。
必要であれば設定ファイルをリロード
sudo /etc/init.d/lighttpd force-reload
で、サーバーを再起動
sudo service lighttpd restart
/var/www/phpinfo.php とか適当に作って動作確認
さらに PHP から使うには追加でパッケージがいる。
sudo aptitude install php5-mysql
んで、/etc/php5/cgi/php.ini を勘で編集
; Default port number for mysql_connect(). If unset, mysql_connect() will use ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look ; at MYSQL_PORT. ; http://php.net/mysql.default-port mysql.default_port = 3306 ; Default socket name for local MySQL connects. If empty, uses the built-in ; MySQL defaults. ; http://php.net/mysql.default-socket mysql.default_socket = ; Default host for mysql_connect() (doesn't apply in safe mode). ; http://php.net/mysql.default-host mysql.default_host = localhost ; Default user for mysql_connect() (doesn't apply in safe mode). ; http://php.net/mysql.default-user mysql.default_user = XXXXXX ; Default password for mysql_connect() (doesn't apply in safe mode). ; Note that this is generally a *bad* idea to store passwords in this file. ; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password") ; and reveal this password! And of course, any users with read access to this ; file will be able to reveal the password as well. ; http://php.net/mysql.default-password mysql.default_password = XXXXXX