简体   繁体   English

没有php artisan serve命令的Laravel服务器

[英]Laravel server without php artisan serve command

I am using Laravel for RestApi and use Angularjs for front-end. 我将Laravel用于RestApi,并将Angularjs用于前端。 I successfully build application in my system and deploy project to DigitalOcean Ubuntu VPS. 我在系统中成功构建了应用程序,并将项目部署到了​​DigitalOcean Ubuntu VPS。 When I serve a Laravel development server using php artisan serve command it start http://localhost:8000 server the api works fine if I turn off putty(use as DigitalOcean client) the Api not working. 当我使用php artisan serve命令为Laravel开发服务器提供服务时,它会启动http://localhost:8000服务器,如果我关闭腻子(用作DigitalOcean客户端),Api无法正常工作,则api可以正常工作。 This is use for development environment but now project running on VPS and RestAPI not working. 这用于开发环境,但是现在在VPS和RestAPI上运行的项目无法正常工作。 Please suggest me that how I use Laravel RestAPI in VPS without php artisan serve command. 请建议我,如何在不使用php artisan serve命令的情况下在VPS中使用Laravel RestAPI。

Check this article with the title "How To Install Laravel with Nginx on an Ubuntu 12.04 LTS VPS". 检查文章,标题为“如何在Ubuntu的LTS 12.04 VPS与Nginx的安装Laravel”。 That article should help you getting REST API working without PHP artisan serve . 那篇文章应该可以帮助您在没有PHP工匠serve情况下使用REST API。

Basically, php artisan serve is used to run PHP's built-in web server. 基本上, php artisan serve用于运行PHP的内置Web服务器。 When you are already using nginx, you don't need to run PHP's built-in web server. 如果您已经在使用nginx,则无需运行PHP的内置Web服务器。 So, you won't need to run php artisan serve . 因此,您无需运行php artisan serve

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

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