简体   繁体   English

如何在 Azure Web App 中部署 PHP Lumen API 代码

[英]How to deploy PHP Lumen API Code in Azure Web App

I want to deploy lumen code in Azure Web App Service.我想在 Azure Web 应用服务中部署 lumen 代码。 I am following this link to create PHP Web App in Azure App Service.我正在按照此链接在 Azure 应用服务中创建 PHP Web 应用。 I am able to create and launch simple Hello World Application as mentioned here.我能够创建和启动这里提到的简单的Hello World应用程序。

Now, I want to deploy actual Lumen code in Azure App.现在,我想在 Azure 应用程序中部署实际的 Lumen 代码。 I cloned lumen application using composer create-project --prefer-dist laravel/lumen myfolder command and trying to serve the application using php -S localhost:8000 -t public (used my azure server name instead localhost:8000 ) command.我使用composer create-project --prefer-dist laravel/lumen myfolder命令克隆了 lumen 应用程序,并尝试使用php -S localhost:8000 -t public (使用我的 azure 服务器名称而不是localhost:8000 )命令为应用程序提供服务。 But It is not working.但它不起作用。

How to deploy and How to serve this Application in server?如何部署以及如何在服务器中提供此应用程序?

Maybe you need to set the default page?也许您需要设置默认页面? Please show the details of what you get.请显示您所获得的详细信息。

After you deploy the app, it should works.部署应用程序后,它应该可以工作。

Try this:试试这个:

Move your lumen application outside public_html.将您的流明应用程序移到 public_html 之外。
Move your index.php file in subdomain.在子域中移动您的 index.php 文件。
Edit index.php set route to your subdomain编辑 index.php 设置路由到您的子域

Command for different host:不同主机的命令:

php -s localhost:8000 -t public/

used your azure server name instead of localhost:8000使用您的 azure 服务器名称而不是 localhost:8000

Sometimes Php artisan serve not work properly so you can use有时 PHP 工匠服务无法正常工作,因此您可以使用

http://localhost/here_project_name/public/

Please refer: https://www.tutsmake.com/laravel-command-php-artisan-serve-not-working-properly/请参考: https : //www.tutsmake.com/laravel-command-php-artisan-serve-not-working-properly/

For Deploy Laravel Lumen on Azure Web App用于在 Azure Web 应用程序上部署 Laravel Lumen

Please refer: https://medium.com/swlh/deploy-laravel-5-8-on-azure-web-app-2019-3514eb2fd1af请参考: https : //medium.com/swlh/deploy-laravel-5-8-on-azure-web-app-2019-3514eb2fd1af

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM