开发者

File not found error in Zend Framework

I didn't notice exactly when, but during a coding session today, an error appeared:

Not Found

The requested URL /index.php was not found on this server.

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

This is displayed whenever I submit a form. The form is processed appropriately, but the view is not displayed correctly. It just displays my 开发者_JAVA技巧default layout with this error beneath.

Help?


there could be number of reasons for the 404 message. mostly path setting problem.

Check you application.ini file in configuration folder make sure that you have the right paths settings to your controller and layout.

resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.layout.layoutPath = APPLICATION_PATH "/views/layouts/"

Set your Error controller to define customise message or 404 file. you can also set it in .htaccess file

ErrorDocument 404 /misc/404page.html

if the form is being processed correctly it means controller path is ok. you have to make sure that your view exist and you have the correct path to it.


I found the problem.I hadn't defined the action.When I first took a look at _forward action,I thought,that it just displays some other view,but in truth it takes the script to another action,without changing the URL.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜