Try to search your question here, if you can't find : Ask Any Question Now ?

Absolute Path Error in "Cloudways" Hosting with PHP

HomeCategory: stackoverflowAbsolute Path Error in "Cloudways" Hosting with PHP
Avatarbhawya asked 5 months ago

I am using PHPmailer for sending email in PHP. It is working fine on localhost but it gives me an error of absolute path in cloudways hosting server.

My directory structure.

-home

  • public_html

    • Phpmailer

    • sendmail.php

My code for requiring phpmailer is.

require_once dirname(__FILE__).'/PHPMailer-master/src/phpmailer.php

I also tried another approach-

require_once '/home/xxxxxxx/public_html/phpmailer/PHPMailer-master/src/phpmailer.php

The exact error is-

Warning: require_once(/home/152903.cloudwaysapps.com/xxxxxxx/public_html/phpmailer/PHPMailer-master/src/phpMailer.php): failed to open stream: No such file or directory in /home/152903.cloudwaysapps.com/kjmwdjvxpz/public_html/check2.php on line 5

Fatal error: require_once(): Failed opening required '/home/152903.cloudwaysapps.com/kjmwdjvxpz/public_html/phpmailer/PHPMailer-master/src/phpMailer.php' (include_path='.:/usr/share/php') in /home/152903.cloudwaysapps.com/kjmwdjvxpz/public_html/check2.php on line 5

But it does not work. Can someone sort out this problem?

1 Answers
Best Answer
AvatarArben answered 5 months ago
Your Answer

0 + 11 =

Popular Tags

WP Facebook Auto Publish Powered By : XYZScripts.com