Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux VPS apach Prod cookie consent not loading #116

Open
Claod44 opened this issue Feb 24, 2023 · 4 comments
Open

Linux VPS apach Prod cookie consent not loading #116

Claod44 opened this issue Feb 24, 2023 · 4 comments

Comments

@Claod44
Copy link

Claod44 commented Feb 24, 2023

Hello,

Everything is working in my localhost.

The bundle is enabled for "all" in bundles.php

But in my apache server it's only showing when turning into dev mode.

Prod render_esi is not including anything in my template... But when I dd('something'); in the asset controller, I have a 500 error in prod, so the request goes in it, I think it's trying to work but it fails somewhere. No luck trying to enable the profiler in prod...

Edit : Just tried to enable the prod mode on my localhost, the bundle loads just fine...
It's not working on my apache server in prod mode only.

Edit : I changed the firewall rule and replaced the render_esi by a html link with href. I got a 500 error. Not sure but it may be the apache url rewriting that is not working as it should... OR because I need to set form_action to a $routeName

Edit Apache may not like the dot in the route name ? Any help please

Any idea please ? :/

@Claod44
Copy link
Author

Claod44 commented Feb 25, 2023

Found the part of the code where something wrong appens when apache + app_env = prod :

    $response = new Response(
        $this->twigEnvironment->render('@CHCookieConsent/cookie_consent.html.twig', [
            'form'       => $this->createCookieConsentForm()->createView(),
            'theme'      => $this->cookieConsentTheme,
            'position'   => $this->cookieConsentPosition,
            'simplified' => $this->cookieConsentSimplified,
        ])
    );
    
    Something crashing in it.

@Claod44
Copy link
Author

Claod44 commented Feb 26, 2023

Edit : only working when I set the twig.yml :

twig:
cache: false

@Claod44
Copy link
Author

Claod44 commented Feb 26, 2023

Fixed...

Autorisations problems on ( symfony project directory )/var/cache/prod

Need to set chown, chgrp to www-data user
Then chmod 755, chmod 777

Now working. Twig wasn't able to write the cache.

@EndikaFidenet
Copy link

Any updates of why this happen or if there is another solution? i cant use chown or chgrp on my host provider, this is the only bundle failing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants