04/29/14

php-5.3 下安装pear 和 pecl

环境描述:服务器php安装好之后,bin目录下没有pecl、pear等命令,从而导致安装memcache、apc等php扩展比较麻烦。

一、安装pear、pecl

1、下载go-pear

[root@yf_web_115 bin]# curl -o go-pear.php http://pear.php.net/go-pear.phar
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100 3987k  100 3987k    0     0  30213      0  0:02:15  0:02:15 –:–:–  117k

2、php 执行go-pear

[root@yf_web_115 bin]# /opt/phpdba/php-5.3.27/bin/php go-pear.php

Below is a suggested file layout for your new PEAR installation.  To
change individual locations, type the number in front of the
directory.  Type ‘all’ to change all of them or simply press Enter to
accept these locations.

1. Installation base ($prefix)                   : /opt/phpdba/php-5.3.27
2. Temporary directory for processing            : /tmp/pear/install
3. Temporary directory for downloads             : /tmp/pear/install
4. Binaries directory                            : /opt/phpdba/php-5.3.27/bin
5. PHP code directory ($php_dir)                 : /opt/phpdba/php-5.3.27/share/pear
6. Documentation directory                       : /opt/phpdba/php-5.3.27/docs
7. Data directory                                : /opt/phpdba/php-5.3.27/data
8. User-modifiable configuration files directory : /opt/phpdba/php-5.3.27/cfg
9. Public Web Files directory                    : /opt/phpdba/php-5.3.27/www
10. Tests directory                               : /opt/phpdba/php-5.3.27/tests
11. Name of configuration file                    : /opt/phpdba/php-5.3.27/etc/pear.conf

1-11, ‘all’ or Enter to continue:
Beginning install…
Configuration written to /opt/phpdba/php-5.3.27/etc/pear.conf…
Initialized registry…
Preparing to install…
installing phar:///opt/phpdba/php-5.3.27/bin/go-pear.php/PEAR/go-pear-tarballs/Archive_Tar-1.3.11.tar…
installing phar:///opt/phpdba/php-5.3.27/bin/go-pear.php/PEAR/go-pear-tarballs/Console_Getopt-1.3.1.tar…
installing phar:///opt/phpdba/php-5.3.27/bin/go-pear.php/PEAR/go-pear-tarballs/PEAR-1.9.4.tar…
installing phar:///opt/phpdba/php-5.3.27/bin/go-pear.php/PEAR/go-pear-tarballs/Structures_Graph-1.0.4.tar…
installing phar:///opt/phpdba/php-5.3.27/bin/go-pear.php/PEAR/go-pear-tarballs/XML_Util-1.2.1.tar…
install ok: channel://pear.php.net/Archive_Tar-1.3.11
install ok: channel://pear.php.net/Console_Getopt-1.3.1
install ok: channel://pear.php.net/Structures_Graph-1.0.4
install ok: channel://pear.php.net/XML_Util-1.2.1
install ok: channel://pear.php.net/PEAR-1.9.4
PEAR: Optional feature webinstaller available (PEAR’s web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR’s PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR’s PHP-GTK2-based installer)
PEAR: To install optional features use “pear install pear/PEAR#featurename”

******************************************************************************
WARNING!  The include_path defined in the currently used php.ini does not
contain the PEAR PHP directory you just specified:
</opt/phpdba/php-5.3.27/share/pear>
If the specified directory is also not in the include_path used by
your scripts, you will have problems getting any PEAR packages working.

Would you like to alter php.ini </opt/phpdba/php-5.3.27/etc/php.ini>? [Y/n] : Y

php.ini </opt/phpdba/php-5.3.27/etc/php.ini> include_path updated.

Current include path           : .:
Configured directory           : /opt/phpdba/php-5.3.27/share/pear
Currently used php.ini (guess) : /opt/phpdba/php-5.3.27/etc/php.ini
Press Enter to continue:

** WARNING! Old version found at /opt/phpdba/php-5.3.27/bin, please remove it or be sure to use the new /opt/phpdba/php-5.3.27/bin/pear command

The ‘pear’ command is now at your service at /opt/phpdba/php-5.3.27/bin/pear

** The ‘pear’ command is not currently in your PATH, so you need to
** use ‘/opt/phpdba/php-5.3.27/bin/pear’ until you have added
** ‘/opt/phpdba/php-5.3.27/bin’ to your PATH environment variable.

Run it without parameters to see the available actions, try ‘pear list’
to see what packages are installed, or ‘pear help’ for help.

For more information about PEAR, see:

http://pear.php.net/faq.php

http://pear.php.net/manual/

Thanks for using go-pear!

3、检查php/bin目录下pear pecl

[root@yf_web_115 bin]# ls
go-pear.php  pear  peardev  pecl  phar  phar.phar  php  php-config  phpize

二、安装过程中遇到的问题

[root@yf_web_115 bin]# curl -o go-pear.php http://pear.php.net/go-pear
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
100 88959  100 88959    0     0  54233      0  0:00:01  0:00:01 –:–:– 76033

[root@yf_web_115 bin]# /opt/phpdba/php-5.3.27/bin/php go-pear.php
Sorry!  Your PHP version is too new (5.3.27) for this go-pear.
Instead use http://pear.php.net/go-pear.phar for a more stable and current
version of go-pear, more suited to your PHP version.

Thank you for your coopertion and sorry for the inconvenience

原因:go-pear.php 版本比较旧,下载新版本go-pear.php就可以解决问题。

三、知识详解

PECL

即PHP Extension Community Library, PHP扩展库.
这里的扩展指的是使用C语言编写的动态链接库扩展, 通过php.ini配置, 并随PHP进程被装入内存.

常见的PECL扩展比如:

  • apc – 字节码缓存器
  • xdebug – 调试工具
  • PDO_xxoo – 数据库驱动
  • memcache, mongo – NoSQL数据库驱动
  • markdown – 文本处理器
  • zip – 压缩算法

这种动态链接库又分两种, 一种是用户空间扩展, 如mongo, markdown, 旨在通过C代码提升性能, 为PHP代码提供更好的抽象.
另一种是Zend扩展, 这是对Zend内核(PHP引擎内核)的扩展, 如apc, xdebug.

PECL在Windows上并不好用, 通常的做法是直接下载形式如php_xxoo.dll的已编译好的二进制动态链接库.
下载时还应该选择对应PHP版本号, 处理器指令集, 线程安全性的版本.
据说PECL的基础设施还在建设中, 目前有个简陋的网页(http://downloads.php.net/pierre/)可以下载到一部分编译好的Windows PECL扩展.

而在Linux则方便不少, 比如要安装apc, 只需:

pecl install apc

即可, pecl是PHCL的命令行工具, 可以自动完成扩展的安装(通常是下载源代码后自动编译)工作.

PEAR

即PHP Extension and Application Repository, PHP扩展和应用库.
这里的扩展和应用, 指的是用PHP编写的软件包, 一系列类库性质的PEAR包会被安装到PHP的根目录, 然后你就可以在你的代码中直接包含(require)这些类库.

常见的PEAR包如:

  • phpDocumentor – 文档提取工具
  • PHPUnit – 单元测试框架
  • DB – 数据库封装

PEAR希望创建一个规范化的PHP源代码包仓库, PEAR本身也对源代码的格式提出了一些要求, 以便于让源码包更加通用和规范.
同时PEAR也是PECL的上级项目, PECL是PEAR的一部分, pecl的命令行工具也包含在PEAR中.

#安装标配的源码包:
pear install db
#PEAR也采用了`软件源`的设计, 安装非标配的软件包如phpunit, 需要先添加频道(软件源)
pear channel-discover pear.phpunit.de
pear install phpunit

PHAR

PHAR即PHP Archive, 起初只是PEAR中的一个库而已, 后来在PHP5.3后被重新编写成C扩展并内置到PHP中.
PEAR用来将多个.php脚本打包(也可以打包其他文件)成一个.phar的压缩文件(通常是ZIP格式).
目的在于模仿Java的.jar, 不对, 目的是为了让发布PHP应用程序更加方便. 同时还提供了数字签名验证等功能.

.phar文件可以像.php文件一样, 被PHP引擎解释执行, 同时你还可以写出这样的代码来包含(require) .phar 中的代码.

require("xxoo.phar");
require("phar://xxoo.phar/xo/ox.php");

PEAR中的很多源码包都通过PHAR打包.

bcompiler

提到了PHAR, 我还不得不提一下bcompiler, PHP bytecode Compiler, PHP字节码编译器.
虽然它目前只是个实验性项目. 可以通过pecl安装.

很多PHP编写的商业软件, 有闭源的需要, 通常它们会选择Zend Guard等商业代码加密软件, 它们成熟稳定, 但也价格昂贵.
其实bcompiler就能满足这个需求, 它可以将PHP代码编译成字节码, 虽然保密性不及商业加密软件, 但也很难被轻易修改, 而且因为省去了生成字节码的过程, 会有不少的性能提升, 官方表示编译后体积会减少到原来的20%, 性能会提高30%.

使用bcompiler编译出的PHP字节码文件可以直接使用(就像PEAR那样):

// xxoo.exe 是 xxoo.php 编译后的字节码.
require("xxoo.exe");

 

01/3/14

mysql mtop 监控系统

2014年,第一篇博文,记录下记录搭建的mysqlmtop系统。

1.实时 MySQL 可用性监视
数据库可用性监视和衡量让开发者和DBA们了解它们是否符合所承诺的服务水平。

2.实时 MySQL 状态监视和警报
MySQL MTOP 持续监视 MySQL 的基本状态和性能信息,包括数据库连接状态,启动时间,数据库版本,总连接数,活动进程,QPS,TPS,
进出MySQL数据库的流量信息。在数据库状态异常或偏离正常基准水平时发出报警邮件通知。

3.实时 MySQL复制监视
MySQL MTOP自动发现您的 MySQL 复制拓扑结构,自动监视数据库的延时和binlog信息,让您可以了解所有 MySQL 主服务器和从服务器的性能、可用性和运行状况。并在问题(如从服务器延迟)导致停机前向管理员提供改正建议。

4.远程监视云中的 MySQL
适合于云和虚拟机的设计,使您能远程监视您的MySQL服务器不需要任何远程代理器。

5.直观管理所有 MySQL 服务器
MySQL MTOP提供一个基于 Web 的界面,可令您全面深入地了解数据库性能、可用性、关键活动等;直观地查看一台服务器、自定义的应用组或所有服务器。一组丰富的实时图形和历史图形将帮助您深入了解详细的服务器统计信息。

6.可视化MySQL慢查询分析
监视实时查询性能,查看执行统计信息,筛选和定位导致性能下降的 SQL 代码。结合使用 Information Schema 可直接从 MySQL 服务器收集数据,无需额外的软件或配置。

7.性能监视
监视影响 MySQL 性能的主要指标。如查询缓存命中率,Key_buffer_read_hits,Key_buffer_write_hits,Thread_cache_hits,Key_blocks_used_rate,Created_tmp_disk_tables_rate等信息,根据相关性能指标可以对服务器核心参数进行调整优化。

mtop

12/19/13

mediumint(8)超范围问题

function database_alter_table($source,$target){
                $source_table_list = $this->show_tables($source['database'],$this->source_connect);
                foreach($source_table_list as $table){
                        $fields = mysql_list_fields($source['database'],$table,$this->source_connect);
                        $fileds_num = mysql_num_fields($fields);

                        #echo "table: ".$table." fields_num:".$fileds_num."\n";
                        for($i=0;$i<$fileds_num;$i++){
                                $type  = mysql_field_type($fields,$i);
                                $name  = mysql_field_name($fields,$i);
                                $len   = mysql_field_len($fields, $i);
                                $flags = mysql_field_flags($fields,$i);

                                if(strtolower($type) == "int" && $len<=8 && $len>1){
                                        echo $type." ".$name." ".$len." ".$flags."\n";
                                        if(preg_match("/auto_increment/i",strtolower($flags))){
                                                $alter_sql = "ALTER TABLE `$table` CHANGE `$name` `$name` INT( 11 ) NOT NULL AUTO_INCREMENT";
                                        }else{
                                                if(!preg_match("/unsigned/i",strtolower($flags)) \
                                                   && !preg_match("/auto_increment/i",strtolower($flags))){
                                                    $alter_sql = "ALTER TABLE `$table` CHANGE `$name` `$name` INT( 11 ) NOT NULL";
                                                }else{
                                                    $alter_sql = "ALTER TABLE `$table` CHANGE `$name` `$name` INT( 11 ) UNSIGNED DEFAULT '0'";
                                                }                                                
                                        }
                                        echo $alter_sql."\n";
                                        $result = $this->query($alter_sql,$this->source_connect);
                                }
                        }
                }
        }
12/12/13

php kill掉超过max_sleep_time秒select like 的sql线程

<?php
define('MAX_SLEEP_TIME', 30);

$hostname = "127.0.0.1";
$username = "monitor";
$password = "123456";

$connect = mysql_connect($hostname, $username, $password) 
              or die(mysql_error());
$result = mysql_query("SHOW FULL PROCESSLIST", $connect)
              or die(mysql_error());
echo "\n开始时间:".date("Y-m-d H:i:s")."\n";
while ($proc = mysql_fetch_assoc($result)) {
        if ($proc["Command"] == "Sleep" && \
                  $proc["Time"] > MAX_SLEEP_TIME) {
                if($proc['State'] == 'Locked' || \
                 preg_match("/(.*)select(.*)like(.*)/i",$proc['Info'])){               
                        var_dump($proc);
                        @mysql_query("KILL " . $proc["Id"], $connect);
                }
        }
}
mysql_close($connect);
echo "\n结束时间:".date("Y-m-d H:i:s")."\n";
?>
09/24/13

php划分IP段

ip.txt

114.216.0.0 – 114.223.255.255
114.224.0.0 – 114.239.255.255
117.60.0.0 – 117.63.255.255
117.80.0.0 – 117.95.255.255
121.224.0.0 – 121.239.255.255
180.96.0.0 – 180.127.255.255
202.102.0.0 – 202.102.127.255
202.111.0.0 – 202.111.127.255
218.2.0.0 – 218.4.255.255
218.30.129.0 – 218.30.129.255
218.90.0.0 – 218.94.255.255
221.224.0.0 – 221.231.255.255
222.184.0.0 – 222.191.255.255
222.92.0.0 – 222.95.255.255
49.64.0.0 – 49.95.255.255
58.208.0.0 – 58.223.255.255
61.132.0.0 – 61.132.127.255
61.147.0.0 – 61.147.255.255
61.155.0.0 – 61.155.255.255
61.160.0.0 – 61.160.255.255
61.177.0.0 – 61.177.255.255

php code:

<?php
$file_lines = file(‘ip.txt’);
foreach($file_lines as $line){
$arr = explode(“-”,$line);
foreach($arr as $key=>$ip){
$real_ip = preg_replace(“/\s/”,””,$ip);
$arr[$key] = explode(“.”,$real_ip);
}
if(count($arr) == 2){
$interset_arr = array_intersect_assoc($arr[0],$arr[1]);
if(count($interset_arr)==2){
if(intval($arr[1][2]) == 255){
echo $interset_arr[0].”.”.$interset_arr[1].”.0.0/16\n”;
}else{
for($j=$arr[0][2]+1;$j<=$arr[1][2];$j++){
echo $interset_arr[0].”.”.$interset_arr[1].”.{$j}.0/24\n”;
}
}
}elseif(count($interset_arr)==3){
echo $interset_arr[0].”.”.$interset_arr[1].”.”.$interset_arr[2].”.0/24\n”;
}elseif(count($interset_arr)==1){
for($i=$arr[0][1];$i<=$arr[1][1];$i++){
echo $interset_arr[0].”.{$i}.0.0/16\n”;
}
}
}
}
?>

 

09/24/13

gearmand php Worker & Client

Worker.php
<?php
$worker= new GearmanWorker();
$worker->addServer();
$worker->addFunction(“sendMsn”, “sendMSN_function”);
while ($worker->work());

function sendMSN_function($job)
{
$subject = ucwords(strtolower($job->workload()));
exec(“echo $subject >>/opt/phpdba/www/html/cacti/plugins/thold/alter.log”);
exec(“sh /opt/phpdba/sendMsg/sendMsg.sh >>/opt/sendMsg/sendmsg.log 2>&1″);
return ;
}
?>

Client.php

<?php
$client= new GearmanClient();
$client->addServer();
$client->do(“sendMsn”, $subject);
?>

 

09/15/13

PHP获取照片的exif信息

 

<?php

/**

* 获取图象信息的函数

*

* 一个全面获取图象信息的函数

*

* @access public

* @param string $img 图片路径

* @return array

*/

function GetImageInfoVal($ImageInfo,$val_arr) {

$InfoVal = “未知”;

foreach($val_arr as $name=>$val) {

if ($name==$ImageInfo) {

$InfoVal = &$val;

break;

}

}

return $InfoVal;

}

function GetImageInfo($img) {

$imgtype = array(“”, “GIF”, “JPG”, “PNG”, “SWF”, “PSD”, “BMP”, “TIFF(intel byte order)”, “TIFF(motorola byte order)”, “JPC”, “JP2″, “JPX”, “JB2″, “SWC”, “IFF”, “WBMP”, “XBM”);

$Orientation = array(“”, “top left side”, “top right side”, “bottom right side”, “bottom left side”, “left side top”, “right side top”, “right side bottom”, “left side bottom”);

$ResolutionUnit = array(“”, “”, “英寸”, “厘米”);

$YCbCrPositioning = array(“”, “the center of pixel array”, “the datum point”);

$ExposureProgram = array(“未定义”, “手动”, “标准程序”, “光圈先决”, “快门先决”, “景深先决”, “运动模式”, “肖像模式”, “风景模式”);

$MeteringMode_arr = array(

“0″ => “未知”,

“1″ => “平均”,

“2″ => “中央重点平均测光”,

“3″ => “点测”,

“4″ => “分区”,

“5″ => “评估”,

“6″ => “局部”,

“255″ => “其他”

);

$Lightsource_arr = array(

“0″ => “未知”,

“1″ => “日光”,

“2″ => “荧光灯”,

“3″ => “钨丝灯”,

“10″ => “闪光灯”,

“17″ => “标准灯光A”,

“18″ => “标准灯光B”,

“19″ => “标准灯光C”,

“20″ => “D55″,

“21″ => “D65″,

“22″ => “D75″,

“255″ => “其他”

);

$Flash_arr = array(

“0″ => “flash did not fire”,

“1″ => “flash fired”,

“5″ => “flash fired but strobe return light not detected”,

“7″ => “flash fired and strobe return light detected”,

);

 

$exif = exif_read_data ($img,”IFD0″);

if ($exif===false) {

$new_img_info = array (“文件信息” => “没有图片EXIF信息”);

}

else

{

$exif = exif_read_data ($img,0,true);

$new_img_info = array (

“文件信息” => “—————————–”,

“文件名” => $exif['FILE']['FileName'],

“文件类型” => $imgtype[$exif['FILE']['FileType']],

“文件格式” => $exif['FILE']['MimeType'],

“文件大小” => $exif['FILE']['FileSize'],

“时间戳” => date(“Y-m-d H:i:s”,$exif['FILE']['FileDateTime']),

“图像信息” => “—————————–”,

“图片说明” => $exif['IFD0']['ImageDescription'],

“制造商” => $exif['IFD0']['Make'],

“型号” => $exif['IFD0']['Model'],

“方向” => $Orientation[$exif['IFD0']['Orientation']],

“水平分辨率” => $exif['IFD0']['XResolution'].$ResolutionUnit[$exif['IFD0']['ResolutionUnit']],

“垂直分辨率” => $exif['IFD0']['YResolution'].$ResolutionUnit[$exif['IFD0']['ResolutionUnit']],

“创建软件” => $exif['IFD0']['Software'],

“修改时间” => $exif['IFD0']['DateTime'],

“作者” => $exif['IFD0']['Artist'],

“YCbCr位置控制” => $YCbCrPositioning[$exif['IFD0']['YCbCrPositioning']],

“版权” => $exif['IFD0']['Copyright'],

“摄影版权” => $exif['COMPUTED']['Copyright.Photographer'],

“编辑版权” => $exif['COMPUTED']['Copyright.Editor'],

“拍摄信息” => “—————————–”,

“Exif版本” => $exif['EXIF']['ExifVersion'],

“FlashPix版本” => “Ver. “.number_format($exif['EXIF']['FlashPixVersion']/100,2),

“拍摄时间” => $exif['EXIF']['DateTimeOriginal'],

“数字化时间” => $exif['EXIF']['DateTimeDigitized'],

“拍摄分辨率高” => $exif['COMPUTED']['Height'],

“拍摄分辨率宽” => $exif['COMPUTED']['Width'],

/*

The actual aperture value of lens when the image was taken.

Unit is APEX.

To convert this value to ordinary F-number(F-stop),

calculate this value’s power of root 2 (=1.4142).

For example, if the ApertureValue is ’5′, F-number is pow(1.41425,5) = F5.6.

*/

“光圈” => $exif['EXIF']['ApertureValue'],

“快门速度” => $exif['EXIF']['ShutterSpeedValue'],

“快门光圈” => $exif['COMPUTED']['ApertureFNumber'],

“最大光圈值” => “F”.$exif['EXIF']['MaxApertureValue'],

“曝光时间” => $exif['EXIF']['ExposureTime'],

“F-Number” => $exif['EXIF']['FNumber'],

“测光模式” => GetImageInfoVal($exif['EXIF']['MeteringMode'],$MeteringMode_arr),

“光源” => GetImageInfoVal($exif['EXIF']['LightSource'], $Lightsource_arr),

“闪光灯” => GetImageInfoVal($exif['EXIF']['Flash'], $Flash_arr),

“曝光模式” => ($exif['EXIF']['ExposureMode']==1?”手动”:”自动”),

“白平衡” => ($exif['EXIF']['WhiteBalance']==1?”手动”:”自动”),

“曝光程序” => $ExposureProgram[$exif['EXIF']['ExposureProgram']],

/*

Brightness of taken subject, unit is APEX. To calculate Exposure(Ev) from BrigtnessValue(Bv), you must add SensitivityValue(Sv).

Ev=Bv+Sv Sv=log((ISOSpeedRating/3.125),2)

ISO100:Sv=5, ISO200:Sv=6, ISO400:Sv=7, ISO125:Sv=5.32.

*/

“曝光补偿” => $exif['EXIF']['ExposureBiasValue'].”EV”,

“ISO感光度” => $exif['EXIF']['ISOSpeedRatings'],

“分量配置” => (bin2hex($exif['EXIF']['ComponentsConfiguration'])==”01020300″?”YCbCr”:”RGB”),//’0×04,0×05,0×06,0×00′=”RGB” ’0×01,0×02,0×03,0×00′=”YCbCr”

“图像压缩率” => $exif['EXIF']['CompressedBitsPerPixel'].”Bits/Pixel”,

“对焦距离” => $exif['COMPUTED']['FocusDistance'].”m”,

“焦距” => $exif['EXIF']['FocalLength'].”mm”,

“等价35mm焦距” => $exif['EXIF']['FocalLengthIn35mmFilm'].”mm”,

/*

Stores user comment. This tag allows to use two-byte character code or unicode. First 8 bytes describe the character code. ‘JIS’ is a Japanese character code (known as Kanji).

’0×41,0×53,0×43,0×49,0×49,0×00,0×00,0×00′:ASCII

’0x4a,0×49,0×53,0×00,0×00,0×00,0×00,0×00′:JIS

’0×55,0x4e,0×49,0×43,0x4f,0×44,0×45,0×00′:Unicode

’0×00,0×00,0×00,0×00,0×00,0×00,0×00,0×00′:Undefined

*/

“用户注释编码” => $exif['COMPUTED']['UserCommentEncoding'],

“用户注释” => $exif['COMPUTED']['UserComment'],

“色彩空间” => ($exif['EXIF']['ColorSpace']==1?”sRGB”:”Uncalibrated”),

“Exif图像宽度” => $exif['EXIF']['ExifImageLength'],

“Exif图像高度” => $exif['EXIF']['ExifImageWidth'],

“文件来源” => (bin2hex($exif['EXIF']['FileSource'])==0×03?”digital still camera”:”unknown”),

“场景类型” => (bin2hex($exif['EXIF']['SceneType'])==0×01?”A directly photographed image”:”unknown”),

“缩略图文件格式” => $exif['COMPUTED']['Thumbnail.FileType'],

“缩略图Mime格式” => $exif['COMPUTED']['Thumbnail.MimeType']

);

}

return $new_img_info;

}

 

//print_r(exif_read_data ($_GET['img'],0,true));

//exit;

$exif = GetImageInfo($_GET['img']);

 

print_r($exif);

?>