QuickAnswer
by

Execute php with Plesk php exec, using Imagick

Execute php with Plesk php exec, using Imagick

CentOS Plesk php7.3
When executing php from php exec, the php version being executed was the system default.

The first description

exec('php ' . getcwd() . '/example.php');

In example.php, use Imagick.
It worked in the local environment (XAMPP), but not in the web server Plesk environment.

Check the php execution version

exec('php -v', $ret);
print $ret;

The php execution version was the default value for the system. Ver.5.x

Specify php ver.7.3

exec('/opt/plesk/php/7.3/bin/php -v', $ret);
print $ret;

Check the desired version.

Conclusion

exec('/opt/plesk/php/7.3/bin/php ' . getcwd() . '/example.php');
CONTENTS
Web Browser