• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Resolved Problems loading Composer autoload.php

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?
 
I got this to work by running Composer from my project directory. It places the files in the location from which you invoke it.
 
Back
Top