How to run laravel framework in visual studio?

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

How to run laravel framework in visual studio?

Postby bnsoft » March 20th, 2016, 11:00 pm

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"
bnsoft
 
Posts: 2
Joined: March 20th, 2016, 10:55 pm

Re: How to run laravel framework in visual studio?

Postby Miloslav Beno » March 22nd, 2016, 10:14 am

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,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1203
Joined: January 7th, 2012, 8:36 pm

Re: How to run laravel framework in visual studio?

Postby bnsoft » March 29th, 2016, 1:43 am

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
bnsoft
 
Posts: 2
Joined: March 20th, 2016, 10:55 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 3 guests

cron

User Control Panel

Login

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 5 minutes)
Most users ever online was 62 on January 7th, 2012, 10:54 pm

Users browsing this forum: No registered users and 3 guests
Phalanger