Memcached-1.4.4-14 For Win32 or Win64http://my.oschina.net/u/205403/blog/390256查看 php.ini 可见 session 的默认存储方式是 files,如下session.save_handler = filessession 的默认存储路径为 对于windows为:C:/Windows/Temp对于linux为:未知# windows平台
session.save_path = "N:/path"# linux平台
session.save_path = "/path"我们知道是用 files 文件系统来存储的话,每次 session 时都会生成一个文件,效率很低下,如...
我用的centos系统版本,是6.5版本64位1、配置centos的yum源之前我的阿里云服务器的centos,好像因为没有配置yum源而使用系统自带的,通过yum install libreoffice没找到Libreoffice安装包(当然,这可能是我系统版本的问题,具体就不得而知了,因为后来搞不定又继续更换了其他版本的centos)。yum源配置,因为我使用的是阿里云服务器,所以我使用阿里云的yum源。配置方法:http://mirrors.aliyun.com/help/centos2、安装Libreoffic...
redis3.2中增中了对GEO类型的支持,该类型存储经纬度,提供了经纬设置,查询,范围查询,距离查询,经纬度hash等操作。<?php$redis = new Redis();
$redis->connect(‘127.0.0.1‘, 6379, 60);
$redis->auth(‘‘);//添加成员的经纬度信息
$redis->rawCommand(‘geoadd‘, ‘citys‘, ‘116.40‘, ‘39.90‘, ‘beijing‘);
$redis->rawCommand(‘geoadd‘, ‘citys‘, ‘121.47‘, ‘31.23‘, ‘shanghai‘);
$redis->rawCommand(...
<!DOCTYPE>
<html>
<head><meta http-equiv="Content-type" content="text/html" charset="utf-8"><title>sort table</title><style>*{margin:0px;padding:0px;}body{background:#ccc; }table{width:350px;margin:0 auto;background-color:#eee; }table th{cursor:hand;padding:5px 0;background-color:#999; }table td{background-color:#fff;font-size:16px;font-weight:normal;text-align:center;line-hei...
php使用phpword插件生成word文档php使用phpword插件生成word文档,有需要的朋友可以参考参考。 <?php require_once ‘../libs/PHPWord/PHPWord.php‘; require_once ‘../libs/PHPWord/PHPWord/IOFactory.php‘; require_once ‘../../config.php‘; // require_once ‘../common/conn.php‘; // New Word Document $PHPWord = new PHPWord(); /**********文本格式的word text.php************/ // New portrait section //...
<?php
$url = "图片绝对地址/thumbnail.jpg";
$filename = ‘curl.jpg‘;
getImg($url, $filename);
/**@通过curl方式获取制定的图片到本地*@ 完整的图片地址*@ 要存储的文件名*/function getImg($url = "", $filename = "") {if(is_dir(basename($filename))) {echo "The Dir was not exits";returnfalse;}//去除URL连接上面可能的引号$url = preg_replace( ‘/(?:^[‘"]+|[‘"/]+$)/‘, ‘‘, $url );$hander = curl_init();$fp ...
DES是一种标准的数据加密算法,关于这个算法的详细介绍可以参考wiki和百度百科:wiki百科 百度百科php中有一个扩展可以支持DES的加密算法,是:extension=php_mcrypt.dll在配置文件中将这个扩展打开还不能够在windows环境下使用需要将PHP文件夹下的 libmcrypt.dll 拷贝到系统的 system32 目录下,这是通过phpinfo可以查看到mcrypt表示这个模块可以正常试用了。下面是PHP中使用DES加密解密的一个例子:复制代码 代码如下://$inpu...
代码很简单直接上了<?php/*** @Author: HTL* @Email: Huangyuan413026@163.com* @DateTime: 2015-05-14 16:00:08* @Description: Description*/// 降低PHP默认的错误级别// 只显示除禁用以外的所有错误// 解决因为PHP5.3+版本太高而导致在使用mysql_connect时出现的弃用警告“Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead”error...
前台代码:<html>
<head><title>上传文件</title>
</head>
<body><form enctype="multipart/form-data" action="upload.php" method="post"><input type="file" name="uploadfile" /><input type="submit" value="上传"/></form>
</body>
</html> 后台代码:<?php //上传单文件require ‘HTTP/Upload.php‘;$upload = new HTTP_Upload();$file = $upload->getFiles(‘uploadfile‘);if ($file->isValid()) {$file->moveTo(‘upload...
其实很简单 <?php
/**
*@param $ip target ip
*@param $times ping times
*/
function ping($ip,$times=4)
{
$info = array();
if(!is_numeric($times) || $times-4<0)
{
$times = 4;
}
if (PATH_SEPARATOR==‘:‘ || DIRECTORY_SEPARATOR==‘/‘)//linux
{
exec("ping $ip -c $times",$info);
if (count($info) < 9)
{
...
本文实例讲述了php使用socket post数据到其它web服务器的方法。分享给大家供大家参考。具体实现方法如下:
function post_request($url, $data, $referer=‘‘) {// Convert the data array into URL Parameters like a=b&foo=bar etc.$data = http_build_query($data);// parse the given URL$url = parse_url($url);if ($url[‘scheme‘] != ‘http‘) { die(‘Error: Only HTTP request are supported !‘);}// extract host an...
第一次在Mac下使用ThinkPHP,用到验证码功能时报如题的错误: Call to undefined function Think\imagettftext()然后检查自己的GD库,发现安装上了的。在网上找到解决方案:curl -s http://php-osx.liip.ch/install.sh | bash -s 5.5参考资料来源:http://blog.csdn.net/ayonel613/article/details/51136070 原文:http://www.cnblogs.com/b-ruce/p/5858508.html
定义和用法glob() 函数返回匹配指定模式的文件名或目录。该函数返回一个包含有匹配文件 / 目录的数组。如果出错返回 false。参数描述file必需。规定检索模式。size可选。规定特殊的设定。GLOB_MARK - 在每个返回的项目中加一个斜线GLOB_NOSORT - 按照文件在目录中出现的原始顺序返回(不排序)GLOB_NOCHECK - 如果没有文件匹配则返回用于搜索的模式GLOB_NOESCAPE - 反斜线不转义元字符GLOB_BRACE - 扩充 {a,b,c} 来匹配 ‘a‘,‘b...
1.从github上面获取AMQP基于php的实现扩展2.创建生产者 send.php View Code3.创建消费者 receive.php View Code4.在cli模式下 分别执行 send.php receive.php 可以看到如下:说明生产 消费端均ok。 5.管理 查看队列消息:安装rabbitmq_management插件【5-1】查看当前可用插件: 【5-2】 安装启用 rabbitmq_management插件【5-3】进入rabbitmq_management管理端:http://192.168.38.129:15672/【5-4】 guest用户没有权限 需要授权r...
PHPRPC 是一个轻型的、安全的、跨网际的、跨语言的、跨平台的、跨环境的、跨域的、支持复杂对象传输的、支持引用参数传递的、支持内容输出重定向的、支持分级错误处理的、支持会话的、面向服务的高性能远程过程调用协议。遇到的问题总结:Fatal error: Cannot redeclare gzdecode() in1、重命名compat.php、phprpc_client.php的gzdecode(和系统函数冲突)函数为gzdecode_other Non-static method PHPRPC_Server::initSession() shou...