Welcome Guest, Not a member yet? Register   Sign In
No such file, but it is clearly there
#1

(This post was last modified: 09-10-2018, 05:55 PM by richb201.)

I have this line near the top of on of my modules:

require_once ($_SERVER['DOCUMENT_ROOT'].'/application/third_party/phpmailer/src/PHPMailer.php');

but it causes this warning:

Message: require_once(/opt/bitnami/apache2/htdocs/application/third_party/phpmailer/src/PHPMailer.php): failed to open stream: No such file or directory

In the attached screen shot you can see the permissions for PHPMailer.php, I tried changing it to 777 with this:
 sudo chmod 777 /opt/bitnami/apache2/htdocs/sub_crud/application/third_party/phpmailer/src/PHPMailer.php

But my code (which worked fine in Windows) keeps failing on that require_once. Is their a limitation to how long a pathname can be in CI? What is wrong with it?  Huh


Attached Files Thumbnail(s)
   
proof that an old dog can learn new tricks
Reply
#2

(This post was last modified: 09-10-2018, 06:29 PM by ciadmin.)

Being picky, the PHPMailer.php is clearly somewhere, but you don't show the folder name.

The big clue that I see is that you require
"/opt/bitnami/apache2/htdocs/application/third_party/phpmailer/src/PHPMailer.php",
but you chmod'd
"/opt/bitnami/apache2/htdocs/sub_crud/application/third_party/phpmailer/src/PHPMailer.php".

Do you spot the difference between them? I even indented the above to make it easier to see :-O
Could your DOCUMENT_ROOT be set wrong?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB