PHPBuilder - ImageMagick & safe_mode



RSS Twitter
Tips Php Functions

ImageMagick & safe_mode

by: Tuin
|
September 23, 2002

Well last week I had this problem resizing images with my Administration system 'cause my "server provider" refused to install gd2 and safe_mode = on.

They did want to install ImageMagick so I looked @ perl but I found the following solution for PHP.

Go to you php.ini and activate :

safe_mode_exec_dir = /some/path/to/dir

After setting up the directory take the following step :

cp /usr/local/bin/mogrify /some/path/to/dir

Set the User and Group to the "webuser" and do "chmod -R 711 /some/path/to/dir" to protect it from users who are not allowed to know ;) .

Done this ? Then you can use the following line (well at least I did :)) :

<?
system("mogrify -resize ".$w."x".$h." ".$the_file." ");
?>

This should do it or just get you started !

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Tuin

Comment:



Comment:

(Maximum characters: 1200). You have characters left.