我们假设客户端确实用了代理服务器,则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-[......]
1、安装
sudo apt-get install sendmail
sudo /etc/init.d/sendmail
#检查启动
netstat -anp|grep sendmail
#根据需要可加入开机启动
2、php配置
#编辑php.ini
sudo vim /etc/sysconfig/php/php.ini
#添加如下行
sendmail_path =/usr/sbin/sendmail -i -t
3、解决启动慢的问题
据说如果更改过host,启动send[......]
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[......]