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 default layout with this error beneath.
Help?
我没有注意到确切的时间,但在今天的编码会话中,出现了一个错误: p> \ n
Not Found
在此服务器上找不到请求的URL /index.php。
此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误 。
code> pre>
每当我提交表格时都会显示。 表单已正确处理,但视图未正确显示。 它只显示我的默认布局,下面有这个错误。 p>
帮助? p>
div>
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.
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.