2011-09-10 38 views
1

我剛在一個託管服務中部署了我的Zend項目。我上傳我的項目作爲檔案,然後在public_html文件夾中提取。所以我有這個目錄:在cPanel中部署Zend Framework時出現內部服務器錯誤

public_hmtl
- >應用程序(文件夾)
- > libary(文件夾)
- >公共(文件夾)
- >測試(文件夾)
- > CGI -bin(文件夾)(這不屬於我擺在首位)
- >構建路徑
- > htaccess的(這不屬於我擺在首位)
- >項目
- > zfproject.xml
- >的index.php(這是重定向到/公共)

當我運行的網站,它表明:

內部服務器錯誤

服務器遇到一個內部錯誤或配置錯誤,並且 無法完成您的請求。

請與服務器管理員[email protected]和 聯繫,通知他們發生錯誤的時間以及您可能已經完成的任何可能導致錯誤的任何事情。

有關此錯誤的更多信息可能在服務器錯誤 日誌中可用。

此外,嘗試使用ErrorDocument處理請求時遇到404未找到錯誤。

我在使用xampp的localhost中完成了項目,它工作正常。但是當我上傳到cPanel時,就變成了這樣。

我已經將文件夾的chmod設置爲755,文件設置爲644.我認爲它與htaccess有關,但我不太清楚如何在cPanel中處理這個問題。

我該怎麼辦?

錯誤日誌顯示是這樣的:

[Sat Sep 10 15:10:39 2011] [error] [client 125.163.228.77] File does not exist: /home/publicusername/public_html/404.shtml 
[Sat Sep 10 15:10:39 2011] [error] [client 125.163.228.77] File does not exist: /home/publicusername/public_html/favicon.ico 
[Sat Sep 10 15:10:39 2011] [error] [client 125.163.228.77] File does not exist: /home/publicusername/public_html/500.shtml 
[Sat Sep 10 15:10:39 2011] [alert] [client 125.163.228.77] /home/publicusername/public_html/public/.htaccess: Invalid command 'SetEnv', perhaps misspelled or defined by a module not included in the server configuration 
[Sat Sep 10 15:09:58 2011] [error] [client 125.163.228.77] File does not exist: /home/publicusername/public_html/404.shtml 

我的公共/ htaccess的

SetEnv APPLICATION_ENV production 

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 
RewriteRule ^.*$ index.php [NC,L] 

我已經設置了SetEnv APPLICATION_ENVSetEnv APPLICATION_ENV production公共/ htaccess的,但還是失敗了。

+0

你檢查錯誤日誌嗎?它說什麼? – Ravi

+0

先請在這裏複製.htaccess文件。第二檢查錯誤日誌中cpnale – undone

+0

SETENV APPLICATION_ENV生產 RewriteEngine敘述在 的RewriteCond%{} REQUEST_FILENAME -s [OR] 的RewriteCond%{} REQUEST_FILENAME -l [OR] 的RewriteCond%{} REQUEST_FILENAME -d 重寫規則^ * $ - [NC,L] RewriteRule ^。* $ index.php [NC,L]我用eror log編輯了這個問題 – psaka

回答

2

該錯誤似乎指向SetEnv。我最好的猜測是你的主機使用的是真的舊版本的Apache(1.3.7版本)或未啓用mod_env

0

我覺得你的錯誤是不正確的文件夾結構。文件夾'public_html'不應該包含所有的項目樹,這裏應該只是'公共'文件夾的內容。其他文件夾(應用程序,庫,測試等))應該在'public_html'文件夾之外。 'Public_html'是你的web根目錄。您可以將'public_html'想象爲'公共'文件夾的別名。

我在當前項目中使用的文件夾結構(服務器位於CentOS和CPanel上)。如果在源文件中使用「公共」名稱,可能會出現問題。在這種情況下,您可以在主'index.php'文件中定義別名並在其他地方使用它。

+1

雖然不理想,但OP的文件夾結構不是錯誤的原因。 – Phil

相關問題