windows - Zend - Couldnt load Zend/Application.php (failed to open stream)? -


i have structure below (i'm using zend 1.9.6):

http://farm3.static.flickr.com/2605/4112306785_fc80d39833_o.gif
(i'm sorry. i'm not enough reputation.)

when run program, error:

*warning: require_once(zend/application.php): failed open stream: no such file or directory in c:\xampp\htdocs\myzend\index.php on line 25 fatal error: require_once(): failed opening required 'zend/application.php' (include_path=';c:\xampp/application/modules/admin/models;.;c:\xampp\php\pear') in c:\xampp\htdocs\myzend\index.php on line 25*

here index.php

<?php    date_default_timezone_set('asia/ho_chi_minh');     // define base path obtainable throughout whole application     defined('base_path')         || define('base_path', realpath(dirname(__file__) . '/../..'));       // define path application directory     defined('application_path')         || define('application_path', base_path . '/application');      // define application environment     defined('application_env')         || define('application_env', (getenv('application_env') ? getenv('application_env') : 'development'));     set_include_path(implode(path_separator, array(        realpath(application_path . '/library'),        application_path . '/modules/admin/models' ,        get_include_path(),    )));      /** zend_application */    require_once 'zend/application.php';     // create application, bootstrap, , run    $application = new zend_application(        application_env,        application_path . '/configs/application.ini'    );     $application->bootstrap()->run(); 

here application.ini

[production] phpsettings.display_startup_errors = 0 phpsettings.display_errors = 0 includepaths.library = application_path "/../library" bootstrap.path = application_path "/bootstrap.php" bootstrap.class = "bootstrap" resources.frontcontroller.moduledirectory = application_path "/modules"  resources.frontcontroller.defaultmodule = "default" resources.frontcontroller.defaultcontrollername = "index" resources.frontcontroller.defaultaction ="index"  resources.modules = ""  resources.layout.layout = "layout" resources.layout.layoutpath = application_path "/layouts"  [staging : production]  [testing : production] phpsettings.display_startup_errors = 1 phpsettings.display_errors = 1  [development : production] phpsettings.display_startup_errors = 1 phpsettings.display_errors = 1 

i have search many times on internet nothing found helpful. please me! thank much. first application zend.

http://www.mediafire.com/download/rni7f3af3n214kx/myzend.rar

the error means php can't find file zend/application.php you're trying require in. convention, you'd have copy of zend framework in library folder, file should @ library/zend/application.php.

your index.php adds library folder include path, tells php in folder when including files. don't think path you've put in correct, cause of error. have:

set_include_path(implode(path_separator, array(    realpath(application_path . '/library'),    application_path . '/modules/admin/models' ,    get_include_path(), ))); 

but should be:

set_include_path(implode(path_separator, array(    realpath(application_path . '/../library'),    application_path . '/modules/admin/models' ,    get_include_path(), ))); 

edit: zf project archive worked me 2 small fixes:

  • i fixed filename of application.ini in application/configs (it misspelt - possibly issue in rar archive).
  • i changed defaultmodule in application.ini default default.

the page loaded me. didn't zend/application.php error reported in question.


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -