Freebsd7.0 + nginx0.6.32 + php5.2.6 + mysql5.1.26

一、安装配置Mysql

#cd /usr/ports/databases/mysql51-server

# make with-debug=no with-unix-socket-path=/tmp/mysql.sock with-client-ldflags=-all-static with-mysqld-ldflags=-all-static witch-assembler=yes with-extra-charsets=gbk,gb2312,utf8 with-pthread=yes enable-thread-safe-client=yes install clean

#cp /usr/local/share/mysql/my-large.cnf /usr/local/etc/my.cnf

#rehash

# mysql_install_db --user=mysql

#/usr/local/bin/mysqld_safe &

#/usr/local/bin/mysqladmin -u root password 'mypassword'

二、安装 php

#cd /usr/ports/lang/php5

#make config #(还是Freebsd爽吧,哈哈)

图1

#make install clean

# cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini

#安装 php扩展

# cd /usr/ports/lang/php5-extensions/

#make config

#安装常用的库呗,什么GD、FTP、CURL GETTEXT MBSTRING MYSQL MCRYPT PCRE ZIP ZLIB能装的都给他装上。。。
#我们的口号是只求需要不求全部^_^

三、安装nginx

#cd /usr/ports/www/nginx

#make install

四、安装lightTPD

# cd /usr/ports/www/lighttpd/

#make install

五、配置nginx

【去掉下列的#】

#user nobody

#log_format main '$remote_addr - $remote_user [$time_local] '

# '"$request" $status $body_bytes_sent '

# '"$http_referer" "$http_user_agent"';

location / {
root /usr/local/www/nginx; #(这个好理解,根目录呗,哈哈)
index index.php index.html index.htm;
}

#location ~ \.php$ {
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script.name;
# include fastcgi_params;
#}

六、启动spawn-fcgi

#/usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www -g www -C 64 -f /usr/local/bin/php-cgi

七、测试

#cd /usr/local/www/nginx

#vim info.php

<?php
phpinfo();
?>

八、bench一下:
/usr/local/bin/webbench -c 1000 -t 10 http://localhost/info.php

补充:

装完发现zf运行不了,发现没装pdo_mysql,哈哈。

#cd /usr/ports/databases/php5-pdo_mysql
#make install clean
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值