This video covers the code found in the Zend Quickstart guide for creating the bootstrap file. I create the index.php file which will handle all the browser requests to the Zend Framework.
Make an index file for a Zend Framework project
Description
This video covers the code found in the Zend Quickstart guide for creating the bootstrap file. I create the index.php file which will handle all the browser requests to the Zend Framework.
Tags
bootstrapping, index, quickstart, Zend

Hi. Thanks, It’s more interesting then read documentation
But, maybe ‘APPLICATION_ENVIRONMENT’ define in ‘index.php’ because this constant will work and using in all project.
And in end ‘index.php’ error in close tag – ‘html’.
And maybe you on ‘line number’ in NetBeanst – this easy commenting.
hmm… i got afew qns…
- how do i know what goes into the bootstrapper and what goes into the index file? they seem to be something like an init function
- since $frontController is unset why bother to set properties in it? isit becos its something like setting those things into Zend_Controller_Front “static object”?
- frontController in index and bootstrapper are different… i dun really understand this …
- any differences bet APPLICATION_PATH in bootstrap.php and index.php. they are set to different values index uses realpath()
Hi iceangel89,
– bootstrapping is something that should be the same for requests from the command line (say a cron job invoking parts of your ZF app or unit tests). the Index file is more concerned with web requests. This definition is still a little muddy (the latest version of the ZF template in Zend Studio even has an “initialize” php file). Bootstrapping has been a bit of sore spot for the ZF in terms of standardization. Zend_Application (in the incubator) is aiming to resolve these issues.
- the front controller is the landing point for your app before it gets routed to a particular controller in a Zend MVC application. we unset the variable so that there’s no variable collisions. ZF folks are pretty dogmatic about making sure there are no global variables lying around. Static variables are used as a way of keeping variables associated with a class, rather than just floating in php space without any owner.
- for your last two points, I agree that there’s a lack of clarity here in the quickstart guide. I would stick to the conventions for now and let the dust settle, unless I’m missing something in my tutorial…
Hi, i think it will be good if there’s tutorials about ZF 1.8. i think the bootstrapping and the index page is still the most confusing
there’s plenty of confusion about those two parts of the Zend Framework, but I think I’ll wait until the dust settles over at Zend before making any videos explaining how it works.
hello jon
I set all the DIRECTORY structure in WAMP but i m still getting the error
Notice: Zend_Loader::Zend_Loader::registerAutoload is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in C:\wamp\www\zc\library\Zend\Loader.php on line 207
Warning: require(../application/bootsrap.php) [function.require]: failed to open stream: No such file or directory in C:\wamp\www\zc\public\index.php on line 16
Fatal error: require() [function.require]: Failed opening required ‘../application/bootsrap.php’ (include_path=’C:\wamp\www\zc\public/../library;.;C:\php5\pear’) in C:\wamp\www\zc\public\index.php on line 16
will you please help me to sort out the problem ..
my folder structure is
c:\wamp\www\zc\application
c:\wamp\www\zc\library
c:\wamp\www\zc\public\index.php
Hi Lokesh, I suggest looking at my most video with the 1.8 version of the Zend Framework. Things have changed quite a bit when it comes to bootstrapping and setting up your Zend Framework application. The episode from last week should be a little more helpful to get you up and running.
Best!
Jon
Hi Jon,
Thanks a lot for your great videos! They’re realy much helpfull. Keep the awesome work up!
Have a nice day.
Harry
Just one little thing. You must write error_reporting(E_ALL | E_STRICT) instead of error_reporting(E_ALL || E_STRICT).
very fine good help
Hey Jon,
Outstanding videos!
BUT: as a total beginner, I have no clue where to start.
the only “order” in this site is that tag cloud on the right side. (or am i missing something?)
can you please suggest a list of videos to watch? (first: this, then this…)
Thanks,
Ron
Hey Ron,
I would suggest starting with the introduction to 1.8: http://www.zendcasts.com/introduction-to-zend-18-a-look-at-zend_tool-and-bootstrapping/2009/05/
that should get you up and running. If you still have questions, post them on the forum – http://www.zendcasts.com/forum and we’ll try and answer em there!
best,
-
Jon
Hi there,
I think there is something missing here, because I always getting 404 pages, because the public folder where the actual index.php is placed is not referenced whether in a .htaccess or httpd.conf file
r. Sandor
Great info Tawfek, and your English is fine, not a problem at all.
I found the video at http://www.vimeo.com/6374887 to be much better quality than here – available in HD also if anyone has trouble reading the text.
Many Thanks,
Darren.
Hi Tawfekow
Appreciate the efforts with the video guide – thank you.
So far I’ve done the following on my Windows 7 x64 box, WampServer 2.0, rewrite_module enabled :
—–
Added 127.0.0.1 dev.local
To – C:\Windows\System32\drivers\etc\hosts
—–
Edited httpd.conf
To –
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
—–
Edited httpd-vhosts.conf
To
#again define loalhost
NameVirtualHost localhost:80
DocumentRoot C:/wamp/www
ServerName localhost
ServerAlias localhost
#first Domain
NameVirtualHost dev.local
ServerName dev.local
ServerAlias dev.local
DocumentRoot C:\Sites\zfapp\public
ErrorLog “C:\Sites\zfapp\public\error.log”
CustomLog C:/Sites/zfapp/public/access.log common
Options -Indexes FollowSymLinks Multiviews
AllowOverride All
Order allow,deny
Allow from all
—–
#Deny from all
—–
Edited php.ini:
short_open_tag = On
include_path = “.;c:\php\includes;C:\wamp\www\frameworks\zend1108\library;C:\Sites\zfapp;C:\wamp\www\frameworks\zend1108\library\Zend”
(wasn’t sure which folder to try for Zend so I tried a couple)
—–
I also added
;C:\wamp\www\frameworks\zend1108\bin; to the System Environment Path Variable
—–
Unfortunately, when we get to 9 minutes 34 seconds in the video, your ZF works with a ‘Welcome To Zend Framework’window up, and mine doesnt – I still get the forbidden for http://dev.local. (http://localhost is still fine)
Maybe my problem is that I haven’t managed to get ZF installed yet? I’ve tried running the Command Prompt as Administrator, CD to C:\wamp\www, then C:\wamp\www>C:\wamp\www\frameworks\zend1108\bin\zf.bat create project testproject.
No directory is created inside C:\wamp\www.
—–
When I look at errors inside C:\Sites\zfapp\public, I see:
[Tue Aug 31 15:26:28 2010] [error] [client 127.0.0.1] Directory index forbidden by Options directive: C:/Sites/zfapp/public/
—–
Any help greatly appreciated on this one!
Thanks,
Darren.
Thanks for the tutorial.
I’m a little bit confused why you spent more than half of video to configuring local hostname?
This totally confuses.
Also, the video is not clear and it is impossible to see what is typed.
Hey Alex,
this is one of the earliest tutorials I did for zendcasts. much of the approach is no longer necessary now that we have Zend_Tool. I suggest looking at the introduction to Zend 1.8 video: http://www.zendcasts.com/introduction-to-zend-18-a-look-at-zend_tool-and-bootstrapping/2009/05/
Hi Jon,
i am using Wamp
I have set up the framework and created bootstrap & index file as told in video.
But wen i try load index file in browser I am getting
blank page, instead of any errors as told in video
when i tried to echo echo APPLICATION_PATH.’/../library’.PATH_SEPARATOR.get_include_path();
it gave me
C:\wamp\www\zc\public/../library;.;C:\php5\pear in browser
This is how added code for index.php and bootstrap.php
http://pastebin.com/FMU2ysVH
and this is my project folder location
C:\wamp\www\zc\public
Thanks in advance for any help
Hi,
I’m totally new to this framework and PHP. I followed each step in this video. However if I go to http://localhost I get the XAMPP home page. I need to go http://localhost/zc/public to reproduce the error page that was shown in the last part of the video.
I’m using XAMPP, Netbeans 7.1
Kind of strange that it would work even with the alternative spelling of “excepion”. Not just picking on typo’s, here, but trying to understand why this doesn’t make it all go wrong.