Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting Up Symfony 2 - Cannot Load app.php Resource

Tags:

symfony

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...

like image 664
Patrick Zabawa Avatar asked Aug 28 '11 14:08

Patrick Zabawa


4 Answers

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.

like image 165
ioleo Avatar answered Dec 03 '22 23:12

ioleo


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/*)

like image 37
lostboy Avatar answered Dec 03 '22 21:12

lostboy


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: .

like image 43
pcampr Avatar answered Dec 03 '22 21:12

pcampr


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.

like image 24
Jishnu G Nair Avatar answered Dec 03 '22 22:12

Jishnu G Nair