安装mysql
==================
1.yum install mysql*
2.启动:/sbin/service mysqld start
安装php
=================
1.yum install php
2.查看php安装目录:whereis php
安装lighttpd
=================
1.yum install lighttpd
2.yum search lighttpd(检测lighttpd没有被安装的依赖包)
3.yum install lighttpd-fastcgi.i686(必须)
4.yum install li9ghttpd-mod_mysql_vhost.i686
配置lighttpd.conf
==========================
1.vim /etc/lighttpd/lighttpd.conf
2.打开server.modules中的模块:mod_rewrite、mod_redirect、mod_alias、mod_access、mod_setenv、mod_fastcgi、mod_proxy、mod_compress、mod_accesslog
3.添加用户lighttpd,决定由他启动lighttpd
4.fastcgi.server = (".php" = >
("localhost" => (
"socket" => "/var/run/lighttpd/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi",
......
最近写一个关于读取中文文件名的小CASE中遇到了不PHP不支持中文文件名的问题
我的环境:
WINDOWS+Appach +mysql
php页 MYSQL均为编码UTF-8
解决方法如下:
在MYSQL中取出的中文文件名转换其编码
$fileName=iconv("UTF-8","GBK",$fileName); ......
作为一个资深并且专业的扒皮人员,在我从初三开始投入伟大的互联网中到现在积累了丰富的扒皮经验。我相信每个做web的程序员也都会有类似的经历。
在扒皮过程中,必不可少的需要下载样式文件中的图片。碰到比较庞大的样式文件,其中可能会有上百个需要下载的图片,那么使用下面这段小代码是最为合
适的了。
< ?php
/*
More & Original PHP Framwork
Copyright (c) 2007 - 2008 IsMole Inc.
Author: kimi
Documentation: 下载样式文件中的图片,水水专用扒皮工具
*/
//note 设置PHP超时时间
set_time_limit(0);
//note 取得样式文件内容
$styleFileContent = file_get_contents('images/style.css');
//note 匹配出需要下载的URL地址
preg_match_all("/url\((.*)\)/", $styleFileContent, $imagesURLArray);
//note 循环需要下载的地址,逐个下载
$imagesURLArray = array_unique($imagesURLArray[1]);
foreach($imagesURLArray as $imagesURL) {
file_put_contents(basename($imagesURL), file_get_contents($imagesURL));
}
最后预祝各位在扒皮的过程中,一扒到底! ......
作为一个资深并且专业的扒皮人员,在我从初三开始投入伟大的互联网中到现在积累了丰富的扒皮经验。我相信每个做web的程序员也都会有类似的经历。
在扒皮过程中,必不可少的需要下载样式文件中的图片。碰到比较庞大的样式文件,其中可能会有上百个需要下载的图片,那么使用下面这段小代码是最为合
适的了。
< ?php
/*
More & Original PHP Framwork
Copyright (c) 2007 - 2008 IsMole Inc.
Author: kimi
Documentation: 下载样式文件中的图片,水水专用扒皮工具
*/
//note 设置PHP超时时间
set_time_limit(0);
//note 取得样式文件内容
$styleFileContent = file_get_contents('images/style.css');
//note 匹配出需要下载的URL地址
preg_match_all("/url\((.*)\)/", $styleFileContent, $imagesURLArray);
//note 循环需要下载的地址,逐个下载
$imagesURLArray = array_unique($imagesURLArray[1]);
foreach($imagesURLArray as $imagesURL) {
file_put_contents(basename($imagesURL), file_get_contents($imagesURL));
}
最后预祝各位在扒皮的过程中,一扒到底! ......
发信人: feuvan ( }><(([@> ~ ), 信区: PHP
标 题: [入门]用 PHP 读取文件的正确方法
发信站: 水木社区 (Wed Mar 7 17:51:58 2007), 站内
http://www.ibm.com/developerworks/cn/opensource/os-php-readfiles/index.html
用 PHP 读取文件的正确方法
了解使用 fopen、fclose、feof、fgets、fgetss 和 fscanf 的正确时机
级别: 中级
Roger McCoy (rogermccoy@gmail.com), IT Specialist, 自由撰稿人
2007 年 3 月 06 日
了解如何使用 PHP 的各种文件函数。查看诸如 fopen、fclose 和 feof 之类的基本文件函数;了解诸如 fgets、
fgetss 和 fscanf 之类的读取函数。并且发现用一两行代码处理整个文件的函数。
让我们算一算有多少种方法
处理诸如 PHP 之类的现代编程语言的乐趣之一就是有大量的选项可用。PHP 可以轻松地赢得 Perl 的座右铭
“There's more ......
<?php
###########################################
#作者: 沈潋(S&S Lab) #
#E-mail:shenlian@hotmail.com #
#web: http://www.focus-2000.com #
# #
#版权声明: #
& ......
function randomkeys($length)
{
$key='';
$pattern='123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
for($i=0;$i<$length;$i++)
{
$key .= $pattern{mt_rand(0,47)};
}
return $key;
}
echo randomkeys(20); ......