Symfony2 - Assetic is not dumping any assets - symfony

I have two machines, a development machine running Windows and a production machine running Linux.
The problem I have is that Assetic is not deploying (or finding any) assets in the Linux production machine (neither in dev nor in prod mode). It was working in the previous deployment attempts, then all of a sudden it stopped without having changed anything in the system or the config.yml/config_prod.yml file.
The command I am using for dumping:
sudo php app/console assetic:dump --env=prod --no-debug
The assets have been defined in the bundles' public folders and have been installed beforehand and moved to the web folder with:
php app/console assets:install --symlink web/assets

FWIW, I found out that mthaml-bundle was causing the problem, which I am using in the project. Reverting to an older commit solves the problem, in the meantime I am going to report it.

Related

Symfony Production deployment has different css than debug

I am using symfony 2.8 but I don't think it matters for this question.
My production deployment is displaying a different version of the stylesheet than from debug environment.
What do I need to do to align production with debug?
Turns out my problem was when running the following command:
$ php app/console cache:clear --env=prod --no-debug
I would get a
ERROR 522 Validation failed : no DTD found
for one of my translations messages xliff
I removed that and ran the command again and then ran the server and my css was correctly being utilized.

moving a symfony2 project to another PC

I developed a project using symfony2/PHP and now I am willing to shift this project to another machine how can I do the same
I tried following
1)I copied project folder to www folder of another machine
2)I edited app\config\parameters.yml on another system
but is not working its giving different erros
Can any one tell me exact staeps
Moving the source and the database should be enough. It is possible, you may have to clean cache.
php app/console cache:clear
Try clearing cache; open console / terminal and type php app/console cache:clear
Try chmod / chown or if you are on a windows machine, try change the owner, check permissions
Try re-run: php composer.phar update
Check your php-version and extensions. (See: http://symfony.com/doc/current/reference/requirements.html)
Cleaning the cache worked for me.
type php app/console cache:clear

Assetic dump for prod mode doesn't work

I am using assetic for my assets management (see Symfony cookbook). My colleague which I am developing together runs this command to dump the assets
php app/console assetic:dump --env=prod --no-debug
which works fine. But when I run this command I get this output
$ php app/console assetic:dump --env=prod --no-debug
Dumping all prod assets.
Debug mode is off.
14:35:51 [file+] C:/path/to/myapp/app/../web/js/c49cee5.js
<compressed file contents ...>
followed by all the compressed JavaScript code. I mean this is displayed on my screen instead of dumping it into a file. This does not happen at my colleagues machine.
Note:
My colleague is running Max OSX, I am running Windows 7.
There is no problem with not finding Java.
Assets are dumped, when running command for dev environment.

Symfony2 trying to write to the previous server it was running on?

I've been developing a Symfony2 app locally and am now at the stage where I would like to deploy it in it's production environment on a server.
I've uploaded all my files and tried to run:
php app/console cache:clear --env=prod
Which gives the following error:
As you can see, it's trying to write to my C:/ drive for some reason. Doing a regular cache:clear works fine, but I can't swap it to the production environment.
At this point, trying to use the app.php version simply loads a blank page. I can't figure out why my app would be trying to write to a directory on a previous server.
Help?
Try empty the cache folder
rm -rf app/cache/*
After this the cache:clear --env=prod command work properly.

symfony 2, demo not working on remote server

I created fresh symfony 2 app which includes AcmeDemoBundle. It works fine.
I commented out in app_dev.php so that it can be accessed from remote server (openshift cloud). On localhost it works without any problem. I git pushed to openshift, and app_dev.php worked as expected.
Then I moved demo routes to route.yml (for production).
On localhost app.php worked without any problem. So I git pushed to openshift but then app.php threw an error:
failed to open stream Acme/DemoBundle/Resources/views/Welcome/index.html.twig
So, I put back demo routes to routes_dev.yml, git pushed, but openshift error persists.
What might be the problem?
EDIT: The problem is that on my localhost path to twig template is "/var/www/html/jba/php/src/JBA/MainBundle/Resources/views/Default/index.html.twig" but on openshift it still looks to the same directory. But openshift dir layout is different, so it can't find the template. I guess I have to configure openshift to look at right directory. Just don't know how.
Have you cleared the cache for the prod environment?
php app/console cache:clear --env=prod
You might also have a look at the server logs/ the sf2 logs within app/logs/prod.log if this won't help.
I issued the following commands before uploading, but somehow cache seems to be not cleared yet.
php /var/www/html/jba/php/app/console cache:clear --env=prod --no-debug
php /var/www/html/jba/php/app/console cache:clear
Only deleting prod and dev directories under app/cache explicitly helped.
See also
Symfony2: access same route in production as development

Resources