Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php artisan optimize times out only on composer install

I'm running a laravel app on Azure. Things are moving in the right direction, composer install didn't use to work at all. Now however, the "php artisan optimize" command times out:

Running composer install makes php artisan optimize time out

However, running "php artisan optimize" separately is no problem at all:

Running only php artisan optimize is no problem

What could be the cause of this?

Edit:

Deleting the symfony-folder does not help, it is not present when I run the "Composer install"-command:

Symfony folder is not present

Increasing the timeout-limit does not help either, I increased it in both azure and in the composer.json file:

composer.json file Settings in Azure

This still gives me a timeout, after installing the symfony-components again:

Symfony installing

...

Arriving at php artisan optimize again

2000 second timeout

like image 935
Rkey Avatar asked Jan 21 '16 16:01

Rkey


1 Answers

As I deployed a new clean Laravel 5 application to Azure Web apps and tried to reproduce your issue, however, it worked fine on my side either I run the command php artisan optimize or composer install or composer update.

I installed the composer at the Site extensions at the KUDU console site of the application on Azure Web apps, the url should be like: https://<your_site_name>.scm.azurewebsites.net/SiteExtensions/#gallery

There are several solutions of other developers who occur the same issue with you, you can try these solutions:

  • try to increase the max_execution_time or set the value to 0, refer to https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-configure/#how-to-change-the-built-in-php-configurations to change the PHP build-in configurations on Azure Web Apps. And you can change the process-timeout in Composer.json file :

    "config" : { "process-timeout": 0 }

  • deleted the entire Symfony folder and try again. As the comments at PHP Artisan Optimize - Timed out? #1050, it seems the symfony dependencies raise the issue.

like image 106
Gary Liu Avatar answered Oct 17 '22 22:10

Gary Liu