wrong PHP Path on Custom Server configuration

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

wrong PHP Path on Custom Server configuration

Postby Dirk L. » October 19th, 2018, 9:09 am

When I use a custom Server for my PHP Project (nginx) the Runtime PHP version is set to unknown.

When I now open a comand prompt or run the composer it uses PHP 5.6 even when my PHP project setting (Application tab) is set to 7.1
In the comand prompt I can see that the path 5.6 path was added before the regular path.
(When I use the IIS Express the PHP Version is correct)

How can I use nginx and make sure the project uses the PHP version from the Application setting?

Setup: VS Pro 2017, PHP Tools 1.29.10925, nginx, PHP 5.6, PHP 7.1 and PHP 7.2 installed, Project is Magento 2

Thanks for your help
Dirk L.
 
Posts: 2
Joined: October 19th, 2018, 8:39 am

Re: wrong PHP Path on Custom Server configuration

Postby mhpcc » October 19th, 2018, 10:52 pm

That's something you'll have to specify for the web server of your choice (nginx, apache, etc.) and not a setting in Visual Studio, I believe. When you use a custom web server and not IIS or PHP's built in web server, you'll be remote debugging the project (if even on the same machine).

Also keep in mind that nginx with FastCgi uses port 9000, so you'll have to specify a differnet xdebug port if you want to debug.
mhpcc
 
Posts: 22
Joined: October 19th, 2018, 10:46 pm

Re: wrong PHP Path on Custom Server configuration

Postby Dirk L. » October 26th, 2018, 12:56 pm

sorry I guess you got mo wrong.
I'm not talking about the php path for nginx. That's working fine.
Also the fastcgi is configured to an other port than 9000 in my nginx.conf

VS offers to open a command prompt that brigs you direct into the path where you open it. Unfortunately the path becomes changed by Php Tools.

When I use the build in Server the path is set to the configured PHP.
But when I use a custom Server it still changes the path but to the wrong PHP Version.
Dirk L.
 
Posts: 2
Joined: October 19th, 2018, 8:39 am

Re: wrong PHP Path on Custom Server configuration

Postby BiztechCS » February 12th, 2019, 12:12 pm

You can specify version in application `type` field like `"type": "php 5"`, or `"type": "php 7"`, or `"type": "php 7.0"`. Unit tries to match version against existing modules. If several versions match (e.g. 7.0.23 and 7.1.9 both match `php 7`), then the newest version will be used.

The same rule works if no version specified in the magento: the newest version against all existing modules is used
BiztechCS
 
Posts: 1
Joined: January 3rd, 2019, 12:40 pm
Location: India


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 37 guests

cron

User Control Panel

Login

Who is online

In total there are 37 users online :: 0 registered, 0 hidden and 37 guests (based on users active over the past 5 minutes)
Most users ever online was 227 on March 28th, 2024, 9:13 am

Users browsing this forum: No registered users and 37 guests