[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How do I install PHPMailer on a Debian/Bullseye Apache2 server



I'm using a web hosting company that pretty much limits me to using PHPMailer on their servers for sending complex e-mails (e.g. with attachments). That is working.

To get it to work, I used the zip archive from the PHPMailer's github page and unzipped it into the site's public directory - so that there is PHPMailer folder in the same folder that has the index.html file. I uploaded a test .php file and it sends mail.

However when I try it with my local Apache2 server, it doesn't work. I've got PHP working because I have another PHP script that executes perfectly. However the test .php file that works on the hosting company's server doesn't do anything on my local server. I try to load the page and get nothing - not even an error message.

I tried placing a copy of the PHPMailer files in the /usr/share/php folder and uncommented the include_path line in /etc/php/8.1/apache2php.ini file to ensure that the folder was in the path, but still no luck (various installation howtos say to make sure the PHPMailer folder is in the php include path).

Does anyone have any ideas on how I can get this to work? I know that PHPMailer at the best of times is very finicky (e.g. it creates the same problem (no output) if I have a space in the (optional) second argument for the ->setFrom or ->addAddress methods), but in this case, the file is identical between the hosting company's working example and my local test.

Nothing shows up in the various PHP logs nor in the syslog.

Thanks.


Reply to: