Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-13-2008, 12:12 AM
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;

Quote:
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 Code:
<?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);

?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-13-2008, 01:15 AM
SpotSec's Avatar
Senior Member
 
Join Date: Feb 2007
Location: United States
Posts: 116
Default

Did you add the Zend library into the include_path?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-13-2008, 01:35 AM
Junior Member
 
Join Date: Jan 2008
Posts: 1
Default

Hi,

SpotSec is right.

PHP Code:
ini_set('include_path'ini_get('include_path') . ':../library'); 
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-13-2008, 06:44 AM
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-13-2008, 09:53 PM
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-17-2008, 06:28 PM
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:

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

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

Quote:
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..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-22-2008, 07:52 AM
Junior Member
 
Join Date: Jan 2008
Posts: 4
Default

Quote:
...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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-27-2008, 05:30 PM
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 Code:
<?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);

?>
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-30-2008, 02:42 AM
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 05-02-2008, 09:08 AM
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 03:12 AM.