Page 1 of 1

Not sure what the problem is

Posted: Tue Jul 15, 2008 1:28 pm
by DenKain
Here is the output I receive from the screen when I go to my site:

Code: Select all

 
 
Warning: main(/swiftmailer/lib/Swift.php): failed to open stream: No such file or directory in /home/content/D/e/n/DenKain/html/surveyBoSSwift.php on line 7
 
Fatal error: main(): Failed opening required '/swiftmailer/lib/Swift.php' (include_path='.:/usr/local/lib/php') in /home/content/D/e/n/DenKain/html/surveyBoSSwift.php on line 7
 
Here is my php script:

NOTE: Both the attributes of /swiftmailer/lib/Swift.php and /swiftmailer/lib/Swift/Connection/SMTP.php have been set to 755.

Code: Select all

 
<html>
<body>
 
<?php
 
//Load in the files we'll need
require_once "/swiftmailer/lib/Swift.php";
require_once "/swiftmailer/lib/Swift/Connection/SMTP.php";
 
//Start Swift
$swift =& new Swift(new Swift_Connection_SMTP("smtp.mythicsoftware.com"));
 
//Create the message
$message =& new Swift_Message("My subject", "My body");
 
//Now check if Swift actually sends it
if ($swift->send($message, "admin@mythicsoftware.com", "test@mythicsoftware.com")) echo "Sent";
else echo "Failed";
 
?>
</body>
</html>
 

Re: Not sure what the problem is

Posted: Tue Jul 15, 2008 7:41 pm
by DenKain
Anyone have an idea?

Re: Not sure what the problem is

Posted: Tue Jul 15, 2008 7:58 pm
by zecster
are you 100% sure that file is there because i have only every got that php error when the file was not there.

Re: Not sure what the problem is

Posted: Tue Jul 15, 2008 9:25 pm
by DenKain
Positive.

Re: Not sure what the problem is

Posted: Thu Jul 17, 2008 12:32 pm
by DenKain
bump

Re: Not sure what the problem is

Posted: Thu Jul 17, 2008 9:43 pm
by Chris Corbyn
That path looks wrong to me. /swiftmailer refers to a folder called "swiftmailer" in the root directory of the server, not a folder called "swiftmailer" in the web root. Look at the path to your actual script:

/home/content/D/e/n/DenKain/html/surveyBoSSwift.php

Educated guesswork would have me believe the path to SwiftMailer should therefore be:

/home/content/D/e/n/DenKain/html/swiftmailer/lib/Swift.php

?

You can always tests the validity of a filesystem path by passing it through realpath().

Code: Select all

var_dump(realpath($yourPath));
 
/* If output looks like:
 
boolean FALSE
 
Then the path is WRONG.
 
If the output looks like
 
string (19) "/path/to/something/"
 
The the path is CORRECT
 
*/