0

我在一个简单的include方法上得到了这个错误:

Warning:  include(/home/content/70/8352870/html/sites/mysite.com/preview/wp-content/themes/site-theme/mail/class.phpmailer.php)
[<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /home/content/70/8352870/html/sites/mysite.com/preview/wp-content/themes/site-theme/mail/send-message.php on line 5

我已经使用这个包含了文件:

<?php
    $path = getcwd();
    include $path.'/class.phpmailer.php';
?>

我在不使用方法的情况下得到了同样的错误,getcwd但是这个:

include 'class.phpmailer.php';

Warning:  include(class.phpmailer.php)
[<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in /home/content/70/8352870/html/sites/mysite.com/preview/wp-content/themes/site-theme/mail/send-message.php on line 10

Obiouvsly 我检查了文件位于此处:

mysite.com/preview/wp-content/themes/site-theme/mail/
class.phpmailer.php
class.pop3.php
class.smtp.php
send-message.php

我做错了什么?

4

1 回答 1

0

这与您尝试获得的行为相同,但更受信任:

(我想 class.phpmailer 与包含它的脚本在同一路径上)

<?php
$path = dirname( __FILE__ );
include $path.'/class.phpmailer.php';
?>
于 2012-07-25T14:42:17.533 回答