我有一个错误,我认为它与public_html文件的目录有关,但我不确定。

错误:

Warning: require(__DIR__/protected/bootstrap/autoload.php) [function.require]: failed to open stream: No such file or directory in /home4/nameguy/public_html/index.php on line 21

Warning: require(__DIR__/protected/bootstrap/autoload.php) [function.require]: failed to open stream: No such file or directory in /home4/nameguy/public_html/index.php on line 21

Fatal error: require() [function.require]: Failed opening required '__DIR__/protected/bootstrap/autoload.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home4/nameguy/public_html/index.php on line 21

Index.php代码:

<?php
require __DIR__.'/protected/bootstrap/autoload.php';

$app = require_once __DIR__.'/protected/bootstrap/start.php';

$app->run();

$app->shutdown();

===============>>#1 票数:2

__DIR__仅自PHP 5.3起定义,因此也许您有较旧的版本。 您可以改用__FILE__

<?php
require dirname(__FILE__).'/protected/bootstrap/autoload.php';

$app = require_once dirname(__FILE__).'/protected/bootstrap/start.php';

  ask by user3555497 translate from so

未解决问题?本站智能推荐: