Windows系统怎么安装php-zbarcode扩展
2个回答
2017-08-08
展开全部
写之前先鄙视下利用此开源程序收费的人。
PHP-zbarcode是php识别二维码的扩展。
下面是安装方法,安装前要先安装ImageMagick、zbar.
php-zbarcode 下载地址
安装ImageMagick:
yum install ImageMagick.x86_64 ImageMagick-devel.x86_64
wget http://jaist.dl.sourceforge.NET/project/zbar/zbar/0.10/zbar-0.10.tar.bz2
tar jxvf zbar-0.10.tar.bz2
cd zbar-0.10
./configure –without-gtk –without-qt –without-Python –prefix=/usr/local/zbar
make all
make install
echo “/usr/local/zbar/lib/” >> /etc/ld.so.conf
ldconfig
ln -s /usr/local/zbar/lib/pkgconfig/zbar.pc /usr/lib64/pkgconfig/zbar.pc
wget https://github.com/lgchgt/php-zbarcode/archive/master.zip
unzip master
cd php-zbarcode-master
/xxx/server/php/bin/phpze
/configure –with-php-config=/xxx/server/php/bin/php-config
make
make install
ll /xxx/server/php/lib/php/extensions/no-debug-non-zts-20100525/
添加:extension=zbarcode.so 到php.ini配置文件
运行 : php -i|grep zbar
检查是否安装功能
<?php
/* Create new image object */
$image = new ZBarCodeImage(“1.jpg”);
$scanner = new ZBarCodeScanner();
$barcode = $scanner->scan($image);
print_r($barcode);
/* Loop through possible barcodes */
if (!empty($barcode)) {
foreach ($barcode as $code) {
printf(“Found type %s barcode with data %s\n”, $code[‘type’], $code[‘data’]);
}
}
?>
最后验证结果即可;
PHP-zbarcode是php识别二维码的扩展。
下面是安装方法,安装前要先安装ImageMagick、zbar.
php-zbarcode 下载地址
安装ImageMagick:
yum install ImageMagick.x86_64 ImageMagick-devel.x86_64
wget http://jaist.dl.sourceforge.NET/project/zbar/zbar/0.10/zbar-0.10.tar.bz2
tar jxvf zbar-0.10.tar.bz2
cd zbar-0.10
./configure –without-gtk –without-qt –without-Python –prefix=/usr/local/zbar
make all
make install
echo “/usr/local/zbar/lib/” >> /etc/ld.so.conf
ldconfig
ln -s /usr/local/zbar/lib/pkgconfig/zbar.pc /usr/lib64/pkgconfig/zbar.pc
wget https://github.com/lgchgt/php-zbarcode/archive/master.zip
unzip master
cd php-zbarcode-master
/xxx/server/php/bin/phpze
/configure –with-php-config=/xxx/server/php/bin/php-config
make
make install
ll /xxx/server/php/lib/php/extensions/no-debug-non-zts-20100525/
添加:extension=zbarcode.so 到php.ini配置文件
运行 : php -i|grep zbar
检查是否安装功能
<?php
/* Create new image object */
$image = new ZBarCodeImage(“1.jpg”);
$scanner = new ZBarCodeScanner();
$barcode = $scanner->scan($image);
print_r($barcode);
/* Loop through possible barcodes */
if (!empty($barcode)) {
foreach ($barcode as $code) {
printf(“Found type %s barcode with data %s\n”, $code[‘type’], $code[‘data’]);
}
}
?>
最后验证结果即可;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |