开发者

Internal server error when Deploying Zend Framework in cPanel

I just deployed my Zend project in a hosting service. I upload my project as archive then extracted in public_html folder. so I have this directory:

public_hmtl

->application (folder)

->libary (folder)

->public (folder)

->test (folder)

->cgi-bin (folder) (this not belong to me in the first place)

->buildpath

->htaccess (this not belong to me in the first place)

->project

->zfproject.xml

->index.php (this is for redirecting to /public)

When I run the site, it shows :

Internal Server Er开发者_开发问答ror

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@myweb.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

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

I did the project in localhost using xampp and it works fine. But when I uploaded in cPanel, it became like that.

I have set the chmod for folder to 755 and file to 644. I think it has to do with the htaccess but I don't quite understand how to deal with that in cPanel.

What should I do?

The error log shows something like this:

[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

my public/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]

I have set the SetEnv APPLICATION_ENV to SetEnv APPLICATION_ENV production in public/htaccess, but still failed.


The error seems to point to SetEnv. My best guess is your host is using a really old version of Apache (pre 1.3.7) or has not enabled mod_env.


I think your error is not right folder structure. Folder 'public_html' should not contain all project tree, here should be only 'public' folder contents. Other folders (application, library, test etc.) should be outside 'public_html' folder. 'Public_html' is your web-root directory. You may imagine 'public_html' as alias of your 'public' folder.

That folders structure I use in my current project (Server is on CentOS and CPanel is used). May be you will have a problem if name 'public' is used in source. In this case you might to define alias in the main 'index.php' file and use it in other places.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜