0

Following Error occurred. How to resolve this?

You must set the policy of ImageMagick to allow PDF read. See override default ImageMagick policy.xml

ImagickException: Zero size image string passed in /home/289812.cloudwaysapps.com/eeyqmgqped/public_html/online/mod/securepdf/view.php:98 Stack trace: #0 /home/289812.cloudwaysapps.com/eeyqmgqped/public_html/online/mod/securepdf/view.php(98): Imagick->readImageBlob() #1 {main}

enter image description here

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

0

Have you edited the policy.xml to include reading permissions like the install process says?

  • Please note that you have to install a PHP module that is not needed by Moodle itself.
  • Install php-imagick module on your system.
  • (debian/ubuntu) apt-get install php-imagick
  • (Redhat/Centos) yum install php-imagick
  • Configure imagemagick to allow PDF reading, Add <policy domain="coder" rights="read" pattern="PDF"> to the policy at /etc/ImageMagick-6/policy.xml see more details here : override default ImageMagick policy.xml
  • Restart php-fpm or your web server.
  • cd [moodle]/mod/
  • git clone https://github.com/yedidiaklein/moodle-mod_securepdf.git securepdf
  • Go to your moodle Notification Page and install.

I have never used Cloudways but if it's a managed hosting and you don't have access via shell to the instance you're running on you'll likely have to ask them for a workaround.

Nelloverflow
  • 1,511
  • 1
  • 11
  • 15
  • Dear Nelloverflow, Kindly help me how to install Install php-imagick module on moodle. Already i installed the SecurePDF Module. So Kindly help me to install php-imagick module on moodle. Thank you, – Saravanan P Sep 18 '21 at 10:42
  • php-imagick isn't installed on moodle per se, but on the OS you're running. How did you install moodle exactly? – Nelloverflow Sep 18 '21 at 12:49
  • Upload a zip file backup & configure the config.php file with database name,username,password & dataroot and then simply run the url doamin.com/online/index.php. i had installed like this only. – Saravanan P Sep 19 '21 at 10:28