1

I have the following configuration in application.ini

[www.domain.com : default]
environment = production

It works fine with www but not without www. When I try without www then I get the following error message.

Fatal error: Uncaught exception 'Zend_Config_Exception' with message 'Section 'domain.com' cannot be found....in /home/user/public_html/domain.com/public/application/configs/application.ini'  

Now I am bit confused if this is causing because of dns settings or virtual hosts file.

In virtual host configuration file contains the following

<VirtualHost *:80>
        ServerName domain.com
        ServerAlias www.domain.com
        ErrorLog /home/user/public_html/domain.com/log/error.log
        CustomLog /home/user/public_html/domain.com/log/access.log combined
        DocumentRoot "/home/user/public_html/domain.com/public/web"
        SetEnv APPLICATION_ENV "production"
                <Directory "/home/user/public_html/domain.com/public/web">
                        Options Indexes MultiViews FollowSymLinks
                        DirectoryIndex index.php
                        AllowOverride All
                        Order allow,deny
                        Allow from all
                </Directory>
</VirtualHost>

Please suggest. Any help if highly appreciated.Thanks in advance.

1 Answer 1

1

This is not related to DNS or your vhost. It's an INI issue. As far as ZF is concerned, there is no domain.com section of application.ini. There's just a www.domain.com section. In this particular case since you only have one setting to be inherited, here is a simple solution...

[www.domain.com : default]
environment = production

[domain.com : default]
environment = production
Sign up to request clarification or add additional context in comments.

2 Comments

In my case it only works in this way [default] variables... then [domain.com : www.domain.com] and next I had to add [www.domain.com : default] environment = production
No problem, Raj. I still don't understand how your solution doesn't result in an error, but the important thing is that it's working for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.