laravel 5.1 on windows azure web application

前端 未结 1 1370
無奈伤痛
無奈伤痛 2020-12-22 13:05

I want to deploy a laravel app on my azure web application

but that return this error

HTTP Error 500.0 - Int         


        
相关标签:
1条回答
  • 2020-12-22 13:48

    Actually, Azure Web site’s root directory is site\wwwroot, when we are deploying projects from Github to Azure Web Apps, Azure will automatically move the project to the root path site\wwwroot. So it is not necessary to change the root directory.

    On my side, I cloned your project, deployed it on Azure by git, and browsed the URL <site_name>. azurewebsites.net/public to check project. I got the error message about the project couldn’t find the file vendor/autoload.php, so it looks like the project was lack of dependence.

    I installed composer as the article you provided told in KUDU Console site. The URL should be https://<your_site_name>.scm.azurewebsites.net/ (first installed composer, we need to restart the console site).

    Then click “Debug console”=>”CMD” at the header navigation of the console site to enter in command line tool, change directory to D:\home\site\wwwroot and run composer install, after finishing installation, we browse <site_name>.azurewebsites.net/public again, and it works well.

    To set the URL rewrite to remove the “public”, we can simply modify “site\wwwroot” to “site\wwwroot\public” at virtual applications and directories section in Azure portal.

    In addition you may want PHP project to show detailed errors during testing. By default, “display_errors” is off, we can simply create a file named “.user.ini” in the root directory and wirte “display_errors = on” in this file. Please read this article for more information.

    0 讨论(0)
提交回复
热议问题