I'm having the exact same issue. Did you ever get past this?
Deploying as an Azure Web App
I'm encountering a problem trying to deploy a fresh L5.2 app on Azure as a Web App. I configured deployment via a git push but it seems that the deployment hangs at php artisan clear-compiled until a timeout occurs.
[master]$ git push azure master
Password for 'https://[redacted]@[redacted].scm.azurewebsites.net:443':
Counting objects: 1, done.
Writing objects: 100% (1/1), 200 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
remote: Updating branch 'master'.
remote: Updating submodules.
remote: Preparing deployment for commit id 'db7b092bbd'.
remote: Running custom deployment command...
remote: Running deployment command...
remote: Install Dependencies with Composer
remote: .
remote: Loading composer repositories with package information
remote: Installing dependencies from lock file
remote: Nothing to install or update
remote: Generating optimized autoload files
remote: ..........................................................
remote: > php artisan clear-compiled
remote: ....................................................................................................................................................................................................
remote:
remote:
remote:
remote: [Symfony\Component\Process\Exception\ProcessTimedOutException]
remote: The process "php artisan clear-compiled" exceeded the timeout of 300 seconds.
remote: An error has occurred during web site deployment.
remote:
remote:
remote:
remote: install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...
remote:
remote:
remote:
remote: Error - Changes committed to remote repository but deployment to website failed.
To https://[redacted]@[redacted].scm.azurewebsites.net:443/[redacted].git
72a7f47..db7b092 master -> master
While all these is going on, the CPU on the Azure Web App host spikes to 100% and the Kudu admin is inaccessible. I believe that php artisan is running into a kind of CPU-intensive loop that prevents even the other w3wp.exe processes from running, but I am not sure.
This may be a shot in the dark as I believe not many of us deploy to Azure on Windows. But if anyone has any experience with this, help is appreciated!
I managed to get it to work on S1 by breaking up the steps performed in php artisan optimize into different scripts.
Digging into OptimizeCommand.php reveals that the optimize step performs two things in a production environment:
- Dumping an optimized composer autoloader (ie.
composer dump-autoload -o) - Compiling common framework classes and other classes as defined in
config/compile.php.
Because composer dump-autoload -o is already performed in the dependency installation step (note the Generating optimized autoload files output above) we do not need to redo this in OptimizeCommand.php. I created my own Command subclass to handle the common class compilation and ran it in Composer's post-install-cmd.
I have an example Laravel 5.2 project with the fixes applied in https://github.com/leejunkit/vashti. You can take a look at my composer.json and CompileCommonClasses.php.
Please or to participate in this conversation.