Did you add the Zend library into the include_path?
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.phpWarning: 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
[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]
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
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 screencastsI 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
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.
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?
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:
The StructureFatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller class ("Test_IndexController")'
here the bootstrap:
application
--default
----controllers
------IndexControllers.php
--test
----controllers
------IndexControllers.php
library
web
--index.php
--.htaccess
...thx if anyone else can help me pls..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();
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...thx if anyone else can help me pls..
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.
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!
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