+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: Cant figure out Bootstrapper Video Tutorial

  1. #1
    WavyDavy is offline Junior Member
    Join Date
    Jan 2008
    Posts
    4

    Default Cant figure out Bootstrapper Video Tutorial

    I am trying to follow the bootstrapper tutorial from here
    Zend Framework: Getting Started - Mitch’s World

    And I cannot get my bootstrapper index.php to work, everytime I try to access it I get the following error;

    Warning: require(Zend/Loader.php) [function.require]: failed to open stream: No such file or directory in E:\xampplite\htdocs\demo_app\public\index.php on line 23

    Fatal error: require() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='.;\xampplite\php\pear\:../library') in E:\xampplite\htdocs\demo_app\public\index.php on line 23
    This is the code for index.php

    [PHP]<?php

    /*
    *Error Reporting
    */

    error_reporting(E_ALL|E_STRICT);
    ini_set('display_errors', 'on');

    ini_set('include_path', ini_get('include_path') . ':../library');

    /*
    *Zend Loader
    */
    //Zend_Loader::loadClass('');
    require "Zend/Loader.php";

    /*
    *Required Classes
    */

    Zend_Loader::loadClass('Zend_Controller_Front');

    /*
    *Setup controller
    */

    $front = Zend_Controller_Front::getInstance();
    $front->setControllerDirectory('../application/controllers');
    $front->throwExceptions(true);

    ?>[/PHP]

  2. #2
    SpotSec's Avatar
    SpotSec is offline Senior Member
    Join Date
    Feb 2007
    Location
    United States
    Posts
    122

    Default

    Did you add the Zend library into the include_path?
    Zym Framework - A Zend Framework extension library w/ demo app

    SpotSec Blog:
    http://spotsec.com/blog

  3. #3
    mitchellh is offline Junior Member
    Join Date
    Jan 2008
    Posts
    1

    Default

    Hi,

    SpotSec is right.

    [PHP]ini_set('include_path', ini_get('include_path') . ':../library'); [/PHP]

    The whole purpose of that line is to let PHP know where the Zend Framework "library" folder is. Make sure the Zend framework, in this case, is in "../library" relative to where your PHP script is and it will work

    By the way, I'm glad you're using my screencasts I got this forum URL from a pingback I received from you linking it.

    If you're still confused about the library folder, be sure to check out the first "installing" screencast.

    Mitchell

  4. #4
    WavyDavy is offline Junior Member
    Join Date
    Jan 2008
    Posts
    4

    Default

    Thanks Mitchell for the quick response and the great tutorials.

    As far as I can see my folder structure is exactly the same as yours in the video and as far as I can see the code is as well.

    I have double checked the path to the library and it is correct which you can see in the linked image below.

    http://www.users.on.net/~nova/nova/f...0structure.gif

    I must have a typo something somewhere in the code but I cant for the life of me track it down.

  5. #5
    WavyDavy is offline Junior Member
    Join Date
    Jan 2008
    Posts
    4

    Default

    I have tried setting an absolute path to the zend library instead of a doc relative one and I got this error message;


    Fatal error: require() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='.;\xampplite\php\pear\E:\xampplite\ htdocs\demo_app\library\Zend') in E:\xampplite\htdocs\demo_app\public\index.php on line 24

    No matter what path I put into my index.php it always without fail tries to point to the php pear library in my xampplite install first instead of going straight to the zend library.

    If it is a xampplite problem does anyone know how to configure xampplite so it doesnt point to the pear library by default?

  6. #6
    ovreuc69 is offline Junior Member
    Join Date
    Jan 2008
    Posts
    2

    Default Bootstrap -> Modules directory structure

    Thanks Mitchell for the great tutorials.

    My folder structure is exactly the same as yours and it works, but I cannot get my bootstrapper index.php to work using MODULES STRUCTURE , everytime I try to access to other module I get the following error:

    Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller class ("Test_IndexController")'
    The Structure

    application
    --default
    ----controllers
    ------IndexControllers.php
    --test
    ----controllers
    ------IndexControllers.php
    library
    web
    --index.php
    --.htaccess
    here the bootstrap:

    error_reporting(E_ALL|E_STRICT);
    ini_set('display_errors', 'on');

    // Modificar el include path, para incluir library
    ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . '../library');

    // Zend Framework Includes
    require_once('Zend/Loader.php');

    // Cargar las clases necesarias
    Zend_Loader::loadClass('Zend_Controller_Front');
    Zend_Loader::loadClass('Zend_Config_Ini');

    // Inicializamos el config Ini
    $config = new Zend_Config_Ini('../application/config.ini', 'dev');

    // Obtener la Instancia del front Controller
    $front = Zend_Controller_Front::getInstance();


    // Establecer los directorios de la app
    $front->setControllerDirectory(array(
    'default' => '../application/default/controllers',
    'test' => '../application/test/controllers'
    ));


    // Tipo de error a mostrar segun el estado de la aplicacion (Developer, Production)
    if ($config->developer)
    $front->throwExceptions(true);
    else
    $front->throwExceptions(false);


    // Listo
    $front->dispatch();
    ...thx if anyone else can help me pls..

  7. #7
    WavyDavy is offline Junior Member
    Join Date
    Jan 2008
    Posts
    4

    Default

    ...thx if anyone else can help me pls..
    ovreuc69 your problem is completely different to mine so it is unlikely that anyone here can help you, you will have a much better chance of getting a response if you start your own thread

  8. #8
    leonjhon is offline Junior Member
    Join Date
    Jan 2008
    Posts
    1

    Default

    Quote Originally Posted by WavyDavy View Post
    I am trying to follow the bootstrapper tutorial from here
    Zend Framework: Getting Started - Mitch’s World

    And I cannot get my bootstrapper index.php to work, everytime I try to access it I get the following error;



    This is the code for index.php

    [PHP]<?php

    /*
    *Error Reporting
    */

    error_reporting(E_ALL|E_STRICT);
    ini_set('display_errors', 'on');

    ini_set('include_path', ini_get('include_path') . ':../library');

    /*
    *Zend Loader
    */
    //Zend_Loader::loadClass('');
    require "Zend/Loader.php";

    /*
    *Required Classes
    */

    Zend_Loader::loadClass('Zend_Controller_Front');

    /*
    *Setup controller
    */

    $front = Zend_Controller_Front::getInstance();
    $front->setControllerDirectory('../application/controllers');
    $front->throwExceptions(true);

    ?>[/PHP]
    Hi I encountered the same problems like you did and I found the solutions finally.
    First I guess that you must use windows OS ,right?If so,here is my solution:
    1.add the following in your php.ini,you should know what the exact meaning of the following sentence:
    include_path = ".;D:\Apache2.2\htdocs\demo_app\library"
    2.modify the index.php like this:
    ini_set('include_path',ini_get('include_path').';. ./library');
    Noted that the last ";"
    it SHOULD NOT be the ":",right?know what i mean?
    then .....bla bla bla,just following the MASTER -->Mitchell 'S GREAT VIDEO!
    AND....have fun!

    Another new question is ...
    while everything is OK from the single controller,i mean the "index",if i typed the "user" as what Mitchell did in his
    video ,then the IE reported "HTTP 404 ",WHY?
    Last edited by leonjhon; 01-27-2008 at 05:55 PM.

  9. #9
    djvirgen is offline Junior Member
    Join Date
    Jan 2008
    Posts
    1

    Default

    Hello,

    I'm not sure if you've solved this yet, but try using the constant PATH_SEPARATOR instead of a colon in your include path.


    In other words,

    ini_set('include_path', ini_get('include_path') . ':../library');

    should be

    ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . '../library');

    I hope this helps!

  10. #10
    eventhough is offline Junior Member
    Join Date
    May 2008
    Posts
    4

    Default Same problem

    I'm having the same problem as WavyDavy. I don't think anybody here understands the problem at hand.

    I am developing on a Windows machine, but I am using a CentOS linux server to actually host my website. Everything works great on my Windows machine but when I port the site over to linux, the include_path does NOT work.

    I am using the following code:

    // Modify include path to include path to library
    ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . '../library');

    // Zend Framework Includes
    require_once "Zend/Loader.php";

    It's very simple. In Windows the path_separator is a semi-colon, in linux it's a colon.

    My default include_path in my php.ini file is ".;" in Windows and ".:" in linux.

    Looking at Mitchell Hashimoto's video tutorial, you get an include path that looks something like this:

    In Windows: .;;../library

    In linux: .::../library

    I EXPECT this to work nicely in linux but for some reason I am unable to locate ../library to find the Zend directory.

    The Zend/ directory is located in the right place. Everything works great on Windows but something is not right on linux.

    I hope I've clarified this a bit more. Does anybody have any clue as to why this include_path doesn't work in linux?

    It has got to be some sort of configuration issue.

    Kev

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. Getting module name in bootstrapper
    By ecmcn in forum Installation & Configuration
    Replies: 3
    Last Post: 12-11-2009, 09:31 AM
  2. quickstart tutorial - Newbie no.2 needs Help with Create A Model and Db Tutorial
    By apprentice in forum Installation & Configuration
    Replies: 1
    Last Post: 11-26-2009, 03:49 AM
  3. quickstart tutorial - Newbie Help with Create A Model and Db Tutorial
    By johnlamont in forum Installation & Configuration
    Replies: 5
    Last Post: 07-20-2009, 12:23 AM
  4. A PHP Dev Job in the Video Game Industry
    By rchai in forum Paid work offers and requests
    Replies: 0
    Last Post: 06-22-2009, 12:37 AM
  5. Youtube: add video to playlist
    By del_jachim in forum Web & Web Services
    Replies: 0
    Last Post: 02-13-2009, 09:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts