この問題に密接に関連するいくつかの答えを見つけましたが、それでも解決できません。インクルードパスに問題があると言われていると思いますが、見つけたすべての解決策を試しましたが、役に立ちませんでした。
エラーは次のとおりです。
Fatal error: Class 'Zend_Controller_Action' not found in /Users/*me*/Sites/*site*/application/controllers/IndexController.php on line 3
includeステートメントは次のとおりです。
$newIncludePath = array();
$newIncludePath[] = '.';
$newIncludePath[] = 'include';
$newIncludePath[] = get_include_path();
$newIncludePath[] = '../library';
$newIncludePath[] = '../application/classes/';
$newIncludePath[] = '../application/models/';
$newIncludePath[] = '../application/models/';
$newIncludePath[] = '../application/controllers';
$newIncludePath = implode(PATH_SEPARATOR, $newIncludePath);
set_include_path($newIncludePath);
require_once 'Zend/Controller/Front.php';
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
私は何時間もフォーラムを精査してキーボードに頭をぶつけてきました。私はzendとphpを初めて使用します。このようなものは私に王室の頭痛の種を与えました。パスにコントローラーを明示的に追加しました。何を見落としているのかわかりません。
ところで、私とサイトはプライバシー上の理由から編集された名前です。
私は解決に永遠に感謝しています。
mjs-編集:
インクルードが少し不安定であることに気づきました。だからここにやり直しがあります:
$newIncludePath = array();
$newIncludePath[] = '.';
$newIncludePath[] = get_include_path();
$newIncludePath[] = '../library';
$newIncludePath[] = '../application/classes/';
$newIncludePath[] = '../application/models/';
$newIncludePath[] = '../application/library/';
$newIncludePath = implode(PATH_SEPARATOR, $newIncludePath);
set_include_path($newIncludePath);
var_dumpの出力:
string(148) "../application/controllers:.:.:/Applications/MAMP/bin/php5/lib/php:../library:../application/classes/:../application/models/:../application/library/"
Zend / Controller/Actionが../libraryの下にあることに気づきました。だから、なぜアプリがそれを見つけられないのか分かりません。
PHPDebugからIndexControllerを実行すると、
string(170) ".:/Users/me/Sites/site:/Applications/Zend/Zend Studio - 7.1.0/plugins/org.zend.php.framework.resource_7.1.0.v20091101-1523/resources/ZendFramework-1/library/"
Fatal error: Class 'Zend_Controller_Action' not found in /Users/me/Sites/site/application/controllers/IndexController.php on line 5