Zend Failed opening Zend/Application.php

17,637

Solution 1

Your application needs to be able to access the Zend Framework classes. Typically you would put these into the library folder in your app (Zend Tool does not do this for you). So from your downloaded copy of ZF, copy the library/Zend folder into your library folder. You should end up with the file it is looking for at /home/www-data/zend.danielgroves.net/htdocs/library/Zend/Application.php, which will fix the error.

Solution 2

I'm having this exact same problem. First I was missing the reference to Zend/Application.php. So I found that, and copied into the Library folder, and changed the code to point at the file in the library folder. Then there was another reference to the same file WITHIN the Application.php file. I fixed that. Now I have a series of other errors like: Fatal error: Class 'Zend_Loader_Autoloader' not found in C:\Development\PHPSites\testProjectIII\library\Application.php on line 82

So I REM out line 82: $this->_autoloader = Zend_Loader_Autoloader::getInstance();

And I get THIS error: Fatal error: Class 'Zend_Config_Ini' not found in C:\Development\PHPSites\testProjectIII\library\Application.php on line 388

So I REM out that line: $config = new Zend_Config_Ini($file, $environment);

After that, I finally get this error: Notice: Undefined variable: config in C:\Development\PHPSites\testProjectIII\library\Application.php on line 417 Fatal error: Call to a member function toArray() on a non-object in C:\Development\PHPSites\testProjectIII\library\Application.php on line 417

Now - If I understand what I'm seeing here, it's that the application is looking for libraries that include classes that are not defined. All I'm doing is taking the entire working program (this is right out of the startup wizard, with no changes), which works on the Apache server that Zend installs. But I take it to another folder where the root of my IIS server is, and the libraries cannot be found.

I've been trying to isolate what is what, but nothing is working. The answer directly above my post here is exactly what I tried.

Share:
17,637
Daniel Groves
Author by

Daniel Groves

Photographer and Software Developer who's addicted to mountains, music and bikes. Twitter: @danielgroves Website: danielgroves.net

Updated on June 04, 2022

Comments

  • Daniel Groves
    Daniel Groves almost 2 years

    Ok, so I am relatively new to Zend. I have created a new application and started to build an authentication system based on a guide. However, the server is kicking out an Internal Server Error.

    Upon checking the PHP error logs I have been given the following two errors:

    [Thu Jul 19 10:26:40 2012] [error] [client 80.194.255.4] PHP Warning: require_once(Zend/Application.php): failed to open stream: No such file or directory in /home/www-data/zend.danielgroves.net/htdocs/public/index.php on line 18

    [Thu Jul 19 10:26:40 2012] [error] [client 80.194.255.4] PHP Fatal error: require_once(): Failed opening required 'Zend/Application.php' (include_path='/home/www-data/zend.danielgroves.net/htdocs/library:.:/usr/share/php:/usr/share/pear') in /home/www-data/zend.danielgroves.net/htdocs/public/index.php on line 18

    The controller:-

    class Admin_AuthController extends Zend_Controller_Action 
    { 
        public function init() 
        { 
             /* Initialize action controller here */ 
        } 
    
        public function indexAction() 
        { 
            $form = new Application_Form_login(); 
            $request = $this->getRequest(); 
            if ($request->isPost()) { 
                if ($form->isValid($request->getPost())) {
               
                } 
            }
            $this->view->form = $form;
        }
    }
    

    Any ideas on what the cause of this could be? As I said I am new to Zend so I don't really know where to start when it comes to these errors, especially as this is referencing files that were created by the Zend CLI tool.

    Any pointers/suggestions etc would be muchly appriciated.

    Dan.