Adjust Your Document Root

Ok, there's just one more step before we can actually begin using our Zend Framework-powered website. Because the .htaccess and index.php files reside within the public directory, the public

120 CHAPTER 5 • INTRODUCING THE ZEND FRAMEWORK

directory must be identifiable by Apache as the website's document root and root directory. To change these settings, open your httpd.conf file and search for DocumentRoot. Until now the Document-Root directive has been set to C:\apache\htdocs\gamenomad, however now the public directory must serve as that root, so change this directive to read:

DocumentRoot "C:/apache/htdocs/gamenomad/public"

From there, scroll down about one-half page and you'll find another directive named Directory, with a preceding comment stating "This should be changed to whatever you set DocumentRoot to". Change this directory setting to read:

<Directory "C:/apache/htdocs/gamenomad/public">

Take care to change this specific Directory directive (the one with this particular preceding comment), as several other Directory directives exist throughout the httpd.conf file.

Save the httpd.conf file and restart Apache in order for these changes to take effect. Congratulations! The Zend Framework has been installed. To test the installation, proceed to the next step.

Adjusting Your Document Root on a Shared Host

Of course, if you're using the Zend Framework on a shared hosting provider, you almost certainly won't have access to the httpd.conf file. However you'll typically be able to change the Document-Root setting using some alternative administrative interface. For instance, my eApps (http://www. eapps.com/) control panel offers a "Custom Settings" interface which gives users the ability to override default web server settings, shown in Figure 5-3.

Custom Settings

DocumentRoot /home/webadmin/gamenomad. com/html/public

0 0

Post a comment

  • Receive news updates via email from this site