我们假设客户端确实用了代理服务器,则PHP版的写法是:
<?php
$ra = $_SERVER["REMOTE_ADDR"];
$hv = $_SERVER["HTTP_VIA"];
$fwd = $_SERVER["HTTP_X_FORWARDED_FOR"];
/*
fwd = "";
if($_SERVER['HTTP_X_FORWARDED_FOR'])
$fwd = $_SERVER['HTTP_X_FORWARDED_FOR'];
els[......]
我们假设客户端确实用了代理服务器,则PHP版的写法是:
<?php
$ra = $_SERVER["REMOTE_ADDR"];
$hv = $_SERVER["HTTP_VIA"];
$fwd = $_SERVER["HTTP_X_FORWARDED_FOR"];
/*
fwd = "";
if($_SERVER['HTTP_X_FORWARDED_FOR'])
$fwd = $_SERVER['HTTP_X_FORWARDED_FOR'];
els[......]
#!/usr/local/bin/php.cli
<?php
require_once './lib/swift_required.php';
//MySQL
$mysql_dbname = "db";
$mysql_user = "user";
$mysql_pass = "pass";
$mysql_file = "./xxx.sql";
$mysql_charset = "utf8";
system("mysqldump --default-character-[......]
本文记录了LNMP在Ubuntu10.10下的编译安装过程,版本如下:
Nginx 0.8.54
MySQL 5.1.56
PHP-FPM 5.3.6
1、编译安装MySQL 5.1.56
#下载
wget http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.56.tar.gz/from/http://mysql.he.net/
mv index.html mysql-5.1.56.tar.gz
tar -xzvf m[......]
APC是一个很好的PHP加速器,比起Xcache来说,速度略逊,但是省内存!
[shell]
#下载、编译
wget http://pecl.php.net/get/APC-3.1.4.tgz
tar -xzvf APC-3.1.4.tgz
cd APC-3.1.4
./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/local/php/bin/php-config
#安装、设置
[/shel[......]