Welcome Guest, Not a member yet? Register   Sign In
Codeigniter 2.0/Zend lucene error
#1

[eluser]Progressed[/eluser]
Hi all,

Basicly i've run into an error wich i dont see how to solve wouthout programming the core. I hope im wrong Smile

Using:
CI 2.0 (on linux)
Zend Framework 1.11.4 (included into CI 2.0 as library)

What i've done is this:

- I have a php tool that crawls trough the website checking every link en make it into an sitemap for google to pick up. Works perfectly!
- I then use Lucene to index every <loc> in that sitemap and write it to a folder. Works perfectly!
- Then i have been searching the index to check if everything is working... IT IS WORKING PERFECTLY!!! but not without getting the good results AND a error from (my guess is zend).

Warning: include(application/errors/error_php.php) [function.include]: failed to open stream: No such file or directory in /storage/virtual/www/wwwroot/system/core/Exceptions.php on line 167

Warning: include() [function.include]: Failed opening 'application/errors/error_php.php' for inclusion (include_path='.:/usr/lib/php/:application/libraries') in /storage/virtual/www/wwwroot/system/core/Exceptions.php on line 167

Fatal error: require_once() [function.require]: Failed opening required 'Zend/Search/Lucene/Storage/File/Filesystem.php' (include_path='.:/usr/lib/php/:application/libraries') in /storage/virtual/www/wwwroot/application/libraries/Zend/Search/Lucene/Storage/Directory/Filesystem.php on line 348


My hope is that someone else have seen this. This is the code:

Code:
&lt;?php defined('BASEPATH') OR exit('No direct script access allowed');

class Search extends Public_Controller {

    function __construct() {
        parent::__construct();

        $this->load->library('zend', 'Zend/Search/Lucene');
        $this->load->library('zend');
        $this->zend->load('Zend/Search/Lucene');
        
        $this->load->model('search_model');
        
        $this->template->set_breadcrumb('Homepage','/');
        $this->template->set_breadcrumb('Zoeken','/zoeken/');
    }

    function index() {  

        $index = new Zend_Search_Lucene('/storage/virtual/www/wwwroot/tmp/feeds');
        
        $search['query'] = 'Samsung';
        $search['hits'] = $index->find($search['query']);
        $search['count'] = count($search['hits']);
        
        $this->template->set_theme('search');
        $this->template->set_layout('default');
        
        $this->template->title('Zoeken');
        $this->template->set_metadata('keywords', '');
        $this->template->set_metadata('description', '');

        $theme_array = array("base_url" => base_url().$this->template->get_theme_path());
        
        $this->template->set('search', $search);
        $this->template->set('theme', $theme_array);
        
        $this->template->build('search');

        }
    
    function indexer() {
        $search = $this->search_model->get_all();
        
        $index = Zend_Search_Lucene::create('/storage/virtual/www/wwwroot/tmp/feeds');        
        foreach($search as $item) {
    
        $doc = Zend_Search_Lucene_Document_Html::loadHTMLFile($item->loc);
        $doc->addField(Zend_Search_Lucene_Field::Text('link', $item->loc));

        $index->addDocument($doc);
        
        }

        $index->commit();        
        echo $index->count() .' Documents indexed.<br />';
            }
    }

The code isnt completly finished because i just want to see it working. If the error is gone i want to post the complete code with highlighting etc (like google).

As you can see in the code there are some template additions... just ignore that! Smile

PLEASE HELP!
#2

[eluser]Progressed[/eluser]
really... nobody?

I checked if the files were there and they do exist so the error is just bull.

Warning: include(application/errors/error_php.php) [function.include]: failed to open stream: No such file or directory in /storage/virtual/www/wwwroot/system/core/Exceptions.php on line 167

Warning: include() [function.include]: Failed opening ‘application/errors/error_php.php’ for inclusion (include_path=’.:/usr/lib/php/:application/libraries’) in /storage/virtual/www/wwwroot/system/core/Exceptions.php on line 167

Fatal error: require_once() [function.require]: Failed opening required ‘Zend/Search/Lucene/Storage/File/Filesystem.php’ (include_path=’.:/usr/lib/php/:application/libraries’) in /storage/virtual/www/wwwroot/application/libraries/Zend/Search/Lucene/Storage/Directory/Filesystem.php on line 348
#3

[eluser]Progressed[/eluser]
Ok its solved... thanks everybody.... Smile


anywayzzz! Next stop... as i do not build my index from a DB (i follow links) i would like to know how to get everything inside the &lt;BODY&gt; tag to index.
#4

[eluser]Esger[/eluser]
How did you solve it?
Because I have the same problem, CodeIgniter 2.02, PHP 5.2.5, MySQL 5.0.51a, Not using Zend
I know I have bugs in my code but I dont get any decent error messages. Just:

Warning: CI_Exceptions::include(application/errors/error_php.php) [function.CI-Exceptions-include]: failed to open stream: No such file or directory in /home/p6025/domains/ashware.nl/public_html/be_nl/system/core/Exceptions.php on line 167

Warning: CI_Exceptions::include(application/errors/error_php.php) [function.CI-Exceptions-include]: failed to open stream: No such file or directory in /home/p6025/domains/ashware.nl/public_html/be_nl/system/core/Exceptions.php on line 167

Warning: CI_Exceptions::include() [function.include]: Failed opening 'application/errors/error_php.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/p6025/domains/ashware.nl/public_html/be_nl/system/core/Exceptions.php on line 167

It looks like CI has some local include path... (include_path='.:/usr/local/lib/php')
I am sure the file (error_php.php) is in the right place. It is there!
Error_reporting is set ot E_ALL,
$system_path = 'system';
$application_folder = 'application';
#5

[eluser]Progressed[/eluser]
Did you add something extra in you library?
#6

[eluser]Esger[/eluser]
Nothing but standard libraries and helpers like HTML, form, URL, image_lib
#7

[eluser]cafekuktem[/eluser]
get the same error. what you do to solve it

thank in advance
#8

[eluser]Progressed[/eluser]
I moved the zend library to the systems folder instead of the application library... My guess is a library that is causing your error too.

That solved my issue.

PS: anyone has some experience with zend lucene? i want to index pages inside certain tags... anyone?
#9

[eluser]cafekuktem[/eluser]
i found another solution. i put my zend.php and zend folder in application/library, then in zend.php i change

Code:
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . APPPATH . 'libraries');


to

Code:
ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . FCPATH . 'application\libraries');

work for me...




Theme © iAndrew 2016 - Forum software by © MyBB