Assetic dump for prod mode doesn't work - symfony

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.

Related

How can I enable production mode in Symfony 4?

I have a copy of my Symfony 4 application on my server. When it is in developement mode it works fine.
In my .env file I have dev mode active:
APP_ENV=dev
But now I want my project on the server turn to production mode. So I changed the line to
APP_ENV=prod
But now I see only a blank page. The error log is not updated. What can I do? If I change the line back again to dev, everything works fine...
(I am on a shared host so I am not sure if this is Apache or Nginx)
I think you still have to clear (and if you want) warmup the cache of your new environment. You can do this from the command line:
php bin/console cache:clear
then
php bin/console cache:warmup

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.

Symfony2 - Assetic is not dumping any assets

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.

Symfony assetic dumps contents in console

When I run
php app/console assetic:dump
The contents of the files are dumped in the console and the files are not generated.
This happens with --env=prod and/or --no-debug. Being Windows, I cannot get to the top to see if there is even an error. Never had this before, what could it be?
PS: I'm using "symfony/assetic-bundle": "2.1.*"
I though Java was installed because PHPstorm was working, but I needed to install the JRE.

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.

Resources