I spent several hours deploying my Symfony-based website to Wedos. I couldn’t find any clear step-by-step guide that actually worked, so I decided to write my own. I’m using Symfony 7.3.3.
Steps to prepare your application for production.
composer install --no-dev --optimize-autoloader
APP_ENV=prod APP_DEBUG=0 php bin/console cache:clear
php bin/console cache:warmup --env=prod --no-debug
php bin/console asset-map:compile
composer dump-env prod
Upload the following files to your server:
/config/, /src/, /templates/, /translations/, /public/, composer.json, composer.lock, .env.local.php, /vendor/
Wedos has quite strict rules regarding the use of .htaccess directives. Many of them are disabled, so here are the adjustments that helped me make my website work.
Symfony keeps its index.php file in the public folder, so you need to redirect requests there. I uploaded my project into /www/blog/.
RewriteCond %{HTTP_HOST} ^myblog.fck$ RewriteCond %{REQUEST_URI} !^/blog/public/ RewriteRule (.*) /blog/public/$1 [L]
This block should be placed right after “RewriteEngine On”.
You need to remove or comment out the following directives, as they are not allowed on Wedos.
<IfModule mod_negotiation.c> Options -MultiViews </IfModule>
Options +SymLinksIfOwnerMatch
If the public folder doesn’t have sufficient permissions, set 755 for directories and 644 for files.