Title: Deployment of Symfony 3.2 project to Strato
Tags: php;mysql;symfony
Question: I developed a Symfony project (version 3.2) with some data in a database (mysql). Development was done by using the local machine and XAMPP. Everything is ok so far.

Now comes the tricky part: deployment. I read all documentation. There are two options:


Upload the relevant source, migrate database and configure project by running composer scripts in prod on the server
configure via composer in prod environment, upload, migrate database.


(The only difference is where you run the scripts.)

The problem: with Strato both options are not working:

For option 1: I am not able to run the scripts on the server, I get a class not found exception even with "set SYMFONY_ENV=prod" (export command does not exist) before "php composer.phar install --no-dev --optimize-autoloader". 

Error:

```
  PHP Fatal error:  Class 'Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle' not found 
```

For option 2: Stratos rdbms.strato.de database server is not accessible from other machines.

Error:

```
  The test of the connection fails. The scripts are not finishing. 
```

I already searched here but I was not able to find anything. Does anyone know a solution?

Comment: That is right, I regret it already. But more important is finding some workaround.

Comment: If think you answered yourself this question. Running a symfony website on a shared hosting a NOT a good idea.


Here is another answer: Are you sure you cannot execute ```export``` command?
Is that some shared hosting limitation or...?

If you really cannot use that command, it seems to me that one workaround could be to remove bundles that do not belong to production environment from ```AppKernel.php``` (in your app on Strato)

That part of code looks like this:

```// AppKernel.php
if (in_array($this-&gt;getEnvironment(), ['dev'], true)) {
        $bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
        $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
        $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
        $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();

    }
```

Also, you will need to remove everything from ```config_dev.yml``` except:

```imports:
    - { resource: config.yml }
```

More about composer and symfony environment differences you can read here:
How does composer know symfony environment
Also, year ago I wrote a post about deploying Symfony on shared hosting, maybe it could help you some time in future :))
http://matkodjipalo.com/index.php/2016/05/19/installing-symfony-on-hostgator-shared-hosting/

Comment for this answer: Thanks for your comment! I tried everything I could. I decided to switch to a Strato V Server and now it is working.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2017:00:04/21/17', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<php><mysql><symfony>', 'Title': 'Deployment of Symfony 3.2 project to Strato', 'ViewCount': 710, 'id': 43546770, 'user_AboutMe': None, 'user_AccountId': 10738284.0, 'user_DisplayName': 'MutterOberin', 'user_Reputation': 1.0, 'user_Views': 1.0, 'user_id': 7902269.0}}