By drcmanansala
I’ve been trying to send an e-mail using PHPMailer but have been getting a “504 Gateway Time-out” error.
Did a bit of research and I think it’s because nginx is trying to use IPv6. I thought the solution was to try to make it use IPv4 was the solution.
Tried to do the following already:
echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv4
echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf
service nginx restart
Still getting the same issue and I can’t find anything else that I could try.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @drcmanansala,
It’s impossible to pinpoint the exact issue without checking the error logs of Nginx. The problem could be a million things from permissions,ownership to a problem with the Nginx configuration preventing to work with PHPMailer.
I’ll recommend before you make any changes whatsoever, to check the Nginx error log and see the exact error you are getting.
Regards, KDSys
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.