views:

555

answers:

2

I'm just setting up my test environment, a few questions.

  • I'm using MAMP, should my document root be pointed at the htdocs folder within MAMP?
  • MAMP currently uses the php.ini file that's in .:Applications/MAMP/conf/php5/php.ini, how do I get it to use a php.ini that's in my /var/www/projectname/ folder?
  • I'm getting the following error, is it simply because I don't have any controllers setup?

    Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in /Users/kieransenior/Development/reformsoft_dietron/trunk/var/www/dietron/include/Zend/Controller/Dispatcher/Standard.php:241 Stack trace: #0 /Users/kieransenior/Development/reformsoft_dietron/trunk/var/www/dietron/include/Zend/Controller/Front.php(934): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 /Users/kieransenior/Development/reformsoft_dietron/trunk/var/www/dietron/htdocs/index.php(7): Zend_Controller_Front->dispatch() #2 {main} thrown in /Users/kieransenior/Development/reformsoft_dietron/trunk/var/www/dietron/include/Zend/Controller/Dispatcher/Standard.php on line 241

Any smart noggins willing to lend a hand?

EDIT:

This is my httpd.conf which is in my var/www/proj folder

<VirtualHost *:*>
    ServerName localhost
    DocumentRoot /Users/kieransenior/Development/reformsoft_dietron/trunk/var/www/dietron/htdocs

    <Directory /Users/kieransenior/Development/reformsoft_dietron/trunk/var/www/dietron/htdocs>
        AllowOverride All
        Options All
    </Directory>

    php_value include_path .:/Users/kieransenior/Development/reformsoft_dietron/trunk/var/www/dietron/include:/usr/local/lib/pear
    php_value magic_quotes_gpc off
    php_value register_globals off
</VirtualHost>

That doesn't work though, so in my php.ini file I have the following:

include_path = ".:/Applications/MAMP/bin/php5/lib/php:/Users/kieransenior/Development/reformsoft_dietron/trunk/var/www/dietron/include"

But I don't want to do it that way, I want to be able to use httpd.conf. Are these just two methods of achieving the same thing?

A: 
  1. Honestly I don't remember because I use MAMP PRO. In MAMP PRO (and MAMP as far as I remember) you'll be able to change your document root. In MAMP PRO (only) you can create several virtual hosts.

  2. Instead of pointing MAMP at another file, edit the MAMP one, because MAMP does some changes to the file so that you have greater flexibility. Try having a look at File > Edit Template > PHP5 php.ini

  3. You haven't created any controllers in your Zend Framework installation. Because there is not exception catching set up pr. default, you're given a "Fatal error: uncaught exception" error.

In the hope that my answer was helpful.

phidah
MAMP PRO has been highly recommended, but I was wondering whether it was worth it for my development environment. I'll check this out when I get home.
Kezzer
When you've got multiple projects at the same time, MAMP PRO is very nice. Of course you could just install PHP / Apache / MySQL by yourselves, but thats not as easy :)Regarding the usage of MAMP PRO in production environments (since you refer to it being worth it for a development environment), I'd never recommend using MAMP PRO in a production environment. Instead go for a Linux/BSD box or OS X Server if you are totally Mac hooked :)Just my 5 cents.
phidah
+1  A: 

This error is thrown because an error occurs in your boostrap (index.php line 7) when trying to dispatch a request, and additionally you don't have an ErrorController defined.

Create a controller alongside your IndexController called ErrorController in file ErrorController.php

The ZF Reference guide has a section on the ErrorController (scroll down a little for code)

This should at least allow you to use the ErrorController to display the root cause of the problem!

David Caunt
This sounds promising, I'll try it out when I get home.
Kezzer