Novice Ask Zend Freamwork solution

Source: Internet
Author: User
Tags stack trace
Novice asks Zend Freamwork
Http://localhost/zfdemo/pubilc/index.php can access
Zfdemo Project Name
1.
How do I use
http://localhost/zfdemo/index.php Access
2.
Add hello.phtml in new Add Helloaction Views-scripts-index in Indexaction

How do I use hyperlinks to jump to this page on the homepage?




------Solution--------------------
It's best to turn on URL rewriting,
Then the public follows the controller name/action prefix
------Solution--------------------
Study it!
------Solution--------------------
1. Whether you put the index.php under public or in the root directory, this is fine, as long as you specify in the. htaccess file
PHP Code
Rewriteengine Onrewriterule!\. (ico|js|gif|jpg|png|php) $ public/index.php
------Solution--------------------
ZF is such a way of access, first put all the requests to use rewrite to the unified entrance, and then after a series of processing, will be to perform relative xxxxxcontroller.php the following Xxxxaction method, as for rewrite very easy
Rewriteengine on
Rewritebase/
Rewritecond%{script_filename}!-f
Rewritecond%{script_filename}!-d
Rewriterule ^ (. *) $ index.php
Notice your http://127.0.0.1:8083/fristZFdemo/public/index/add, I guess your web directory is not right, you put http://127.0.0.1:8083 point to "web directory/ Firstzfdemo/public ", put the. htaccess and index.php files in the public directory, then use Http://127.0.0.1/index/add to access, Will go to visit the indexcontroller.php inside the Addaction method of
------Solution--------------------
ZF Configuration Error:


Fatal error:uncaught exception ' zend_controller_dispatcher_exception ' with message ' Invalid Controller specified (index . php) ' in d:\wamp\apache2.2\htdocs\zendframework\library\zend\controller\dispatcher\standard.php:242 Stack trace: # 0 D:\wamp\Apache2.2\htdocs\zendframework\library\Zend\Controller\Front.php (954): Zend_controller_dispatcher_ Standard->dispatch (Object (Zend_controller_request_http), Object (zend_controller_response_http)) #1 D:\wamp\ apache2.2\htdocs\zendframework\index.php: Zend_controller_front->dispatch () #2 {main} thrown in D:\wamp\ apache2.2\htdocs\zendframework\library\zend\controller\dispatcher\standard.php on line 242


In standard.php on line 242:
Require_once ' zend/loader.php ';

/** Zend_controller_dispatcher_abstract */
Require_once ' zend/controller/dispatcher/abstract.php ';

Warning:require_once (zend/loader.php) [Function.require-once]: failed to open stream:no such file or directory in D:\wam p\apache2.2\htdocs\zendframework\library\zend\controller\dispatcher\standard.php on line 24

Fatal error:require_once () [function.require]: Failed opening required ' zend/loader.php ' (include_path= '); C:\php5\pear ') in D:\wamp\Apache2.2\htdocs\zendframework\library\Zend\Controller\Dispatcher\Standard.php on line 24
  • 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.