3

I've developed a sylius based site on a local server. I want to deploy it in production on my OVH server.

In the Sylius Sylius Cookbook, I did not find any particular procedure. So I followed the normal procedure.

  • Upload my code to the production server with a "git clone" of my git repository

  • Install my vendor dependencies "php composer install"But this step does not work because it never ends. At the end, I always have something like this:

Executing script cache:clear
 [Symfony\Component\Process\Exception\ProcessTimedOutException]
  The process "'/usr/local/php7.3/bin/php' '--php-ini=/usr/local/php7.3/etc/php.ini' './bin/console' --ansi cache:clear" exceeded the timeout of 20000 seconds.

I even tried "composer clearcache" before. It hasn't changed anything.

I am now trying "COMPOSER_PROCESS_TIMEOUT = 50,000". The "composer install" was sent 12 hours ago and is still not finished ...

Has anyone ever had this problem or know how to find a solution? Is there a special step to do when working with sylius? Because I really don't know what to do.

UPDATE: My main lead at the moment is that the problem would come from sylius because I am trying to create a new install of sylius with the symfony 4 structure like this

composer create-project sylius/sylius-standard

Same result:

Executing script cache:clear [Symfony\Component\Process\Exception\ProcessTimedOutException] The process "'/usr/local/php7.3/bin/php' '--php-ini=/usr/local/php7.3/etc/php.ini' './bin/console' --ansi cache:clear" exceeded the timeout of 20000 seconds.

I tried to run composer create-project with the --no-scripts flag and run php bin/console cache:clear separately after that. The bug reappears with the second command.

Tom Tom
  • 3,680
  • 5
  • 35
  • 40
lcgd
  • 45
  • 6
  • see this post: https://stackoverflow.com/questions/18917768/why-composer-install-timeouts-after-300-seconds – giovybus Apr 26 '20 at 13:01
  • Thank you for the answer. I had seen this post. I tried the different solutions. It didn't work ... I will continue. But I think that the problem com from sylius – lcgd Apr 26 '20 at 20:16

1 Answers1

2

You should first check that you are setting permissions right for your var folder, as per symfony install instructions.

You might also just be running out of resources on that server. Had the same issue on my last 1.7 project. The problem came from the cache:clear's warmup (probably because sylius has tons of dependencies and I added a bunch more). You might wanna try editing the composer.json "scripts" to:

"scripts": {
    "auto-scripts": {
        "cache:clear --no-warmup": "symfony-cmd",
        "assets:install %PUBLIC_DIR%": "symfony-cmd"
    },

Or, as you did per your update, run the install with the --no-script flag followed by bin/console cache:clear --no-warmup (do make sure you are installing the assets after that).

Cache will then be generated on your first visit to the website instead of being generated thru warmup.

This is a problem not just with the install, you'll have to use this workaround each time you wanna clear cache. My project is in production and working well using this, just gotta remember to visit the website once you did so that a random user doesn't have longer loading because the cache hasn't been generated yet.

Tom Tom
  • 3,680
  • 5
  • 35
  • 40