linux - pngquant doesn't work with php -
i have installed pngquant on mac , on linux running centos 7. on both machines can use command line, if won't work when same command run in php.
linux commands tried:
yum install pngquant says succesfully installed pngquant
which pngquant returns /usr/bin/pngquant
my php file code ptst.php:
<?php echo "start"; echo $get_compress = exec("find . -name '*.png' -exec /usr/bin/pngquant -ext .png -force 256 {} \;"); echo "end"; ?> i have 1 png file in current folder: image_5.png. has permissions: -rwxrwxrw-, , in same folder ptst.php
upon using ls -la can see file size hasn't changed. echoed outout startend.
if run same code in terminal, file size changes 1/3 of it's previous size.
what doing wrong? there issues don't know about.
edit: new command:
echo $get_compress = exec("find . -name '*.png' -exec /usr/bin/pngquant --ext .png --force 256 {} \; 2>&1", $output); print_r($output); output bit more illustrative;
'./image_5.png.tmp' writingarray ( [0] => error: cannot open './image_5.png.tmp' writing )
Comments
Post a Comment