pecl install imagick
steven@server:/var/www$ sudo pecl install imagick
downloading imagick-2.3.0.tgz ...
Starting to download imagick-2.3.0.tgz (86,976 bytes)
.....................done: 86,976 bytes
12 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
Please provide the prefix of Imagemagick installation [autodetect] :
building in /var/tmp/pear-build-root/imagick-2.3.0
running: /tmp/pear/temp/imagick/configure --with-imagick
*** ... snip ... ***
checking ImageMagick MagickWand API configuration program... configure: error: not found. Please provide a path to MagickWand-config or Wand-config program.
ERROR: `/tmp/pear/temp/imagick/configure --with-imagick' failed
need below command.
sudo apt-get install libmagickwand-dev libmagickcore-dev
/etc/init.d/apache2 restart
referer是php用来判断页面上级来源页面的一个超级变局变量了,我们可以使用referer来判断是从那个页面进入到此页面了,这样我们可以进行更好的跟踪了,下面我就来给各位朋友整理了几种伪造页面referer来源例子,希望例子能给各位朋友.
file_get_contents方法,代码如下:
$opt=array('http'=>array('header'=>"Referer: $refer"));
$context=stream_context_create($opt);
$file_contents = file_get_contents($url,false, $context);
分析:file_get_contents中stream_context_create就伪造来源的重要参数了,这个什么好说的非常的简单.
CURL方式,代码如下:
- $ch = curl_init();
- curl_setopt ($ch, CURLOPT_URL, "http://www.phpfensi.com");
- curl_setopt ($ch, CURLOPT_REFERER, "http://www.phpfensi.com/");
- curl_exec ($ch);
- curl_close ($ch);
分析:curl伪造来源页面非常的简单这是它的优点了,所以我们只要在页面加上curl_setopt ($ch,CURLOPT_REFERER,"http://www.phpfensi.com/");就可以了.
SOCKET方式,代码如下:
- $server = 'www.phpfensi.com';
- $host = 'www.phpfensi.com';
- $target = 'index.php';
- $referer = 'http://www.phpfensi.com/'; // Referer
- $port = 80;
- $fp = fsockopen($server, $port, $errno, $errstr, 30);
- if (!$fp){
- echo "$errstr ($errno)\n";
- }else{
- $out = "GET $target HTTP/1.1\r\n";
- $out .= "Host: $host\r\n";
- $out .= "Referer: $referer\r\n";
- $out .= "Connection: Close\r\n\r\n";
- fwrite($fp, $out);
- while (!feof($fp)){
- echo fgets($fp, 128);
- }
- fclose($fp);
- }
友情提示:三种性能比对fsockopen是最好的,$optionget = array(‘http’ => array(‘method’ => “GET”, ‘header’ => “User-Agent:Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)\r\nAccept:*/*\r\nReferer:” . $referer . “\r\nCookie:” . $cookie));
$file = file_get_contents($url, false , stream_context_create($option));
- <?php
- echo "<hr />";
- echo $_SERVER["HTTP_REFERER"];
- ?>