mehedi
mehedi

Reputation: 3

Fatal error: Class 'Zend_Application_Bootstrap_Bootstrap' not found when I browse to Bootstrap.php file

First of all I am a newbie. I installed zend framework in my wamp server successfulley. My include path is as follows:

include_path = ".;E:\wamp\bin\php\zend_framework\library"

I have create a project name "mehedi". But when I browse to my Bootstrap.php file in mehedi/application/ directory it shows the following error :

Fatal error: Class 'Zend_Application_Bootstrap_Bootstrap' not found in E:\wamp`\www\mehedi\application\Bootstrap.php on line 4`

When I browse to other php files except mehedi/public/index.php it shows some Fatal Error.

Is everything ok or I have missed something important.

Here is the application configuration in my mehedi/application/configs/application.ini file :

[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

[staging : production]

[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

Upvotes: 0

Views: 3875

Answers (1)

RockyFord
RockyFord

Reputation: 8519

If you set up your application using the Zend_Tool command line interface and it put the .htaccess file in the public folder, as is the default.
This behavior you described is to be expected. The ZF MVC routes all requests through the index.php file (except for resources like images, css and javascript). So if you can route to your Bootstrap.php file directly, then you worry.

All urls in ZF should be in the form www.example.com/moduleName/controllerName/actionName with the abiltiy to append parameters as required. Also note that the moduleName is optional and will default to the controllerName if no moduleName matches a route.

To test your installation use the url like: mehedi/public/index/ and you should see the default welcome screen. As you add controllers and actions you'll automatically add new url routes.

[EDIT] for example, if you add a controller called AdminController (if you add it with Zend_Tool it will be built with the indexAction() automatically). You will automatically be able to route to the AdminController/indexAction with a url of www.mehedi.com/admin/index and it would work. (in most applications index is specified as the default action so www.mehedi.com/admin would achieve the same result)

P.S. Do your self a favor and setup a virtul host it makes life so much easier

here is an example what your vhosts might look like, it's important to declare the localhost as the first vhost if you intend to use it.

httpd-vhosts.conf  with Include conf/extra/httpd-vhosts.conf enabled in httpd.conf
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
    DocumentRoot "C:\Zend\Apache2/htdocs" #I use Zend server, make this match your wamp setup
    ServerName localhost
#directory settings for localhost are typically defined in httpd.conf
</VirtualHost>
<VirtualHost *:80>
    DocumentRoot "E:/wamp/www/mehedi/public"
    ServerName www.mehedi.com
    ErrorLog "path/to/your/log/file"
  <directory "E:/wamp/www/mehedi">
      Options Indexes FollowSymlinks
      AllowOverride all
      Order Deny,Allow
      Deny from all
      Allow from 127.0.0.1
  </directory>
</VirtualHost>

it's important to remember this kind of vhost setup is intended to be used on a local dev machine or an internal network server, you would not want to do this on a production server unless you really know what you are doing.

Upvotes: 1

Related Questions