私は[スケルトンアプリケーション] [1]を実装するために以下のチュートリアルに従っています。Zend FrameWork 2アルバムチュートリアルエラー:404エラーが発生しましたページが見つかりません
私はコピー&ペーストチュートリアルで提供されるすべてのコードを持っていますが、私は以下のエラーが取得しています:
A 404 error occurred
Page not found.
The requested URL could not be matched by routing.
No Exception available
を私はクロスのStackOverflow内のすべての同様の問題をチェックして、それらのどれもがすることができませんでした私の問題を解決する。
これで私を助けることができますか?
以下のコード:
を見つけてくださいC:\wamp64\www\zend\module\Album\Module.php
<?php
namespace Album;
use Album\Model\AlbumTable;
class Module
{
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__ . '/autoload_classmap.php',
),
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
public function getServiceConfig()
{
return array(
'factories' => array(
'Album\Model\AlbumTable' => function($sm) {
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
$table = new AlbumTable($dbAdapter);
return $table;
},
),
);
}
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
}
C:\ wamp64 \ WWW \ Zendの\モジュール\アルバム\ CONFIG \ module.config.php
<?php
return array(
'controllers' => array(
'invokables' => array(
'Album\Controller\Album' => 'Album\Controller\AlbumController',
),
),
'router' => array(
'routes' => array(
'album' => array(
'type' => 'segment',
'options' => array(
'route' => '/album[/:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Album\Controller\Album',
'action' => 'index',
),
),
),
),
),
'view_manager' => array(
'template_path_stack' => array(
'album' => __DIR__ . '/../view',
),
),
);
問題が発生している場所でデバッグを行う方法はありますか?
の.htaccessファイルは、私が
以下のようにリンクにアクセスしようとしています127.0.0.1 zend
としてセットアップされ
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
のバーチャルホストが
<VirtualHost *:80>
ServerName zend
DocumentRoot c:/wamp64/www/zend/public
<Directory "c:/wamp64/www/zend/public/">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
ホスト以下の通りである以下のコードが含まれています
C:\ wamp64 \ WWW \ Zendが\ CONFIG \ modules.config.php
return [
'Zend\Router',
'Zend\Validator',
'Application',
'Album',
];
だけで確認する必要がなく、あなたの右のApache Webサーバーを使用していますか? *「Apache 404の標準エラーが表示されたら、.htaccessの使用を修正してから続行する必要があります。」* –
あなたは何のURLを入力しましたか?あなたのvhost(wamp vhost)は何ですか? – Hooli
こんにちはMemor-XとHooliお返事ありがとうございます。 .htaccessとvhostとホスト情報を質問に追加しました。うまくいけば分かりますか? – user3392695