无法通过以下 MS 知识页面让我的 PHP Laravel 应用程序在 MS Azure 应用程序服务中工作



我能够按照Microsoft PHP教程页面https://learn.microsoft.com/en-us/azure/app-service/tutorial-php-mysql-app?pivots=platform-linux他们的示例应用程序还可以。但一旦我将自己的Laravel应用程序复制并上传,我的应用程序就无法运行,甚至没有主页(它在我的机器上本地运行(。

我觉得这部分有问题https://learn.microsoft.com/en-us/azure/app-service/configure-language-php?pivots=platform-linux#更改站点根"更改站点根…若要绕过此限制,请向您的存储库根目录添加一个.htaccess文件,其中包含以下内容。。。"Q: 它在谈论什么存储库根?

存储库的根目录是包含Laravel应用程序的主文件夹。即应用程序、数据库、配置等目录所在的主目录-.env、composer.json文件所在。

根据文档中的说明https://learn.microsoft.com/en-us/azure/app-service/configure-language-php?pivots=platform-linux#更改站点根目录,您需要在主文件夹中使用提供的代码创建.htaccess文件

# Laravel Project (directory structure)
|-app
|-config
|-database
|-public
|-resources
|-routes
|-storage
|-tests
|-.env
|-.gitattributes
|-.gitignore
|-.htaccess       # Create .htaccess at the root of Laravel project
|-artisan
|-composer.json
|-package.json
|-phpunit.xml
|-README.md
|-server.php
|-webpack.mix.js

最新更新