• 欢迎访问Ppabc博客网站,专注于Linux、CentOS、Apache、Nginx、MySQL、PHP等开源工具安装优化的技术博客,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站,欢迎加入Ppabc博客
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏Ppabc博客吧

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

Freebsd admin 9年前 (2010-01-20) 283次浏览

 

一、安装配置 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 能装的都给他装上。。。
#我们的口号是只求需要不求全部^_^
make install clean
三、安装 nginx

#cd /usr/ports/www/nginx

#make install

四、安装 lightTPD

# cd /usr/ports/www/lighttpd/

#make install

五、配置 nginx
ee /usr/local/etc/nginx.conf
【去掉下列的#】

#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


Selinux 中国 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Freebsd7.0 + nginx0.6.32 + php5.2.6 + mysql5.1.26
喜欢 (0)