2012-01-13 10 views
2

私のローカルマシンでは、私が作成したsymfonyプロジェクトは完全に動作します。symfony 404エラー

私はテストサーバーにsymfonyをインストールしましたが、正常に動作しています。ブラウザのURLに移動すると、「Symfony Project Created」ページが表示されます。私はcheck_configuration.phpを実行し、すべてがチェックアウトします。

私が抱える問題は次のとおりです。データベースを作成してテーブルデータをアップロードしました。 FTPを使用してローカルマシンからサーバーにファイルをアップロードしました。私は、私が作成したモジュールにアクセスしようとすると、それは404エラーがスローされます。

私のローカルマシン上のMAMPを使用して、私は次のURLを使用します。

ここ

The requested URL /mymodule was not found on this server. 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. 

は、いくつかの例ですが見つかりませんでした正常に動作します:

http://localhost:8080/frontend_dev.php/mymodule 

私はテストサーバーのURLに行けば、私は、すべてをアップロードした後:

http://my.url.com:8090/ 

/sfイメージとスタイルを含む「プロジェクト成功」ページが表示されます。

しかしは私が

http://my.url.com:8090/mymodule 

は私が私がsmfonyは、フロントエンドモジュールについて知らないthik作るページが存在しないかのように404エラーを取得しよう。

ヘルプ

答えて

7

あなたは二つのことを行う必要があります:

1)そのmod_rewriteのは、Apacheの中で有効になっていることを確認します。

2)ドキュメントルートのファイル.htaccessをダブルチェックして、app.phpを指していることを確認します。線に沿って何か:私もこの問題を抱えているために使用される

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteRule ^(.*)$ app.php [QSA,L] 
</IfModule> 
+0

感謝を。私は最も明白なURLを試しませんでした。私はhttp://my.url.com:8090/index.php/mymoduleに入力しました。今私は、内部サーバーエラーがありますね、ちょっと...その進歩。 –

+0

ようこそ。喜んで助けてください。 – webbiedave

3

は、私の構成を見て、私の.htaccess内

それらを試してみてください。

こんにちはすべて、私が持っていますこの問題もありました。そして、 "株式" .htaccessが問題だと思われます。私は、私の環境でこれを解決し、ここではノートで私の.htaccessでいます

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$ 
    RewriteRule ^(.*) - [E=BASE:%1] 
    RewriteCond %{ENV:REDIRECT_STATUS} ^$ 
    RewriteRule ^app_dev.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L] ##### this is the part that you should tweak, have the .htaccess point the request to app_dev.php, since the routing.yml is empty initially 
    RewriteCond %{REQUEST_FILENAME} -f 
    RewriteRule .? - [L] 
    RewriteRule .? %{ENV:BASE}/app_dev.php [L]  ##### this is the part that you should tweak, have the .htaccess point the request to app_dev.php, since the routing.yml is empty initially 
</IfModule> 

<IfModule !mod_rewrite.c> 
    <IfModule mod_alias.c> 
     # When mod_rewrite is not available, we instruct a temporary redirect of 
     # the startpage to the front controller explicitly so that the website 
     # and the generated links can still be used. 
     RedirectMatch 302 ^/$ /app.php/ 
     # RedirectTemp cannot be used instead 
    </IfModule> 
</IfModule> 

は/ etc/apache2の/サイト利用可能で、私の "symfonyの" エントリ内:

<VirtualHost 127.0.1.15> 
ServerAdmin [email protected] 
ServerName symfony 
DocumentRoot /var/www/Symfony/web 
DirectoryIndex app.php 
<Directory /var/www/Symfony/web> 
    Options Indexes FollowSymLinks MultiViews 
    AllowOverride All 
    Order allow,deny 
    allow from all 
</Directory> 

ErrorLog ${APACHE_LOG_DIR}/error.log 
# Possible values include: debug, info, notice, warn, error, crit, 
# alert, emerg. 
LogLevel warn 
CustomLog ${APACHE_LOG_DIR}/access.log combined 
</VirtualHost> 
関連する問題