TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
Advertisement
Associates
Associates
techtuts Darkmindz
CSS Tutorials Tutorialsphere.com - Free Online Tutorials
Boston PHP SurfnLearn
Reply
 
LinkBack Thread Tools Display Modes
Old 07-09-2008, 07:06 PM   #1 (permalink)
The Wanderer
 
Join Date: Apr 2008
Posts: 8
Thanks: 0
MaxS is on a distinguished road
Red face Zend Framework Issue

I'm following a basic tutorial and I'm already stuck.

Here's my code:

.htaccess
Code:
RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php
index.php
PHP Code:
<?php

/*
* Error Reporting

error_reporting(E_ALLIE_STRICT);
ini_set('display_errors', 'on');
*/
ini_set('include_path'ini_get('include_path') . ':../library');

/*
* Zend Loader
*/
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);

// Go
$front->dispatch();

?>
IndexController.php
PHP Code:
<?php

class IndexController extends Zend_Controller_Action
{
    function 
indexAction()
    {
    
    }
}

?>
index.phtml
Code:
Hello
File structure:
public_html/todo/application
public_html/todo/application/controllers/IndexController.php
public_html/todo/application/models
public_html/todo/application/views/scripts/index/index.phtml
public_html/todo/library
public_html/todo/public/.htaccess
public_html/todo/public/index.php

The issue is when I go to /todo/public/, I get the following error:
Quote:
Warning: require_once(Zend/View/Interface.php) [function.require-once]: failed to open stream: No such file or directory in /home/net/public_html/todo/library/Zend/Controller/Action/Helper/ViewRenderer.php on line 30

Fatal error: require_once() [function.require]: Failed opening required 'Zend/View/Interface.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:../library') in /home/net/public_html/todo/library/Zend/Controller/Action/Helper/ViewRenderer.php on line 30
Thanks for the help!

Last edited by MaxS : 07-09-2008 at 07:45 PM.
MaxS is offline  
Reply With Quote
Old 07-11-2008, 04:00 AM   #2 (permalink)
The Visitor
 
Join Date: Apr 2008
Location: Worcester, UK
Posts: 3
Thanks: 0
akrabat is on a distinguished road
Default

Try using a fully qualified path to your library/ directory?

Regards,

Rob...
akrabat is offline  
Reply With Quote
Old 07-13-2008, 01:04 PM   #3 (permalink)
The Wanderer
 
Join Date: Jul 2008
Location: Germany
Posts: 20
Thanks: 0
netsnake is on a distinguished road
Default

Uhm...
Line 14: Replace
require "Zend/Loader.php";
by
require "../library/Zend/Loader.php";
__________________
Heaven for searching -> Xooria.com
Note: Please don't blame me for my English... 4 Years of it at school don't make it perfect! But feel free correct me!
Send a message via Skype™ to netsnake
netsnake is offline  
Reply With Quote
Old 07-14-2008, 05:18 AM   #4 (permalink)
The Wanderer
 
Join Date: Apr 2008
Posts: 8
Thanks: 0
MaxS is on a distinguished road
Default

Still getting the same error.
MaxS is offline  
Reply With Quote
Old 08-26-2008, 06:14 PM   #5 (permalink)
The Wanderer
 
Join Date: Aug 2008
Posts: 3
Thanks: 0
zendkush is on a distinguished road
Default

It looks like you're requesting this as a windows user?

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

Setting ini correctly can be a pain. I never knew how to get it correct until i did one thing and I just use that now always.

Assuming that this script is in your bootstrap.... ( you can remove the extra array indexes that dont apply to you. you should just change 'lib' to 'library'.

This works both unix and windows.


/**
* Enter description here...
*
*/
define('DS', DIRECTORY_SEPARATOR);
define('PS', PATH_SEPARATOR);
define('BP', dirname(dirname(__FILE__)));

/**
* Enter description here...
*
*/
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', 1);

/**
* Enter description here...
*
*/
$paths[] = BP . DS . 'app' . DS . 'code' . DS . 'modules';
$paths[] = BP . DS . 'lib' . DS . 'phpunit';
$paths[] = BP . DS . 'lib' . DS . 'incubator';
$paths[] = BP . DS . 'lib';

set_include_path(implode(PS, $paths) . PS . get_include_path());

require_once 'Zend'.DS.'Loader.php';
// register autoload
Zend_Loader::registerAutoload();


It's always important to note that this is FIFO, so for instance, my incubator inclusion gets applied previous to the standard inclusion. If you have any problems with this, let me know. however, that should work out of the box if applied correctly.
zendkush is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 02:12 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0