简体   繁体   中英

symfony prod still dev

I'm new at Symfony 2.8 and I can't seem to get my dev in production mode.

Allthough I ran the following commands:

to create the assets

php app/console assetic:dump --env=prod --no-debug

to clear the cache

php app/console --env=prod cache:clear

to warm up the cache

php app/console cache:warmup --env=prod --no-debug

If I'm right (which I'm probably not because it's not working) that should be it.

I've even tried setting $kernel = new AppKernel('prod', false); to $kernel = new AppKernel('prod', true); in app.php. But that didn't help either.

This production app runs on Ubuntu 14.04 with apache2 and php 5.5

Any help on this matter would be great.

2 things:

First you missed the right command:

php app/console assets:install --env=prod --no-debug

now it should work :)

2nd, in your url you access production env like this:

http://whatever/app.php

not

http://whatever/app_dev.php

Im guessing you must have this deployed on a server, rather than your local machine. app_dev.php won't run on a production server, by design. You can modify it, by adding your own IP address though, and then it will run.

Anyway, I've had this problem too. You're not actually in debug mode. It's just that something must have gone wrong in Symfony's build process because their stable versions are being suffixed by -DEV .

Check out the file Symfony/Component/HttpKernel/Kernel.php in the vendors directory. Look for const VERSION . It's value is probably like xxx-DEV .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM