Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fahad's avatar
Level 7

Error in deploying laravel project

I am getting error in deploying laravel bibucket repo to the ms azure portal. From the log it says the following:


                                                                                                               
  [PDOException]                                                                                               
  SQLSTATE[HY000] [2002] An attempt was made to access a socket in a way forbidden by its access permissions.  
                                                                                                               


An error has occurred during web site deployment.
Script php artisan clear-compiled handling the post-install-cmd event returned with error code 1
Loading composer repositories with package information\r\nInstalling dependencies from lock file\r\n  - Removing phpspec/phpspec (2.3.0)\r\n  - Removing phpunit/phpunit (4.8.10)\r\n  - Removing phpunit/php-code-coverage (2.2.3)\r\n  - Removing phpunit/php-file-iterator (1.4.1)\r\n  - Removing phpunit/php-token-stream (1.4.8)\r\n  - Removing phpunit/php-timer (1.0.7)\r\n  - Removing phpunit/phpunit-mock-objects (2.3.8)\r\n  - Removing phpspec/prophecy (v1.5.0)\r\n  - Removing symfony/yaml (v2.7.5)\r\n  - Removing sebastian/comparator (1.2.0)\r\n  - Removing sebastian/environment (1.3.2)\r\n  - Removing sebastian/exporter (1.2.1)\r\n  - Removing sebastian/recursion-context (1.0.1)\r\n  - Removing laracasts/generators (1.1.1)\r\n  - Removing phpspec/php-diff (v1.0.2)\r\n  - Removing phpunit/php-text-template (1.2.1)\r\n  - Removing phpdocumentor/reflection-docblock (2.0.4)\r\n  - Removing doctrine/instantiator (1.0.5)\r\n  - Removing sebastian/diff (1.3.0)\r\n  - Removing sebastian/global-state (1.0.0)\r\n  - Removing sebastian/version (1.0.6)\r\n  - Removing mockery/mockery (0.9.4)\r\n  - Removing hamcrest/hamcrest-php (v1.2.2)\r\n  - Removing fzaninotto/faker (v1.5.0)\r\nGenerating optimized autoload files\r\n> php artisan clear-compiled\r\nScript php artisan clear-compiled handling the post-install-cmd event returned with error code 1\r\nD:\Program Files (x86)\SiteExtensions\Kudu\57.50831.2397\bin\Scripts\starter.cmd D:\home\SiteExtensions\ComposerExtension\Hooks\deploy.cmd



I don't know what is the error about ? Any help is highly appreciated

Thanks, Fahad

0 likes
1 reply
cberio's avatar

its been little late but seems worth to know who is still facing this isuue,

while deploying, sources will be stored in home\site\repository first and copy files into home\site\wwwroot. (you may find more details in home\stie\repository\storage\log\laravel.log)

in my case it occurred by test code like \Auth::loginUsingId(x); in route/web.php

of course there is no .env file in home\site\repository. (so above code will try to connect sqlite by default.)

Please or to participate in this conversation.