简体   繁体   English

无法在php中打开流

[英]failed to open stream in php

I get this error on a simple include method: 我在一个简单的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

I've included the file using this: 我使用了以下文件:

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

I get the same error without using getcwd method but this: 我在不使用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 I checked the files are located here: 我已检查文件位于以下位置:

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

What did I do wrong? 我做错了什么?

This has the same behavior that you are trying to get, but is more trusted: 这与您尝试获得的行为相同,但是更受信任:

(I suppose that class.phpmailer is on the same path the the script that is including it) (我想class.phpmailer与包含它的脚本在同一路径上)

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM