易截截图软件、单文件、免安装、纯绿色、仅160KB
热门标签: c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 最新文章 :

Apache 服务器 Php开发环境的配置

这是我最近几天的学习心得,与大家共享。
1,一般情况下我们用记事本写一个简单的PHP页面,放在Apache服务器安装目录下的htdocs目录下,即可访问。
这时,在httpd.conf文件中对应的服务器根目录配置为:DocumentRoot "D:/Apache Software Foundation/Apache2.2/htdocs"
目录配置为:<Directory "D:/Apache Software Foundation/Apache2.2/htdocs">...<Directory>
2,当我们把页面放在D:\webroot目录时,这是刚才的页面便不可访问了,这是我们可以修改httpd.conf文件,来重新配置服务器根目录。
DocumentRoot "D:/Mysite"
<Directory "D:/Mysite">
并且不要忘了对以前的两个配置行加上注释 行前加"#"即可。
3,由此可知,改变根目录,不需要对php.ini 文件重新进行配置。
在php.ini中对应的Path and Directory配置仍为:doc_root =D:\Apache Software Foundation\Apache2.2\htdocs。
好,今天就写到这里,希望对大家有用。
 
  ......

PHP应用memcache函数详解

Memcache::add — 添加一个值,如果已经存在,则返回false
Memcache::addServer — 添加一个可供使用的服务器地址
Memcache::close — 关闭一个Memcache对象
Memcache::connect — 创建一个Memcache对象
memcache_debug — 控制调试功能
Memcache::decrement — 对保存的某个key中的值进行减法操作
Memcache::delete — 删除一个key值
Memcache::flush — 清除所有缓存的数据
Memcache::get — 获取一个key值
Memcache::getExtendedStats — 获取进程池中所有进程的运行系统统计
Memcache::getServerStatus — 获取运行服务器的参数
Memcache::getStats — 返回服务器的一些运行统计信息
Memcache::getVersion — 返回运行的Memcache的版本信息
Memcache::increment — 对保存的某个key中的值进行加法操作
Memcache::pconnect — 创建一个Memcache的持久连接对象
Memcache::replace — R对一个已有的key进行覆写操作
Memcache::set — 添加一个值,如果已经存在,则覆写
Memcache::setCompressThreshold — 对大于某一大小的数据进行压缩
Memcache::setServerP ......

php 读取文件头部两个字节 判断文件的实际类型


    function checkFileType($fileName){
        $file     = fopen($fileName, "rb");
        $bin      = fread($file, 2); //只读2字节
        fclose($file);
        $strInfo  = @unpack("C2chars", $bin);// C为无符号整数,网上搜到的都是c,为有符号整数,这样会产生负数判断不正常
        $typeCode = intval($strInfo['chars1'].$strInfo['chars2']);
        $fileType = '';
        if($typeCode == 255216 /*jpg*/ || $typeCode == 7173 /*gif*/ || $typeCode == 13780 /*png*/) {
            return true;
        }else{
            return false;
        } ......

(PHP)CRUD类及分页类

之前写的crud类实在比较简单(http://blog.csdn.net/yycai/archive/2009/12/15/5012353.aspx),重新封装了一下:
<?php
/**
* 自动化数据表操作类
* @example
* <code>
* $db = cls_crud::factory(array('table'=>'article'));
* $data = $db->get_block_list(array('category_id' => 3), 9);
*
* $data = $db->get_list(array('title', 'id', 'time'), array('category_id'=>$cid), 'time', 1, $_GET['page'], 2, 1);
* $page_html = $db->page->get_html("?action=list&cid={$cid}", 'ylmf-page');
*
* </code>
* @author 小蔡 <cyy0523xc@gmail.com>
* @version 1.2
*/
class cls_crud
{
private static $_instance = null;
/**
* 数据表名
* @var string
*/
private $table = '';
private $link;
private $query_id;
/**
* 分页对象
* @var array
*/
public $page = null;
/**
* 私有构造函数(单例模式)
* @param
*/
private function __construct()
{
}
......

PHP的CRUD类

因为项目需要,所以自己写了一个CRUD类
虽然还比较简单,不过感觉很实用。
注:cls_database是一个数据库操作类
见:http://code.google.com/p/cyy0523xc/source/browse/trunk/php/cls_crud.php
<?php
/**
* 自动化数据表操作类
* @author 小蔡 <cyy0523xc@gmail.com>
* @version 1.0
*/
class cls_crud extends cls_database
{
/**
* 数据表名
* @var string
*/
private $table = '';
/**
* 构造函数
* @param array $config 配置变量
*/
public function __construct($config)
{
if(!empty($config))
{
foreach($config as $cf => $val)
{
$this->$cf = $val;
}
}
parent::__construct();
}
/**
* 设置数据表(例如:在操作的过程中需要改变数据表,就可以使用此方法)
* @param string $table
*/
public function set_table($table)
{
$this->table = $table;
}
/**
* 读取一条记录
* @param string ......

Run PHP on the Google App Engine

Google launched their Google App Engine (GAE) a year ago. The free hosting in App Engine is allocated 500 MB of persistent storage and enough CPU and bandwidth for about 5 million page views a month. Also, if you really want more you can see pricing plans.
GAE will support Java going forward. Unfortunately PHP support on the App Engine is still left as the top item in the wishlist. So until Google announces their official PHP support we have a workaround to run PHP using Quercus. Quercus is basically a 100% Java implementation of the PHP language (requires JDK 1.5).  Since the App Engine now supports Java this means we can use Quercus to run PHP scripts on the App Engine.
So all you need to use the GAE and run PHP
1) Register a free account.
2) Download this file to your computer.
3) Edit application XML tag in the file war\WEB-INF\appengine-web.xml to the name of the application you have registered.
4) Finally upload your application. I downloaded&n ......
总记录数:40319; 总页数:6720; 每页6 条; 首页 上一页 [4508] [4509] [4510] [4511] 4512 [4513] [4514] [4515] [4516] [4517]  下一页 尾页
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号