Page 1 of 1

How to run laravel framework in visual studio?

PostPosted: March 20th, 2016, 11:00 pm
by bnsoft
I am using Laravel framework, and normally I run the project
php artisan serve --port=XXXX;

Please give me a idea to run Laravel project with in VS
Also I have an error when I run php project in VS
I got error : The requested resource /?XDEBUG_SESSION_START=F7C6016


VS server setting
server: Built-in Web Server
runtime: php5.6.16 (user installation)
I configured file php.ini

[Xdebug]
zend_extension="C:\wamp64\bin\php\php5.6.16\ext\php_xdebug-2.4.0-5.6-vc11-nts.dll"
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 9000
xdebug.remote_mode = req
xdebug.idekey="php-vs"

Re: How to run laravel framework in visual studio?

PostPosted: March 22nd, 2016, 10:14 am
by Miloslav Beno
Hello,

Thank you for your post. There are several ways how to do this.

- You can just run the command in the command line and setup your project to use Custom server. You'd fill the url of the development server started by the command
- You can setup the external tool in the VS, so you don't need to start command line in order to start the server. You'd just go to
* Create External Tool in VS. Go to Tools | External Tools
* Command is path to php.exe you'd like to use
* Arguments are: -S localhost:43662 -t $(ProjectDir)\public $(ProjectDir)\server.php
* Then in project properties set: Use Custom Server

- The best way is however just to use our PHP Build-in web server support. As artisan server command is also deprecated in the lavarel 5.0.

In the project properties:
* Application tab: Setup WebRoot to public
* Server tab: PHP Build-in server and as router script use server.php

That should work.

Please let me know if that helped.

Thanks,

Re: How to run laravel framework in visual studio?

PostPosted: March 29th, 2016, 1:43 am
by bnsoft
I'm not seeing anywhere to set:

  • Custom Server external tool
  • PHP Build-in server
  • router script

Screenshots:

http://imgur.com/h2b8vGq
http://imgur.com/FeZRiPe