apache - Symfony Heroku Deployment: Assets Not Accessible -
i have symfony 2.7 app works fine in local dev environment , on aws ubuntu ec2 instance. i'm migrating heroku , i'm able login, web asset (css/img/js) requests result in 403 (forbidden)
in browser console.
the heroku logs show, example:
ah00037: symbolic link not allowed or link target not accessible
in composer.json
, under 'extra' node, have:
"symfony-assets-install": "symlink"
i'm not using assetic.
things i've tried
running heroku run bash
, heading app's web directory, see:
~/web/bundles $ ls -la lrwxrwxrwx 1 u46658 46658 85 jun 24 13:56 mybundle -> /tmp/build_0940aedabf55a47c5c407ff7b7a58c58/src/myapp/mybundle/resources/public
however can't cd
mybundle
directory, nor /temp/...
directory ('no such file or directory').
as appears because apache isn't following symlinks, tried php app/console assets:install
, yielded 'installing assets hard copies', , cleared cache (with app/console cache:clear
) problem remained same. php app/check.php
gives me a-ok.
any ideas, or more information can provide?
try changing
"symfony-assets-install": "symlink"
to
"symfony-assets-install": "relative"
For deploying symfony on an infrastructure, I would recommend you to use Cloudways Symfony hosting (https://www.cloudways.com/en/symfony-hosting.php ) platform instead. Using this platform, you can instantly launch a cloud server and deploy your symfony app on it through git or sftp.
ReplyDelete