cloudNiner
New Pleskian
- Server operating system version
- Ubuntu 22.04
- Plesk version and microupdate number
- 18.0.63 #4
I have migrated my site from a shared server to a Plesk-managed VPS and am trying to get my php scripts using PHPMailer to work. I installed PHPMailer using Composer from a shell, following articles on how to use it with Plesk. My problem is getting the Composer-generated autoload to work:
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require '/root/vendor/autoload.php';
Composer installed autoload in /root/vendor, which might be the problem. Should it go elsewhere? After turning off open_basedir and adding /root/vendor to the include path, I get this in error_log:
PHP Warning: require(/root/vendor/autoload.php): Failed to open stream: Permission denied in /var/www/vhosts/photomungus.com/httpdocs/registrationForm.php on line 15; PHP message: PHP Fatal error: Uncaught Error: Failed opening required '/root/vendor/autoload.php' (include_path='.:/opt/plesk/php/8.3/share/pear; /root/vendor') .
What is the right way to do it?
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require '/root/vendor/autoload.php';
Composer installed autoload in /root/vendor, which might be the problem. Should it go elsewhere? After turning off open_basedir and adding /root/vendor to the include path, I get this in error_log:
PHP Warning: require(/root/vendor/autoload.php): Failed to open stream: Permission denied in /var/www/vhosts/photomungus.com/httpdocs/registrationForm.php on line 15; PHP message: PHP Fatal error: Uncaught Error: Failed opening required '/root/vendor/autoload.php' (include_path='.:/opt/plesk/php/8.3/share/pear; /root/vendor') .
What is the right way to do it?