user2147269
user2147269

Reputation: 36

Path not found error in Zend Framework

I have been getting this error in Zend framework when i want to run the static content , The error is like

///Not Found

The requested URL /public/content/services was not found on this server.
Apache/2.2.20 (Ubuntu) Server at localhost Port 8090///

This is occuring when I try to access localhost:8090/content/services

Please give me a solution , thanks in advance :)

Upvotes: 1

Views: 1802

Answers (2)

user2147269
user2147269

Reputation: 36

I Replaced "AllowOverride None " with "AllowOverride FileInfo " in httpd.conf file and it worked !!!

Upvotes: 1

RockyFord
RockyFord

Reputation: 8519

make sure you create the route in your application.ini as specified on page 39 "Defining Custom Routes"

//this needs to be exact
resources.router.routes.static-content.route = /content/:page 
resources.router.routes.static-content.defaults.module = default
resources.router.routes.static-content.defaults.controller = static-content
resources.router.routes.static-content.defaults.action = display

without the route being defined correctly the static content will not work as suggested by this book.

i/f you are going to use this book "Zend Framework: A Beginner’s Guide" follow the code as close as you can until you understand it. ZF1 is not trivial to understand.

Don't change your .htaccess arbitrarily, keep it as close to stock as possible. It's ok to use it to set the environment and that's about it. Zf1 won't work correctly if the .htaccess is even a little incorrect.

//stock .htaccess
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 noticed you are using Ubuntu... Make sure you have the correct permissions and ownership of the files in your document root. Ubuntu has some different default settings for file permissions.

The book also instructs you to establish a vhost for your site ( page 13 "Define Virtual Host Settings" ). Please execute this recommendation it will make your life easier as you learn this framework.

Upvotes: 0

Related Questions