Debugging with older version of PHP

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

Debugging with older version of PHP

Postby gerard789 » May 30th, 2018, 4:02 am

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
gerard789
 
Posts: 3
Joined: May 30th, 2018, 3:56 am

Re: Debugging with older version of PHP

Postby Miloslav Beno » May 30th, 2018, 9:18 am

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

Re: Debugging with older version of PHP

Postby gerard789 » May 31st, 2018, 9:16 pm

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
gerard789
 
Posts: 3
Joined: May 30th, 2018, 3:56 am

Re: Debugging with older version of PHP

Postby Miloslav Beno » June 6th, 2018, 6:26 pm

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

Re: Debugging with older version of PHP

Postby gerard789 » August 21st, 2018, 10:41 am

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
You do not have the required permissions to view the files attached to this post.
gerard789
 
Posts: 3
Joined: May 30th, 2018, 3:56 am

Re: Debugging with older version of PHP

Postby Miloslav Beno » August 27th, 2018, 7:19 am

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


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 46 guests

cron

User Control Panel

Login

Who is online

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

Users browsing this forum: No registered users and 46 guests