易截截图软件、单文件、免安装、纯绿色、仅160KB

lighttpd + mysql + php(fast cgi)安装与配置

准备:
lighttpd-1.4.15.tar.gz
php-4.4.2.tar.gz
mysql-5.0.20a.tar.gz
开始:
1 编译安装lighttpd
 # tar zxvf lighttpd-1.4.15.tar.gz
 # cd lighttpd-1.4.15
 #  ls
 # ./configure --prefix=/usr/local/lighttpd    //此部无法编译时提示安装prce-devel
 #  make
 #  make install
 创建网站根目录
 # mkdir /usr/local/lighttpd/htdocs
 创建配置文件放置目录
 #mkdir /usr/local/lighttpd/etc
创建日志目录
#mkdir /usr/local/lighttpd/logs
将配置文件拷贝到/usr/local/lighttpd/etc
#cp doc/lighttpd.conf /usr/local/lighttpd/etc
 
 启动lighttpd
 #/usr/local/lighttpd/sbin/lighttpd -f /usr/local/lighttpd/etc/lighttpd.conf
我在安装的时候在error日志出现 opening errorlog '/var/log/lighttpd/access.log
在/var/log下建立lighttpd目录就可以了
 
2 安装 MYSQL
#  tar zxvf mysql-5.0.20a.tar.gz
#  cd mysql-5.0.20a
#  ./configure --prefix=/usr/local/mysql
#  make;make install
# groupadd mysql
# useradd -g mysql mysql
# cp support-files/my-medium.cnf /etc/my.cnf
# cd /usr/local/mysql/
初始化
#  bin/mysql_install_db --user=mysql
运行
bin/mysqld_safe --user=mysql &
设置自动启动(略)
3 安装 php (fast-cgi)
# tar zxvf php-4.4.2.tar.gz
# cd php-4.4.2
编译,加 --enable-fastcgi 和 --enable-force-cgi-redirect 选项
# ./configure --prefix=/usr/local/php-fastcgi  --enable-fastcgi --enable-force-cgi-redirect --with-zlib --
with-gd --with-ttf --with-png --with-expat-dir=/usr --with-gmp --with-xml --with-mysql=/usr/local/mysql --with-
charset=utf-8 --disable-debug --disable-posix --disable-rpath --enable-safe-mode --enable-magic-quotes --disabl
e-dmalloc --enable-bcmath --enable-dio --enable-gd-native-ttf --enable-sysvsem --enable-sysvshm --enable-wddx -
-enable-versioning --enable-pic --enable-inline-optimization --enable-memory-limit --enable-mbstring --enable-m
bregex --enable-mbstr-enc-trans --with-config-file-path=/usr/local/lib --enable-ft


相关文档:

php开发web程序的几点经验记录

以前把php当作一个纯粹的系统编程脚本,从3月份开始第一次使用php写web网站,一点经验在这里总结一下。
一:打开错误显示和错误日志。在php.ini中把dispaly_errors设置为On,或者在脚本开头用ini_set('display_errors', 'On')。
二:
调试工具必备。需要两种调试工具:第一种是调试php脚本的,就像C调试器那样可以在脚本 ......

MySQL常用的导入导出命令

常用的:
导出
mysqldump -hyour_host -uyour_username -pyour_password database_name > file.sql
导入
mysql -hyour_host -uyour_username -pyour_password database_name < file.sql
或者先用mysql客户端登陆后,
>\. file.sql
也可以完成导入功能
上面的两个命令结合起来用,可以完成将一个数据库的 ......

优化MySQL数据库查询

优化MySQL数据库查询
 
   在优化查询中,数据库应用(如MySQL)即意味着对工具的操作与使用。使用索引、使用EXPLAIN分析查询以及调整MySQL的内部配置可达到优化查询的目的
  任何一位数据库程序员都会有这样的体会:高通信量的数据库驱动程序中,一条糟糕的SQL查询语句可对整个应用程序的运行产生严重的 ......

mysql得到查询结果的同时统计查询结果的数目

做一些数据库查询,不仅希望得到要查询的结果,还希望方便地统计一下查询结果中有多少条记录。我通常的做法是:
$q = "select * from $fromTable where $where limit $start,$pageSize";
$r = mysql_query($q);
$q = "select count(*) from $fromTable where $where";
$cnt = mysql_query($q);
当 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号