Comments (19)
Same problem here. Currently we can't deploy the application. It seems a problem with symfony though (as referenced).
from heroku-buildpack-php.
Has this been solved? I am having similar issues, but only on Heroku. Dev/Prod work fine in other environments.
from heroku-buildpack-php.
Two steps that help mitigate this:
- make sure you
heroku config:set SYMFONY_ENV=prod
before pushing - in
composer.json
'spost-install-cmd
list, move theclearCache
command to the very end
from heroku-buildpack-php.
@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.
@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.
@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.
Same problem here. Moving the clear:cache command to the end fixed it for me. Thank you @dzuelke
from heroku-buildpack-php.
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.
@dzuelke oh I see, thank you. I will double check.
from heroku-buildpack-php.
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.
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.
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.
Confirmed working, @fabpot. Good job. Go for it!
from heroku-buildpack-php.
@fabpot thank you for clarifying the version numbers
from heroku-buildpack-php.
👍
from heroku-buildpack-php.
2.3.23, 2.5.8, 2.6.1 are out. I think this issue can be closed now.
from heroku-buildpack-php.
Great, thanks 👍
from heroku-buildpack-php.
👍 Thanks guys! Worked flawlessly! (tested with 2.6.1 on heroku)
from heroku-buildpack-php.
I think this can be closed now?
from heroku-buildpack-php.
Related Issues (20)
- Prevent error "newrelic.transaction_tracer.enabled must be enabled in order to use distributed tracing" HOT 2
- Composer fails to run on linux-arm64 os HOT 6
- NGINX build with stub status module --with-http_stub_status_module HOT 1
- PHP 8.2 support HOT 1
- PHP 8.2.2 upgrade HOT 2
- v232 is not published in packagist.org HOT 7
- Composer hash changed so "Installer corrupt"?
- Warning: The "HEROKU_" namespace is protected and shouldn't be used. HOT 1
- Allowing skipping the installation of the webserver that is not used HOT 1
- PHP 8.3 support HOT 2
- Configure the AMQP CA path automatically HOT 1
- ext-newrelic segmentation fault, breaks site HOT 3
- Supporting Excimer
- Add support for FrankenPHP HOT 2
- setting php platform version ignored HOT 1
- PHP-FPM Worker Process Configuration Error, Fractional Worker Count Issue HOT 1
- Add support for ext-parallel HOT 1
- ZTS support
- cgroupsv2 support
- Support ARM64 when using Heroku-24 Docker images HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from heroku-buildpack-php.