Page 1 of 1

wrong PHP Path on Custom Server configuration

PostPosted: October 19th, 2018, 9:09 am
by Dirk L.
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

Re: wrong PHP Path on Custom Server configuration

PostPosted: October 19th, 2018, 10:52 pm
by mhpcc
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.

Re: wrong PHP Path on Custom Server configuration

PostPosted: October 26th, 2018, 12:56 pm
by Dirk L.
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.

Re: wrong PHP Path on Custom Server configuration

PostPosted: February 12th, 2019, 12:12 pm
by BiztechCS
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