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

Nginx/PHP/path_info问题,去掉index.php

作用是把形如:www.abc.com/index.php/blog/show 的地址美化成  www.abc.com/blog/show  ,使用$_SERVER['PATH_INFO']接收变量。
server
{
listen 80;
server_name myweb;
index index.html index.htm index.php;
root /home/zhaowei/code;
if (!-f $request_filename) {
rewrite ^/m-php-framework/(.*)$ /m-php-framework/index.php/$1 last;
}
location ~ .*\.(php|php5)
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME /home/zhaowei/code$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
log_format wwwlogs '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" $http_x_forwarded_for';
access_log /data1/logs/wwwlogs.log wwwlogs;
}
#nginx -s reload   重启NGINX


相关文档:

php json_encode 问题解决小记

今天碰到个奇怪的问题,一个ajax页面在本地测试服务器运行一切正常,传到公网服务器上就死活说 javascript错误。
打开代码一看,是javascript的那一行使用了一个json的reponseText,DEBUG一下,原来回传是空的。
看看后台PHP,貌似没什么问题(本来以为是URL问题)然后上网搜一下,原来是PHP的json_encode函数在5.2下才有 ......

PHP生成数据流GIF和PNG透明图形


<?php
header("content-type:image/png");
$img=ImageCreate(100,35);
$bgcolor=ImageColorAllocate($img,0,0,0);
$red=ImageColorAllocate($img,255,0,0);
$bgcolortrans=ImageColorTransparent($img,$bgcolor);
ImageString($img,5,10,10,"PNG PHP",$red);
ImagePng($img);
ImageDestro ......

PHP经验分享

1.如果一个方法能被静态,那就声明他为静态的,速度可提高1/4;
  2.echo的效率高于print,因为echo没有返回值,print返回一个整型;
  3.在循环之前设置循环的最大次数,而非在在循环中;
  4.销毁变量去释放内存,特别是大的数组;
  5.避免使用像__get, __set, __autoload等魔术方法;
  6.requiere_once()比较 ......

PHP 5.3.0 连接mysqli出错的解决

近日因公司开发需要,在本机Win7下架设了Apache+MySql+PHP
所使用PHP版本:PHP5.3.0, 之后发现无法连接mysql数据库,均报超时错误:
PHP Warning: mysqli::mysqli(): [2002] A connection attempt failed because the connected party did not (trying to connect via tcp://localhost:3306) in xxx.php on line x
PHP Warni ......

简单的概述对php的认识

作为一个php程序员来说。。有什么是我们应该知道的呢?
首先来说一下。php之所以能够在国内走红。。其最重要的一点就是他是开源的。好多优秀的东西都可以免费的拿来用。现在市面上有那么都的php开源产品。当我们需要做一个相关的网站的时候。只要把人家的产品拿过来。根据自己的需要做二次开发就可以了。。从而使php项目的 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号