Page not found on request url in zend 2 framework application

南笙酒味 提交于 2019-11-28 02:25:15

when you point with your apache document root to C:/xampp\htdocs/ZendSkeletonApplication/ZendSkeletonApplication-master/public

you need to use in your browser this url http://zf2-tutorial.localhost:8081/album and not like you wrote http://zf2-tutorial.localhost/ZendSkeletonApplication/ZendSkeletonApplication-master/public/album

this url points internal to a different module/location.

//edit

if this not work check your zf2 /public folder if there is a .htaccess file present otherwise use the file from the zend skeleton application here https://github.com/zendframework/ZendSkeletonApplication/blob/master/public/.htaccess

please check also your apache vhost entry if the port is equal to your windows host file port.

make sure apache ModRewrite is loaded!

Basic misconfigurations in your setup causes this error.

  1. I don't use windows for along time but you're using both forward and backslashes in your paths. Firstly, you should find the correct directory separator for windows and stick with it. This seems problematic: C:/xampp\htdocs/foo/bar/public
  2. You're defining a virtualhost which listens any IP address on port 81 (*:81), a system32 hosts entry which points to port 8081 as zf2-tutorial.localhost alias and trying to call zf2-tutorial.localhost/album url using port 80. Getting this kind of error pretty normal.

After completely reading the official Getting Started and Using Apache Web Server documentations, you'll easily figure out the solution.

It seems you missing a vhost entry in your webserver. This could the reason why your application doesn't resolve your request right. Check the "getting startet: A skeleton application" again, to provide a proper configuration.

You need this hostfile entry. Adding ports is not possible in this file.

127.0.0.1 zf2-tutorial.localhost

The website is now available at zf2-tutorial.localhost:81 (and not 8081, you set 81 as the portnumber in the first line of httpd-vhosts.conf)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!