linux nginx php 架构
环境搭建参考:
http://my.oschina.net/u/1445488/blog/632611
以下为PHP代码demo.
<?php
//echo phpinfo();
$url=urldecode($_SERVER['REQUEST_URI']);
//echo $url;
$url=parse_url($url);
//print_r($url);
$path=$url['path'];
$path_arry=explode('/', $url['path']);
//print_r($path_arry);
$query_arry=explode('/', $url['query']);
//print_r($_SERVER);
//echo "haojinglong";
//print_r($query_arry);
$exe="convert -resize ".$query_arry[3]."x".$query_arry[5]." ".$path_arry[2]." test_".$path_arry[2];
//echo $exe;
exec($exe,$o,$e);
//print_r($o);
//echo $e;
//print_r($exec_out);
header("Content-type:png");
echo file_get_contents("test_".$path_arry[2]);
?>
来源:oschina
链接:https://my.oschina.net/u/1445488/blog/633617