Could not open window "Zend / Loader / Autoloader.php"

I am starting with Zend technology and I have a problem when I start a project. I am getting this error:

Warning: require_once(Zend/Loader/Autoloader.php): 
failed to open stream: 
No such file or directory in C:\xampp\htdocs\jcma\public\index.php on line 55

Fatal error: require_once(): 
Failed opening required 'Zend/Loader/Autoloader.php' (include_path=';C:\xampp\htdocs\jcma\public\../../httpdocs/ZendFramework/library;C:\xampp\htdocs\jcma\public\../application/classes;C:\xampp\htdocs\jcma\public\../application/library/dompdf;C:\xampp\htdocs\jcma\public\../application/library/cmcic;.;C:\xampp\php\PEAR') 
in C:\xampp\htdocs\jcma\public\index.php on line 55

      

+3


source to share


1 answer


Using the standard ZF1 framework, we usually copy Zend Framework into the library folder and then enable the autoloader.

I will only give examples from the standard structure below, and then discuss them and adapt to your particulars.

Here is the app /configs/application.ini from one of my old projects:

[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0

      

Here the focus is on the next line:

includePaths.library = APPLICATION_PATH "/../library"

      

You also need to check your public /index.php:



<?php

// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH . '/../library'),
    get_include_path(),
)));

/** Zend_Application */
require_once 'Zend/Application.php';

// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
            ->run();

      

Here set_include_path is what you want to check. If it's well configured, you shouldn't have any errors.

From your error message there is a configuration issue here.

Fatal error: require_once (): failed to open "Zend / Loader / Autoloader.php" (include_path = '; C: \ xampp \ htdocs \ jcma \ public ../../ httpdocs / ZendFramework / library ; C: \ XAMPP \ HTDOCS \ jcma \ public ../ applications / classes; C: \ XAMPP \ HTDOCS \ jcma \ public ../ application / library / DOMPDF; C: \ XAMPP \ HTDOCS \ jcma \ public ../ application / library / cmcic;.; C: \ xampp \ php \ PEAR ') to C: \ xampp \ htdocs \ jcma \ public \ index.php on line 55

See bold text above: the first one should be C: \ xampp \ htdocs \ jcma \ ZendFramework \ library I think the library should be located in that folder too.

Can you copy paste your folders tree under C: \ xampp \ htdocs \ or at least describe the main directories and paste your index.php?

+1


source







All Articles