Warning: include(**.php) [function.include]: failed to open stream: No such file

エラーメッセージWarning

 状態:-  閲覧数:10,538  投稿日:2010-05-03  更新日:2013-03-07  
Warning: include(**.php) [function.include]: failed to open stream: No such file or directory in ○○ on line △△

○○ファイルの△△行目付近(以前)に記載されているinclude(**.php) について、そのようなファイルまたはディレクトリがないため、読込に失敗した、という警告

▼1.「エラーレベル」
警告

▼2.「メッセージ」
include指定されているファイルがないため、読込に失敗した

▼3. 「ファイルのパスと行番号」
○○ ファイル △△ 行目 - includeファイル指定

▼想定原因(a)
▽読込先ファイルとして、存在していないファイル名を指定

   $path = ".:".$_SERVER["DOCUMENT_ROOT]."/_incs_";//①インクルードパスを「".:".$_SERVER["DOCUMENT_ROOT]."/_incs_"」に設定。「$_SERVER["DOCUMENT_ROOT]」は「ドキュメントルート」のパスが格納されているスーパーグローバル変数。ドキュメントルートとは、例えばドメイン名が「php.w4c.work」であった場合、このアドレスにアクセスした時に表示されるページ(ファイル)が格納されているディレクトリのこと。「php.w4c.work/php」にアクセスして表示されるページは、ドキュメントルート内にある「php」というディレクトリ内にあるファイル。「.」と「$_SERVER["DOCUMENT_ROOT]."/_incs_"」の2つを設定。1つ目は“同じディレクトリ内の”という意味、2つ目はドキュメントルートディレクトリ内の「_incs_」ディレクトリという意味
   
   echo set_include_path($path), "
";//②インクルードパス設定
   echo get_include_path();//③インクルードパス取得
   
   echo "
";
   
   include "air1.php";//④air1.php」ファイルの読み込みを行なう。読込ファイル指定が、インクルードパスを使用する指定方法のため、設定したインクルードパスからの読み込みを行なう。まず、このサンプルファイルと同じディレクトリ内を探し、ない場合に「ドキュメントルートディレクトリ /_incs_」ディレクトリを探す。読込指定については、htmlファイルでも可


▼対処法(a)
▽読込先ファイルとして、正しいファイル名を指定

   $path = ".:".$_SERVER["DOCUMENT_ROOT]."/_incs_";//①インクルードパスを「".:".$_SERVER["DOCUMENT_ROOT]."/_incs_"」に設定。「$_SERVER["DOCUMENT_ROOT]」は「ドキュメントルート」のパスが格納されているスーパーグローバル変数。ドキュメントルートとは、例えばドメイン名が「php.w4c.work」であった場合、このアドレスにアクセスした時に表示されるページ(ファイル)が格納されているディレクトリのこと。「php.w4c.work/php」にアクセスして表示されるページは、ドキュメントルート内にある「php」というディレクトリ内にあるファイル。「.」と「$_SERVER["DOCUMENT_ROOT]."/_incs_"」の2つを設定。1つ目は“同じディレクトリ内の”という意味、2つ目はドキュメントルートディレクトリ内の「_incs_」ディレクトリという意味
   
   echo set_include_path($path), "
";//②インクルードパス設定
   echo get_include_path();//③インクルードパス取得
   
   echo "
";
   
   include "for.php";//④for.php」ファイルの読み込みを行なう。読込ファイル指定が、インクルードパスを使用する指定方法のため、設定したインクルードパスからの読み込みを行なう。まず、このサンプルファイルと同じディレクトリ内を探し、ない場合に「ドキュメントルートディレクトリ /_incs_」ディレクトリを探す。読込指定については、htmlファイルでも可



Warning: Missing argument 1 for **(), called in ○○ on line △△ and defined in □□

Warning: include() [function.include]: Failed opening '**.php' for inclusion (in

コメント投稿(ログインが必要)



類似度ページランキング
順位 ページタイトル抜粋
1 Warning: include(**.php) [function.include]: failed to open stream: No such file 34
2 ( ! ) Warning: Declaration of xxxx should be compatible with 31
3 Warning: include() [function.include]: Failed opening '**.php' for inclusion (in 31
4 SHA-1(Secure Hash Algorithm 1) 29
5 Warning: array_rand() [function.array-rand]: Second argument has to be between 1 29
6 Fatal error: Wrong parameters for Exception([string $exception [, long $code ]]) 28
7 ( ! ) Warning: file_put_contents(/a/b.jpg): failed to open stream: No such file or directory in 27
8 Fatal error: Call to undefined function **() 27
9 Maximum function nesting level of '256' reached 27
10 Fatal error: Uncaught Error: Call to undefined function bcsub() 27
11 Fatal error: require_once(): Failed opening required 'PEAR.php' 26
12 Warning: Missing argument 1 for **(), called in ○○ on line △△ and defined in □□ 26
13 Fatal error: Uncaught Error: Call to a member function modify() on string 26
14 Fatal error: require_once(): Failed opening required 'XML/RSS.php' 26
15 Warning: Unexpected character in input: '\' (ASCII=92) state=1 in ○○.php on line △△ 26
16 Parse error: syntax error, unexpected 'new' (T_NEW) 26
17 session.gc_maxlifetime 25
18 Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Connection refused 25
19 Strict Standards: DateTime::__construct() [function.DateTime---construct]: It is 25
20 Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting 25
2026/7/21 16:32 更新
週間人気ページランキング / 7-14 → 7-20
順位 ページタイトル抜粋 アクセス数
1 PHP用語 10
2 コンストラクタ デストラクタ | クラスとオブジェクト 4
3 ログイン 3
4 型キャスト | 型 2
4 セッション名 | セッション 2
4 エラーレベル一覧(error_reportingの設定) 2
4 カテゴリ一覧 2
4 ゲストコメント一覧ページ 2
4 Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 23 Out of resources when opening file '/tmp/#sql_2dd6_0.MYI' (Errcode: 24)' | エラーメッセージ 2
4 実際に遭遇した例 2
4 session.entropy_fileデフォルト設定値 2
4 デリミタ 2
4 PHPで定数を定義する方法は2種類ある / 配列定数の定義 2
4 Parse error: syntax error, unexpected $end in ○○.php on line △△ | Parse error(エラーメッセージ) 2
4 PHPでcurlを使用するためには?/ 2.オプション設定 / curlでPOST送信 2
4 You currently have Essential access which includes access to Twitter API v2 endpoints only. If you need access to this endpoint, you’ll need to apply for Elevated access via the Developer Portal. | Twitter API(エラーメッセージ) 2
4 htmlspecialchars / htmlentities / addslashes / mysql_real_escape_string / mysqli_real_escape_string | セキュリティ 2
4 デフォルト引数 | 関数 2
4 Fatal error: Uncaught Error: Class 'Mecab_Tagger' not found in /var/www/★★.php:☆☆ | Fatal error(エラーメッセージ) 2
4 遭遇例1.存在する間違ったデータベース名を指定 2
2026/7/21 5:05 更新