Giter VIP home page Giter VIP logo

Comments (19)

desyncr avatar desyncr commented on July 18, 2024

Same problem here. Currently we can't deploy the application. It seems a problem with symfony though (as referenced).

from heroku-buildpack-php.

eddiejaoude avatar eddiejaoude commented on July 18, 2024

Has this been solved? I am having similar issues, but only on Heroku. Dev/Prod work fine in other environments.

from heroku-buildpack-php.

dzuelke avatar dzuelke commented on July 18, 2024

Two steps that help mitigate this:

  1. make sure you heroku config:set SYMFONY_ENV=prod before pushing
  2. in composer.json's post-install-cmd list, move the clearCache command to the very end

from heroku-buildpack-php.

desyncr avatar desyncr commented on July 18, 2024

@eddiejaoude This issue is present in heroku due to it's slug compilation and ephemeral filesystem.

When your app is compiled and all scripts ran (cache warm up, etc) this happens in /tmp/<random id>, and all cache with absolute path are generated pointing to that path.
But when the compilation finishes the app is located at /app and /tmp is cleared up. And due to heroku's ephemeral filesystem this can't be changed later on.

The issue is handled at symfony/symfony#10999 . If you need your app up and running in heroku you may use https://github.com/CHH/heroku-buildpack-php which I believe handles this issue https://github.com/CHH/heroku-buildpack-php/blob/master/frameworks/symfony2#L45.

from heroku-buildpack-php.

eddiejaoude avatar eddiejaoude commented on July 18, 2024

@desyncr Thank you for the detailed explanation. I tried the CHH build pack, but came across another issue with no routes being found (eg. always a 404). I will try again.

from heroku-buildpack-php.

desyncr avatar desyncr commented on July 18, 2024

@eddiejaoude CHH solution is not bulletproof. ie, it won't work with jms serializer as it's metadata is cached in a serialized format thus a simple string replacement will break the serialization.

from heroku-buildpack-php.

shql avatar shql commented on July 18, 2024

Same problem here. Moving the clear:cache command to the end fixed it for me. Thank you @dzuelke

from heroku-buildpack-php.

dzuelke avatar dzuelke commented on July 18, 2024

Do you have any routes defined for the prod environment, @eddiejaoude? If you just create a blank standard edition project with nothing else then there are no routes, and everything always 404s.

from heroku-buildpack-php.

eddiejaoude avatar eddiejaoude commented on July 18, 2024

@dzuelke oh I see, thank you. I will double check.

from heroku-buildpack-php.

eddiejaoude avatar eddiejaoude commented on July 18, 2024

Thanks @dzuelke . Ok, getting closer. Moving clear:cache to the end & put routes in prod, now I have a webpage 😄 . But there is not styling anymore from the Twitter Bootstrap Bundle Braincrafted\Bundle\BootstrapBundle\BraincraftedBootstrapBundle.

@desyncr Good to be aware of! Thanks.

from heroku-buildpack-php.

eddiejaoude avatar eddiejaoude commented on July 18, 2024

It seems in prod mode I need to run the following command php app/console assetic:dump. What is the best way to run this after (at the end of) a deploy? Thanks

from heroku-buildpack-php.

fabpot avatar fabpot commented on July 18, 2024

This issue should be fixed when symfony/symfony#12784 is merged. So, that would mean as of Symfony 2.3.23, 2.5.8, 2.6.1, and upcoming versions (2.7., 3., ...)

To make it happen fast, can anyone test this PR and report if that works? Thanks.

from heroku-buildpack-php.

dzuelke avatar dzuelke commented on July 18, 2024

Confirmed working, @fabpot. Good job. Go for it!

from heroku-buildpack-php.

eddiejaoude avatar eddiejaoude commented on July 18, 2024

@fabpot thank you for clarifying the version numbers

from heroku-buildpack-php.

smarques avatar smarques commented on July 18, 2024

👍

from heroku-buildpack-php.

fabpot avatar fabpot commented on July 18, 2024

2.3.23, 2.5.8, 2.6.1 are out. I think this issue can be closed now.

from heroku-buildpack-php.

eddiejaoude avatar eddiejaoude commented on July 18, 2024

Great, thanks 👍

from heroku-buildpack-php.

desyncr avatar desyncr commented on July 18, 2024

👍 Thanks guys! Worked flawlessly! (tested with 2.6.1 on heroku)

from heroku-buildpack-php.

eddiejaoude avatar eddiejaoude commented on July 18, 2024

I think this can be closed now?

from heroku-buildpack-php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.