Freebsd How to instal Lighttpd + php-cgi + Mysql

Posted: December 5, 2009 in Freebsd

This tutorial cover how to install lighttpd + mysql + php-cgi in freebsd

Must update port

[root@bsd ~]#  portsnap fetch

[root@bsd ~]#  portsnap update

1. Install Lighttpd

cd /usr/ports/www/lighttpd

make

make install

make clean

2. Mysql server

cd /usr/ports/databases/mysql150-server/

make

make install

make clean

Mysql client

cd /usr/ports/databases/mysql150-client

make

make install

make clean

Mysq script

cd /usr/ports/databases/mysql150-scripts

make

make install

make clean

3. Install php5 for Lighttpd

cd /usr/ports/lang/php5

make

make install

make clean

Php5 must install with this module .

  • ctype: The ctype shared extension for php
  • curl: The curl shared extension for php
  • dom: The dom shared extension for php
  • gd: The gd shared extension for php
  • imap: The imap shared extension for php
  • mbstring: The mbstring shared extension for php
  • mcrypt: The mcrypt shared extension for php
  • mysql: The mysql shared extension for php
  • mysqli: The mysqli shared extension for php
  • pcre: The pcre shared extension for php
  • posix: The posix shared extension for php
  • session: The session shared extension for php
  • simplexml: The simplexml shared extension for php
  • xml: The xml shared extension for php
  • xmlreader: The xmlreader shared extension for php
  • xmlwriter: The xmlwriter shared extension for php
  • zlib: The zlib shared extension for php

4. Install php5 for Lighttpd

cd /usr/ports/lang/php5-extensions

make

make install

make clean

Auto start lighttpd and mysql service

[root@bsd ~]# pico /etc/rc.conf

mysql_enable="YES"
lighttpd_enable="YES"

Start Mysql Server Under FreeBSD

[root@bsd ~]# /usr/local/etc/rc.d/mysql-server start

Start Lighttpd Server Under FreeBSD

[root@bsd ~]# /usr/local/etc/rc.d/lighttpd start

try and good luck ;p

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s