php: read directory
2019-12-29
IN1, 2019-12-29 00:00:00
IN1, 2023-04-10 14:16:30


here are different ways to read a directory with php.

current level

using array_diff & scandir: read /var/www/Foo/ and ignore .dot files

$aContent = array_diff(scandir ('/var/www/Foo/'), array('..', '.', '.htaccess', '.htpasswd'));

using preg_grep & scandir: read /var/www/Foo/

$aContent = […]

xampp, php, imagemagick: resize on PNG fails
2019-11-28
IN1, 2019-11-28 00:00:00
IN1, 2023-04-14 14:50:57


Problem with XAMPP: php's shell_exec() executing imagemagick's /bin/convert command does not convert a PNG image. There is always a message saying a lib could not be found although library is there. No such problems with JPG images, only PNG.

This is a xampp related problem.

SOLUTION

as root:

cd /opt/lampp/lib; 
mv libz.so.1 libz.so.1.orig; 
ln -s /lib/x86_64-linux-gnu/libz.so.1 […]


This website uses Cookies to provide you with the best possible service. Please see our Privacy Policy for more information. Click the check box below to accept cookies. Then confirm with a click on "Save".