Zendframeworks configuration error. you can only access the default controller solution

Source: Internet
Author: User
Zendframeworks configuration error. you can only access the default controller such as Question 1, http: // localhost: 8080/ZendFramework_qyweb/2, http: // localhost: 8080/ZendFramework_qyweb/index3, http: // localhost: 8080/ZendFramewo zend frameworks configuration error. you can only access the default controller
Example

1. http: // localhost: 8080/ZendFramework_qyweb/
2. http: // localhost: 8080/ZendFramework_qyweb/index
3. http: // localhost: 8080/ZendFramework_qyweb/index/

1 can be accessed, 2, 3 cannot be accessed, and error 404 is prompted


APACHE configuration has also been modified according to the tutorial


Httpd. conf


Options FollowSymLinks
# AllowOverride None
AllowOverride All
Order deny, allow
Deny from all
Satisfy all



LoadModule rewrite_module modules/mod_rewrite.so


Project Directory structure:
|-Application
| ---- |-Config
| ---- |-Controllers
| ---- |-IndexController. php
| ---- |-Models
| ---- |-Views
| ---- |-Filters
| ---- |-Helpers
| ---- |-Scripts
| ---- |-Index. phtml




IndexController. php
Class IndexController extends Zend_Controller_Action
{

Public function init ()
{
/* Initialize action controller here */
$ This-> registry = Zend_Registry: getInstance ();
$ This-> view = $ this-> registry ['View'];
$ This-> view-> baseUrl = $ this-> _ request-> getBaseUrl ();
}

Public function indexAction ()
{
// Action body
$ Message = new Message ();//
//
$ This-> view-> messages = $ message-> fetchAll ()-> toArray ();

Echo $ this-> view-> render ('index. phpml ');//
}
}

?>


Note:
| ---- |-Scripts
| ---- | ----- |-Index
| ---- | ----- | ---- |-Index. phtml

The scripts subdirectory is not supported.

------ Solution --------------------
Discussion
Solved,

Cause: The httpd. conf file contains multiple AllowOverride None


After the change,
1. http: // localhost: 8080/ZendFramework_qyweb/
2. http: // localhost: 8080/ZendFramework_qyweb/index
3. http: // localhost: 8080/ZendFramework_qyweb/I ......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.