2009/8/9 Steven Szymczak <sc.szymc...@googlemail.com>:
> I echoed the contents of $path (from Application.php:290), and created a
> test script using the output.
>
> test.php
> --------
>
> require_once '/Users/Steven/Sites/farstrider.eu/application/Bootstrap.php';
>
> Running test.php produced the following error:
>
> Fatal error: Class 'Zend_Application_Bootstrap_Bootstrap' not found in
> /Users/Steven/Sites/farstrider.eu/application/Bootstrap.php on line 3
>
> Which shows that Bootstrap.php exists and is readable.
>
> HOWEVER, I noticed that the error being produced by my ZF application shows
> spaces before and after the include path:
>
> Warning: require_once(
> /Users/Steven/Sites/farstrider.eu/application/Bootstrap.php )
>
> When I put the spaces into my test script, it breaks with the same error.
>
> So now the question is: why/where are those spaces getting into the path?
>  As can be seen from the files I've posted previously, such spaces are
> absent in my code.
>
> Pádraic Brady wrote:
>>
>> It must be something obvious - this isn't a Zend_Application error. It's
>> PHP itself telling you it can't find the file - so it's not something
>> framework related. The error clearly states this file could not be found:
>>
>> /Users/Steven/Sites/farstrider.eu/application/Bootstrap.php
>>
>> Either it's there, and readable, or it's not there. You can check with any
>> plain PHP script with a require statement to replicate this. If the path is
>> correct, then Zend_Application is doing nothing wrong.
>>  Pádraic Brady
>>
>> http://blog.astrumfutura.com
>> http://www.survivethedeepend.com
>> OpenID Europe Foundation Irish Representative
>> <http://www.openideurope.eu/>
>>
>>
>> ------------------------------------------------------------------------
>> *From:* Steven Szymczak <sc.szymc...@googlemail.com>
>> *To:* Pádraic Brady <padraic.br...@yahoo.com>; fw-general@lists.zend.com
>> *Sent:* Sunday, August 9, 2009 3:13:48 PM
>> *Subject:* Re: [fw-general] Zend/Application.php failing to open
>> Bootstrap.php
>>
>> The /application directory is not on the include path, but it shouldn't
>> need to be as Application.php is trying to include Bootstrap.php with the
>> full path (i.e.
>> /Users/Steven/Sites/farstrider.eu/application/Bootstrap.php).
>>
>> My config file is as follows:
>>
>> application.xml
>> ----------------
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>>
>>
>>  <production>
>>    <phpSettings>
>>      <display_startup_errors>0</display_startup_errors>
>>      <display_errors>0</display_errors>
>>    </phpSettings>
>>    <!-- <includePaths>
>>      <app>
>>        <zf:const zf:name="APPLICATION_PATH" />
>>      </app>
>>    </includePaths> -->
>>    <bootstrap>
>>      <path>
>>        <zf:const zf:name="APPLICATION_PATH" />/Bootstrap.php
>>      </path>
>>      <class>Bootstrap</class>
>>    </bootstrap>
>>    <resources>
>>      <frontController>
>>        <controllerDirectory>
>>      <zf:const zf:name="APPLICATION_PATH" />/controllers
>>    </controllerDirectory>
>>      </frontController>
>>    </resources>
>>  </production>
>>    <dev zf:extends="production">
>>    <phpSettings>
>>      <display_startup_errors>1</display_startup_errors>
>>      <display_errors>1</display_errors>
>>    </phpSettings>
>>  </dev>
>> </application>
>>
>> Cheers,
>> -- Steven
>>
>> Pádraic Brady wrote:
>>  > I can't see from the error message, but is the /application directory
>> added to the include_path? Shouldn't this be done in index.php before the
>> Bootstrap class is needed. I'm not sure, but I don't think you can add this
>> path using the Zend_Application configuration file. It's also very hard to
>> see how the Bootstrap class and path is made known to Zend_Application - can
>> you post the config file showing the settings used for the bootstrap prefix,
>> i.e. bootstrap.path and bootstrap.class
>>  >  Pádraic Brady
>>  >
>>>
>>>  http://blog.astrumfutura.com
>>>  http://www.survivethedeepend.com
>>>  OpenID Europe Foundation Irish Representative
>>
>> <http://www.openideurope.eu/>
>>  >
>>  >
>>  >
>> ------------------------------------------------------------------------
>>  > *From:* Steven Szymczak <sc.szymc...@googlemail.com
>> <mailto:sc.szymc...@googlemail.com>>
>>  > *To:* Ruslan Zavackiy <ruslan.zavac...@gmail.com
>> <mailto:ruslan.zavac...@gmail.com>>; fw-general@lists.zend.com
>> <mailto:fw-general@lists.zend.com>
>>  > *Sent:* Sunday, August 9, 2009 1:01:51 PM
>>  > *Subject:* Re: [fw-general] Zend/Application.php failing to open
>> Bootstrap.php
>>  >
>>  > The full path is correct, and the file/class name is "Bootstrap" with
>> an upper case "B".
>>  >
>>  > Ruslan Zavackiy wrote:
>>  >  > Check for Bootstrap.php to be exactly with uppercase, not
>> bootstrap.php and check full path for this also
>>  >  >
>>  >  > Best regards,
>>  >  > Ruslan zavackiy.
>>  >  >
>>  >  > On 2009.9.8, at 02:04, Steven Szymczak <sc.szymc...@googlemail.com
>> <mailto:sc.szymc...@googlemail.com> <mailto:sc.szymc...@googlemail.com
>> <mailto:sc.szymc...@googlemail.com>>> wrote:
>>  >  >
>>  >  >> I'm trying to update my site to make use of Zend_Application, and
>> I've set everything up according to the QuickStart and Zend_Application
>> docs, but all I get is the following error:
>>  >  >>
>>  >  >> "Warning: require_once(
>> /Users/Steven/Sites/farstrider.eu/application/Bootstrap.php )
>> [function.require-once]: failed to open stream: No such file or directory in
>> /Users/Steven/Sites/farstrider.eu/library/Zend/Application.php on line 290
>>  >  >>
>>  >  >> Fatal error: require_once() [function.require]: Failed opening
>> required ' /Users/Steven/Sites/farstrider.eu/application/Bootstrap.php '
>> (include_path='/Users/Steven/Sites/farstrider.eu/library:.:/php/includes:/usr/local/php/lib/php')
>> in /Users/Steven/Sites/farstrider.eu/library/Zend/Application.php on line
>> 290"
>>  >  >>
>>  >  >> Even though Bootstrap.php does indeed exist in the application/
>> directory, and all permissions are correctly set.
>>  >  >>
>>  >  >> I'm using ZF 1.9, and my application/Bootstrap.php and
>> public/index.php files are as follows:
>>  >  >>
>>  >  >> Bootstrap.php
>>  >  >> -------------
>>  >  >>
>>  >  >> <?php
>>  >  >>
>>  >  >> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
>>  >  >> {
>>  >  >>
>>  >  >> }
>>  >  >>
>>  >  >> 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'));
>>  >  >>
>>  >  >> // Set include path
>>  >  >> set_include_path(implode(PATH_SEPARATOR,
>> array(dirname(dirname(__FILE__)) .'/library', get_include_path(),)));
>>  >  >>
>>  >  >> // Zend Application
>>  >  >> require_once 'Zend/Application.php';
>>  >  >>
>>  >  >> // Create application, bootstrap, and run
>>  >  >> $application = new Zend_Application(APPLICATION_ENV,
>> APPLICATION_PATH .'/config/application.xml');
>>  >  >> $application->bootstrap()->run();
>>  >  >>
>>  >  >> Any ideas?
>>  >  >>
>>  >  >> -- スティーブン
>>  >  >>
>>  >
>>  > -- スティーブン
>>  >
>>
>> -- スティーブン
>>
>
> --
> スティーブン
>
>

This is a wild guess but what happens if you replace

  <bootstrap>
     <path>
       <zf:const zf:name="APPLICATION_PATH" />/Bootstrap.php
     </path>
     <class>Bootstrap</class>
  </bootstrap>

with this (no new lines):

<bootstrap>
     <path><zf:const zf:name="APPLICATION_PATH" />/Bootstrap.php</path>
     <class>Bootstrap</class>
</bootstrap>

-- 
Regards,
Martin Martinov
http://mmartinov.com/

Reply via email to