Page 1 of 1

Debugging with older version of PHP

PostPosted: May 30th, 2018, 4:02 am
by gerard789
Hi,

I have just installed this to trial it out. I am using VS 2017. But we have an old project that uses a lot of the (now deprecated, I now) mysql_ calls, instead of mysqli or POD. This means that we need to run this project with PHP 5.6. Each time I start up the project, I get the message that PHP 7.1 with debug extension is missing.
Can I install PHP 5.6 with debugging extension instead and then still debug? Will PHP Tools pick that up?

Thanks for your help.

Gerard

Re: Debugging with older version of PHP

PostPosted: May 30th, 2018, 9:18 am
by Miloslav Beno
Hello Gerard,

You can switch PHP version in the project properties (right click on project node in Solution Explorer), and switch the PHP version. Then save the solution. That should do it.

Please let me know if that helped.

Cheers!

Re: Debugging with older version of PHP

PostPosted: May 31st, 2018, 9:16 pm
by gerard789
Hi Miloslav,

Thanks for your help. I hadn't realised that option was there indeed. But when I do that I indeed get the popup that I need to install the debugger for PHP when I open Visual Studio, and for version 5.6. Unfortunately the Web Platform installer fails on installing. That seems to be a common thing for PHP 5.6, there is something wrong in that package and for some reason it does not get fixed.

Trying to install XDebug manually on Windows 10, (I already have PHP 5.6 on my laptop), tells me it is not supported for anything less than PHP 7.

So I am stuck again. Unless you have some pointers for how to install this manually. I have PHP 5.6.36 NTS for Windows installed already (in a folder C:\PHP5, which is also in my PATH).

Thanks,

Gerard

Re: Debugging with older version of PHP

PostPosted: June 6th, 2018, 6:26 pm
by Miloslav Beno
Hi Gerard,

Will take a look at PHP 5.6 auto install problem. Were you able to see what was the error when it failed?

For now you can go to Server tab in the project properties and you should see your installation in the Runtime combobox, if you don't. Just go to Tools | Options | PHP | Interpreter and click register new php path.

Thanks

Re: Debugging with older version of PHP

PostPosted: August 21st, 2018, 10:41 am
by gerard789
Hi, this has been a while, but I still have this problem.

The reason I am reopening this again is that I now have ported all the code to use mysqli or pdo only. And that means that I can now run this project in PHP 7.2.5, which is what I have installed.
I have also manually installed XDebug, following the instructions in https://xdebug.org/wizard.php, which told me to download a particular XDebug DLL, add it to the extension folder and add a line to my php.ini file.

I have done all this. I have also updated the PHP path in Tools > Options > PHP tools to point to the folder for PHP 7.2.5.

But still whenever I start my project, I get a warning that I am missing PHP 7.2 and Xdebug. When I say to resolve this, the web platform installer fails. It fails on download. It fails on downloading of PHP Helper from what it looks like to be a timeout, although the moment it fails is very hard to see, as the command window closes down straight away.

The status of while it is trying to download is, is showing in the uploaded image (attachment).

Are you guys still able to help me with this?

Many Thanks,

Gerard

Re: Debugging with older version of PHP

PostPosted: August 27th, 2018, 7:19 am
by Miloslav Beno
Hi Gerard,

If you've setup your PHP properly you can switch from our automatically installed PHP's by going to the project properties, select Server tab and change it from PHP Build in to Custom. This way we will not try to verify or automatically install PHP.

Anyway it's strange you cannot install PHP through Web Platform Installer. Could you please take a look at [url]%LocalAppData%\Microsoft\Web Platform Installer\logs\webpicmd[/url] - there are log files which would help us analyse why the installation has failed.

Thank you!