bsd / 未分类 · 2012年6月19日

FNMP(未完)

安装mysql
cd /usr/ports/databases/mysql55-server
vi Makefile
##在第30行下面加上下面的参数
--enable-thread-safe-client
--disable-dtrace
--enable-assembler
--enable-assembler
--with-big-tables
--with-ssl
--with-embedded-server
--with-local-infile
--with-plugins=partition,innobase,myisammrg

/usr/local/bin/mysql_install_db –user=mysql
/usr/local/bin/mysql_install_db –user=mysql –ldata=/var/db/mysql ##这个才行呀

******************** 出错 好像解决不了呀
[[email protected] /usr/ports/databases/mysql55-server]# /usr/local/bin/mysql_install_db –user=mysql
FATAL ERROR: Could not find ./bin/my_print_defaults
If you compiled from source, you need to run ‘make install’ to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the –basedir option
pointing to that location.
解决方法:
/usr/local/bin/mysql_install_db –user=mysql –basedir=/usr/local/bin/mysql –datadir=/usr/local/bin/mysql/data &
[[email protected] scripts]# /usr/local/mysql/scripts/mysql_install_db –user=mysql –basedir=/usr/local/mysql –datadir=/usr/local/mysql/data &(这点非常重要)
http://www.qiufeng.net/a/15.html
cd /usr/local
mysql_install_db –user=mysql –ldata=/var/db/mysql
*************
#到这里 http://os.51cto.com/art/201101/244084_1.htm
3.4 安装php
[[email protected]]# cd /usr/ports/lang/php52
[[email protected]]# make config ##配置编译参数
[X] CLI Build CLI version
[X] CGI Build CGI version
[ ] APACHE Build Apache module
[ ] DEBUG Enable debug
[X]] SUHOSIN Enable Suhosin protection system
[X] MULTIBYTE Enable zend multibyte support
[ ] IPV6 Enable ipv6 support
[X] REDIRECT Enable force-cgi-redirect support (CGI only)
[X] DISCARD Enable discard-path support (CGI only)
[X] FASTCGI Enable fastcgi support (CGI only)
[X] PATHINFO Enable path-info-check support (CGI only)
[[email protected]]#make install clean
[[email protected]]# cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini
##删除原来的php53
pkg_delete -f php53-*
安装php52-extensions
# cd /usr/ports/lang/php52-extensions/
#make config
Options for php52-extensions 1.3
————————————————-
[X] CURL CURL support
[X] FTP FTP support
[X] GD
[X] GETTEXT
[X] MBSTRING multibyte string support
[X] MCRYPT Encryption support
[X] MYSQL
[X] PCRE Perl Compatible Regular Expression support
[ ] POSIX //去掉
[ ] SQLITE //去掉.
[X] ZIP ZIP support
[X] ZLIB
# make install clean
3.7 安装php扩展模块安装eaccelerator
cd /usr/ports/www/eaccelerator
make install clean
vim /usr/local/etc/php.ini
在后面加上
zend_extension=”/usr/local/lib/php/extensions/no-debug-non-zts-
20060613/eaccelerator.so”
eaccelerator.shm_size=”32″
eaccelerator.cache_dir=”/data/cache/ea”
eaccelerator.enable=”1″
eaccelerator.optimizer=”1″
eaccelerator.check_mtime=”1″
eaccelerator.debug=”0″
eaccelerator.filter=””
eaccelerator.shm_max=”0″
eaccelerator.shm_ttl=”0″
eaccelerator.shm_prune_period=”0″
eaccelerator.shm_only=”0″
eaccelerator.compress=”1″
eaccelerator.compress_level=”9″
安装memcache
cd /usr/ports/databases/pecl-memcache
make install clean
安装pdo_mysql
cd /usr/ports/databases/php52-pdo_mysql
make install clean
安装ImageMagick
cd /usr/ports/graphics/ImageMagick/
make install clean
make deinstall;make reinstall
看是否安装成功 convert –version #不成功的话 make deinstall;make reinstall; make install clean就行了
PHP还需安装两个.so
安装 php imagick extend (imagick.so)
# cd /usr/ports/graphics/pecl-imagick
# make install clean
安装 php magickwand extend (magickwand.so)
# cd /usr/ports/graphics/php-magickwand
# make install clean
关于magicwand的说明:http://www.imagemagick.org/script/api.php#php
然后看下扩展

安装lighttpd 获得spawn-fcgi
cd /usr/ports/www/lighttpd
make install clean
安装nginx
cd /usr/ports/www/nginx
make install clean
修改php.ini cgi.fix_pathinfo=1,让SCRIPT_FILENAME有效
安装Zendoptimizer
cd /usr/ports/devel/ZendOptimizer/
make (不要安装,只需下载下来即可)
cd work/ZendOptimizer-3.3.0a-freebsd6.0-i386
./install-tty 一路按回车,到最后选择no,不使用apache。
zend 将自动在php.ini最后添加参数的。