Search code examples
apachesymfonyproduction-environment

How to deploy Symfony app in shared server


I created a Symfony app following the documentation in https://symfony.com/doc/current/setup.html

And in my local server I use php bin/console server:run to server the app and everything was good.

But now that I want to deploy that app in a shared server that I use for small PHP apps (like corporate app without too many logic) I cannot make it work... In similar servers I have zend framework apps working correctly, but the symfony one is not working.

I notice that there isn't any index.php file in the root. It's a simple server with apache where I just drag the files through FTP (don't have SSH connection) but the server is not executing the php framework

Do i have to generate a build or something like that in order to mvoe the generated files to the server?


Solution

  • Well, finally it was much simpler solution that I was told. I just copy and pasted all the content of my project (including the public folder) in the public_html folder that was generated by my shared server.

    Then create an .htaccess in the public_html with the following content:

    RewriteEngine On
    RewriteRule .* public/index.php
    

    And that was all!