整合freeBSD下nginx+php+mysql安装方案(ports安装)
最近一直在研究freeBSD下nginx+php+mysql的安装,看了很多网上的资料收获不小,不过大部分都是编译安装,相对初学者来说比较复杂,不容易理解,所以我整合了一些ports安装的资料,都是经过自己验证后的,安装成功也比较容易理解,下面是两种成功的案例,其中有一个是Apache代替nginx的安装,希望对大家有所帮助。
安装前更新好ports:
进入系统后,准备cvs更新:
1. cd /usr/ports/net/cvsup-without-gui
2. cp /usr/share/examples/cvsup/ports-supfile /etc/ports-supfile
3. # vi /etc/ports-supfile
将其中的#*default host=CHANGE_THIS.FreeBSD.org一行改为
*default host=cvsup4.FreeBSDchina.org
4. 更新ports
/usr/local/bin/cvsup -g -L 2 /etc/ports-supfile
1,freeBSD下Apache+php+mysql安装
安装时必须用root用户或su方式登录后生效
安装配置apache
#cd /usr/ports/www/apache22/
#make config 将mysql勾上
#make install clean
#rehash
#ee /usr/local/etc/apache22/httpd.conf 修改以下配置
ServerAdmin James@xuwenhui.com
ServerName 192.168.1.1:80
DirectoryIndex index.html index.php
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
#ee /boot/defaults/loader.conf 修改以下配置
accf_data_load="YES"
accf_http_load="YES"
#echo 'apache22_enable="YES"' >> /etc/rc.conf 启动时自动运行apache服务
如果不成功可以:ee /etc/rc.conf 里添加
apache22_enable="YES"
#apachectl start
输入地址看到It works!表示安装成功.
安装配置php5及php5-extensions
#cd /usr/ports/lang/php5
#make config apache一定要勾上,不然apache认不出php
#make install clean
#cd /usr/ports/lang/php5-extensions
#make config 选上需要支持的扩展
#make install clean
#cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini
#apachectl restart 重启apache后php就生效了
安装配置mysql
#cd
相关文档:
在Zend FrameWork中调用mysql的存储过程方法如下:
$db = Zend_Db::factory($sql_DbType,$sql_Config);
$connection=$db->getConnection();
Zend_Registry::set("db",$db);
Zend_Registry::set("connect",$connection);
调用存储过程如下代码所示:
$this->_db = Zend_Registry::get('db');
$connection=Zend_ ......
卸载MySQL数据库:
先停掉WINDOWS里的MySQL服务;
用360安全卫士强行删除MySQL数据库
接着在注册表里清除MySQL服务:
1、HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL 目录删除
2、HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL 目录删除
3、HKEY_ ......
不知不觉,5月过了大半了,想保持每个月至少给 Blog 添加一些新鲜的文章,也随便给自己的 career 轨迹做一个记录,于是提笔,呵呵~ 今天要介绍一下石头最新的作品 Hush Framework,这个框架是我这两个月的心血之作,本人还是比较满意的,以下会给大家介绍一些这个东东的亮点。这个作品的本意是为公司日后的应用开发提供一个 ......
MySQL日期字段分Date和Time两种,oracle日期字段只有Date,包含年月日时分秒信息,用当前数据库的系统时间为sysdate,精确到秒,或者用字符串转换日期型函数:
To_date('2001-08-01','YYYY-MM-DD'); 年-月-日
24小时:分钟:秒的格式 'YYYY-MM-DD HH24:MI:SS' ......
Doing INTERSECT and MINUS in MySQL
By Carsten | October 3, 2005
Doing an INTERSECT
An INTERSECT is simply an inner join where we compare the tuples of one table with those of the other, and select those that appear in both while weeding out duplicates. So
SELECT member_id, name from a
INTERSECT ......