๐——๐—ฒ๐—ฝ๐—น๐—ผ๐—ท๐—ถ๐—ป๐—ด ๐—ฆ๐—ถ๐—บ๐—ฝ๐—น๐—ฒ ๐—ฆ๐˜†๐—บ๐—ณ๐—ผ๐—ป๐—ถ๐—ฒ ๐Ÿด ๐—ง๐—ผ ๐—ฐ๐—ฃ๐—ฎ๐—ป๐—ฒ๐—น: ๐—” ๐—ฆ๐˜๐—ฒ๐—ฝ-๐—•๐˜†-๐—ฆ๐˜๐—ฒ๐—ฝ ๐—š๐˜‚๐—ถ๐—ฑ๐—ฒ

You want to deploy your Symfony app to a shared hosting environment with cPanel and no SSH access. Here's how you can do it:

To start, double-check your code. Make sure everything is working as expected. You can use the dotenv:dump command to configure your environment variables. Run the command: APP_ENV=prod APP_DEBUG=0 php bin/console dotenv:dump

Next, install and update your vendors using: composer install --no-dev --optimize-autoloader. Then, clear your Symfony cache: APP_ENV=prod APP_DEBUG=0 php bin/console cache:clear

You may need to install the symfony/apache-pack using: composer require symfony/apache-pack. This creates the .htaccess configuration required for Symfony routing.

Update your composer.json file to override the public directory: "extra": {public-dir: "public_html" }

Build your assets using: symfony console tailwind:build and symfony console asset-map:compile

Update your Kernel.php file to define the project_dir:

public function getProjectDir(): string
{
    return \dirname(__DIR__);
}

Finally, upload the necessary files to cPanel:

Exclude unnecessary files and folders. Zip the selected files and upload them to cPanel.

Source: https://dev.to/ashrafchitambaa/deploying-symfony-8-to-cpanel-step-by-step-guide-4k5o