CLI has stopped working

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

CLI has stopped working

Postby codeowl » February 13th, 2013, 6:44 am

Hi there,

I have been debugging using PHP Tools for a couple of days now, and generally it has been going well.
As of about 10 mins ago, every time I debug my project, I get the following error dialogue appear:
Title: CLI
Message: CLI has stopped working

If I debug with no break points set, I do not get this error. But if I set a break point it happens every time, and the only buttons on the dialogue are Debug, and Close Program. When I choose Debug it says A debugger is attached to php.exe but not configured to debug this unhandled exception. And when I close the program it stops the server.
I have tried restarting VS, and even rebooting windows, but I get this same error every time.

I am using PHP 5.4.3 that comes with WAMP Server 2.2
I am running VS2012 Ultimate. How can I resolve this issue, and get back to work?

Regards,

Scott
codeowl
 
Posts: 51
Joined: February 10th, 2013, 10:05 am

Re: CLI has stopped working

Postby Miloslav Beno » February 13th, 2013, 1:04 pm

Hi Scott,

This seems as a bug of PHP itself. I've googled a little bit and found this http://stackoverflow.com/questions/1671 ... ed-working There are some possible causes mentioned...

Another thing that comes into mind is if you have your WAMP installed, but in project settings you are using PHP 5.4 bultin server that would mean we are trying to run php on our own instead of WAMP. In this case try to change your project settings to use Custom server settings. You just have to introduce your projects URL.

Give me know how it goes.

Thanks,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: CLI has stopped working

Postby codeowl » February 13th, 2013, 11:07 pm

Miloslav,

Thanks for the reply mate. Well I got debugging working by switching to the WAMP server, by putting in the Use Custom Web Server URL as suggested.
Now the problem is that it hits the breakpoint, and in about 6 seconds it just continues and the browser says This webpage is not available.
Is there some sort of timeout somewhere that I can increase?

After doing some more testing I have found that the 6 (approx) second debug issue does not happen on a new php project with one page, one line phpinfo() and a break point.

It does however happen on CakePHP projects. Eg; The 15 min blog tutorial.
http://book.cakephp.org/2.0/en/getting-started.html

Regards,

Scott
codeowl
 
Posts: 51
Joined: February 10th, 2013, 10:05 am

Re: CLI has stopped working

Postby CFI » February 14th, 2013, 8:33 am

FYI: I do not have this "6 Second Problem" using CakePHP and LightTPD, so maybe it is one of your xDebug settings...
CFI
 
Posts: 66
Joined: December 13th, 2012, 1:29 pm

Re: CLI has stopped working

Postby Miloslav Beno » February 14th, 2013, 9:06 am

Scott,

I'll try to setup cakePHP project on WAMP to see if I could replicate it. Could you please send me your php.ini file? I'll take a look if there isn't something suspicious. As CFI pointed out that might be something with the configuration.

Thanks
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: CLI has stopped working

Postby codeowl » February 14th, 2013, 9:12 am

CFI,
Thanks for tip mate. I have spent the entire day attempting to resolve this issue, and it really has me stumped. Everything was working great for a day and a half. I was using the built in web server, with the php and MySQL that came with WAMP, and break points were working and everything as it should be. Then the CLI has stopped working dialogue started appearing.... And since then I can't get debugging to work at all with a cake project. The funny thing is it works fine with a one page php project with a single line to print phpinfo... I put a break point on that, using the built in debugger, and it all works as it should. But I download a clean copy if the latest version of CakePHP, set the variable the core.php that allows you to work without mod_rewrite, put a breakpoint in the page controller, and use the built in web server and as soon as the breakpoint gets hit, I get the CLI has stopped working dialogue come up.
I have tried:
- Uninstalling and reinstalling WAMP.
- Using the Apache server that came with WAMP.
- Using a previous version of PHP and Xdebug.
- Using XAMPP.
- Uninstalling all copies of PHP and all PHP IDEs I had installed, manually installing the latest PHP and Xdebug, and using the built in web server, first with Thread Safe and then with Non Thread Safe versions.
- Using IIS 7 as the web server.
The only Xdebug options in the PHP.ini are the ones put there by PHP Tools, and the zend extension reference to the Xdebug dll. Tomorrow, (am at home now and left the laptop at work downloading XP to see if it might work on an XP VM, as I have read about a lot of people getting this issue on Vista/Win7 and saying they could only get it to work on XP..), I will put together a zip with a sample project and installation of PHP and see if anyone can replicate the issue on Win7 in the dev team.
I can't believe I have wasted so much time on this.... Especially when it was working and for no apparent reason, stopped.

Regards,

Scott
codeowl
 
Posts: 51
Joined: February 10th, 2013, 10:05 am

Re: CLI has stopped working

Postby codeowl » February 14th, 2013, 9:14 am

Miloslav,

Thanks for following up on this mate, I will put together something for you tomorrow ;-)

Regards,

Scott.
codeowl
 
Posts: 51
Joined: February 10th, 2013, 10:05 am

Re: CLI has stopped working

Postby Miloslav Beno » February 14th, 2013, 9:28 am

Scott,

Maybe some of the previous PHP installation had left something in environment variable (PHPRC) or in registry (HKEY_LOCAL_MACHINE\SOFTWARE\PHP)?

I'm just setting up something to see if I would be able to replicate this. If I'm not I'll just wait for the package from you.

Thank you
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: CLI has stopped working

Postby codeowl » February 14th, 2013, 9:52 am

Miloslav,

Good thought mate. I will check this out as soon as I get in the office.

Thanks,

Scott
codeowl
 
Posts: 51
Joined: February 10th, 2013, 10:05 am

Re: CLI has stopped working

Postby codeowl » February 18th, 2013, 12:02 am

Hi guys,

Sorry I haven't had a chance to get back to you until now.
I started putting together a document that outlined exactly what I had done, eg; the exact version of things I had installed, the URLs they came from etc... As a part of this process I uninstalled everything, (Except PHP Tools) and started again. I put a standalone copy of the latest PHP5.4.11 Non Thread Safe version. I then got the latest Xdebug 2.2.1 Non Thread Safe (php_xdebug-2.2.1-5.4-vc9-nts.dll) placed in the PHP ext dir.
I then updated the PHP.ini file with the debug setting and enabled pdo_mysql.
I then downloaded a fresh install of the latest CakePHP (cakephp-cakephp-2.3.0-0-gd3fdd2c.zip), started VS2012 and created a brand new project and setup the fresh CakePHP install in there. Modified the core.php to get around the mod_rewrite issue and then set the index.php as the default start-up page. I then set a breakpoint in the PageController and started the project up, and hey presto, every thing worked perfectly, my breakpoint was hit and no CLI error.
So I went back and tried my other test project again, and it still failed with the CLI error.
So I went back over the replication steps and found that the on the CakePHO home page it says "2.3.0 Stable"... this turns out to be a link to download 2.3.0 version directly and that is what I downloaded in the steps above. However the first time I did this, (before I started having issues), I clicked on the Downloads button in the main nav at the top and this took me off to GitHub, where they suggested I download some CloneToWindows client, which I did... and then when I used that to download CakePHP, there was no version 2.3.0, there was only a 2.4.0 and older releases... So I grabbed 2.4.0 (not realizing that the option that said Master was actually 2.3.0, having never really used git much before). That is the difference. 2.4.0 fails, and 2.3.0 doesn't. The strange thing is, that 2.4.0 worked fine for a day and a half, and started throwing the CLI error, which it has done consistently ever since.
Oh and I also did another test where I downloaded the Master branch from git, and it did say 2.3.0 in the version.txt file, however when I set it up, it throws a different error. Nothing to do with debugging, tis a file_exists() error.
So the only copy of CakePHP I could get to actually work, is the one linked to the homepage that is a direct link to the zip.

Thank your Miloslav, and CFI for the time you put in assisting me on this. I will be buying PHP Tools once my trial expires, and it is great to know that we have good support.

Regards,

Scott
codeowl
 
Posts: 51
Joined: February 10th, 2013, 10:05 am

Next

Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 43 guests

cron

User Control Panel

Login

Who is online

In total there are 43 users online :: 0 registered, 0 hidden and 43 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 43 guests