6

I'm having trouble with setting up my Symfony2 production environment. The dev environment through app_dev.php works fine, but production through app.php leades to a 500 Internal Server Error, and this message in the Symfony error log:

[2011-08-28 10:09:11] request.CRITICAL: Symfony\Component\Config\Exception\FileLoaderLoadException: Cannot load resource ".". (uncaught exception) at /var/www/Symfony/vendor/symfony/src/Symfony/Component/Config/Loader/Loader.php line 75 [] []

Don't know how to solve this, or even stack trace it...

1
  • 4
    Can we see your production config.yml files for routing and general config? Commented Aug 28, 2011 at 14:20

6 Answers 6

8

Happened to me when I updated the Liip/ImagineBundle.

In older versions of this bundle it required this in your routing:

_imagine:
    resource: .
    type:     imagine

In the new versions this is to be replaced by:

_liip_imagine:
    resource: "@LiipImagineBundle/Resources/config/routing.yaml"

So in my case the problem was I updated the bundle via composer, but did not update the routing.yml.

Sign up to request clarification or add additional context in comments.

Comments

5

I had the same problem. Try to add:

assetic: use_controller: true

in /app/config/config_prod.yml and clean cache after that (rm -fr /app/cache/*)

2 Comments

Can you explain how does this help? and what could've changed that caused this problem and has to be solved by adding that config?
this is wrong, you don't want to use the assetic controllers in production, instead you need to dump your assets using app/console assetic:dump --env prod
4

if you have these problems in production environment and you use assetic, then check if you don't have this:

_assetic:
    resource: .
    type:     assetic

in your config file (normally this is in config_dev.yml only, not in production)... in other case try to check other routes with resource: .

1 Comment

This is in routing_dev.yml not config_dev.yml
1

I had faced a similar issue while hosting symfony2 project to a godaddy windows shared hosting with php5.3 support and fixed it by providing write permission to the symfony2 directories and creating an iis virtual directory for the symfony project directory.

Comments

0

For me this was caused because I wasn't sure where a blob of config was added to my config.yml and removed it because I didn't know what it did :)

So I downloaded a fresh copy of symfony2 and realized that the blob of code comes by default on a fresh install, so I put it back in and it all works. Here's what I had removed and I fixed the problem by putting it back in:

# Assetic Configuration
assetic:
    debug:          %kernel.debug%
    use_controller: false
    bundles:        [ ]
    #java: /usr/bin/java
    filters:
        cssrewrite: ~
        #closure:
        #    jar: %kernel.root_dir%/Resources/java/compiler.jar
        #yui_css:
        #    jar: %kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar

Comments

0

then answer is in the routing.yml

there is a resource in there that was probably disabled and the reference is left.

Comments

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.