私は次のフォルダ構造を持っています。PHPは必要なファイルを正しく追加します
のconfig.php
<?php
class config {
const server = "localhost";
}
conn.php
<?php
require_once './config.php';
firstExample.php
私はconn.php
を実行したとき、私はエラー以下しまっ
firstExample.php
を実行する場合
<?php
require_once './db/conn.php';
にはerrors.butありません
Warning: require_once(./config.php): failed to open stream: No such file or directory in C:\wamp\www\testX\db\conn.php on line 2
私がやるいくつかのテストと
require_once './db/config.php';
に
conn.php
を変更することでエラーを修正することができ
私の質問conn.php
を追加する必要があります。上記のように変更すると、上記の変更後に私は同じエラーが発生しているconn.php
を実行した場合、例えば上記のように変更します。
私が知りたいのは、ファイルにconn.php
を追加すると、files.soを追加する正しい方法です。
あなたの答えは、説明と一緒に、ここにあります:http://stackoverflow.com/questions/36577020/failed-to-open-stream- no-such-file-or-directory –