PHP -> CLI has stopped working - php

I recently installed Windows 7 on my desktop and the following problem has begun occuring:
I regularly run some PHP scripts from the commandline that are now giving this error in a popup window:
CLI has stopped working.
I cancel this and my script terminates. Not good...
I've googled around and tried most of the few ideas suggested but still i am plagued by this annoyance. Right now it appears to regularly occur when I do a file_get_contents() of a url pointing to an image file. Only happens when the url is http protocol, works fine for ftp files. It also happens spuriously doing other things as well.
This is PHP 5.3.0 as distributed in a xampp 1.7.2 .zip. All exe's and dll's have been unblocked by copying thru FAT32 and back.
hints from anyone who's cracked this would be most helpful.

Try updating your PHP version bundled with xampp. You might have to update some php_XXX.dll extension files.
More info: http://web2.0entrepreneur.com/31/cli-has-stopped-working-on-windows-vista.html

PHP-CLI stops under these circumstances: Windows 7 64bit, PHP 5.6.8 64bit, only when Zend OpCache extension is ENABLED!!!
Just edit php.ini and comment zend_extension=php_opcache.dll (with ; in front of it)

I found that this happened to me when I had the APC extension enabled. I switched to using the Wincache for PHP extension instead.

If you receive this error after installing WAMP, most likely you have another installation of PHP on your machine. This may have been installed using the Microsoft Web Platform Installer or by other means. The first thing you should do is un-install PHP.
If this doesn't work, check to make sure that IIS and Apache are not trying to use the same port. WAMP starts out with Port 80 as standard and IIS usually will be the same. The easiest way to fix this is to turn off IIS while running WAMP, but you can set either of them servers to port 81 or another port.
If this doesn't work, my last suggest is to look for multiple copies of php.ini on your machine. You may find them in places like the Windows directory. Make a backup of the file just in case, and then remove them from all of the folders except the WAMP folder.

it happened to me in laravel 5.I searched every where but no solution that fix my problem then i debug my web application at different points and found that if you comment your php code in laravel comments in blade template like
{{--print_r($date_a);--}}
Now comment like this
//print_r($date_a);
works

The solution for me was to stop using PHP 5.3.0 and go back to 5.2.11. Once I did this the "CLI has stopped working" issue disappeared.

I have the same issue with Windows 7 Professional.
My Apache Server has no problem finding and executing PHP within my web application but the command line execution gives the infamous message "CLI has stopped working."
The User Account Settings seem to allow executions.
Perl has no problem.
I always have to take my code to an XP machine and run it there to debug it.

You didn't specify that you were using xdebug, but just in case you were, I may be able to help. I had this error for a long time. It turned out I was on a slightly older version of Xdebug (php_xdebug-2.2.0-5.4-vc9.dll).
I replaced that file with "php_xdebug-2.2.2-5.4-vc9.dll" and it magically started working immediately.
I'm on wamp, and I updated both php.ini files (one is for cli, one for normal use) with the latest filename.
"zend_extension = c:\wamp\bin\php\php5.4.3\ext\php_xdebug-2.2.2-5.4-vc9.dll"
Then dropped the new file into the php ext folder and instant success.

I had the same issue on Windows 7 (Home premium). I had a hunch that it is caused by one of the extensions I installed so I started commenting them out one-by-one.
Turned out it was caused by a non-compatible mongodb extension I was using

Edit php.ini and comment zend_extension=opcache.enable_cli=1 (with ; in front of it)

Try to use another php version instead.
It works perfectly for me.

Try to run scripts with php-cgi.exe instead of php.exe. For me it works.

Related

Need help in configuring WAMP (phpMyAdmin)

So I have been looking on the net for hours now and I can't solve my problem.
I have wamp installed (WampServer Version 3.1.7 64bit).
I want to open phpMyAdmin through wamp. (I have the phpMyAdmin5.0.2 installed and phpMyAdmin.conf is configured).
I have several php versions installed.(this was done through the process of trying to fix the solution alone).
When I try to open phpMyAdmin I get this error message: [1]: https://i.stack.imgur.com/ZEMaX.png .
I have tried configuring php.ini file (by de-commenting mysqli) it didn't change a thing.
Here's my php.ini file joined in the google drive link: https://drive.google.com/file/d/1fQuVoh5vhRX-MHhYL3zMQ4xNkstO-4Ch/view?usp=sharing .
I have configured extension_dir tp the php/ext folder.
I have similary configured my windows path to the php/ext.
Nothing I try works. Any help is welcome.
Thank you.
Since you're using WAMP, which should include all the pieces you need already working, but also have several PHP versions installed, it sounds like you're installing more than you need which is causing conflicts.
Assume you have no data in your database or web pages that you need to preserve, I suggest removing everything; get rid of WAMP and any extra Apache, PHP, or MySQL/MariaDB installations you have. Clean up (delete or move out of the way) any leftover configuration files, then reinstall WAMP. If you have trouble after installing only WAMP and no other PHP installation, then report back here details of the error. WAMP should come to you working and all ready to go, so if there is a problem, it will be helpful to start from a known base installation without extra configuration files or executable that will cause conflicts.
I'll also point out that the very top of the file you posted states that it's used only for the PHP Command Line Interface, so this is not the configuration file used by anything running through your webserver (like phpMyAdmin or your site). It's a little confusing that there are really two PHP instances (one for the command line and one that runs through the webserver), but in this case you would be looking for the file in wamp/bin/apache/apache2.x.y/bin/php.ini

Xdebug crashes apache

My Xdebug works fine when I use eclipses' internal browser but when I use it in an external browser apache crashes.
I am using xampp and on windows 7 64 bit. If someone needs more information let me know.
For some reason if I have the variables tab open in the php debugger in eclipse it crashes apache. So to stop it I just can't have variables tab open while debugging. So this avoids the problem but doesn't fix it. I would like to be able to have this tab. Any suggestions?
It is possible that the XDebug build and type does not match your apache & php build and type...
Apache compiled with VS.NET 2008 (VC9) for 32bit and using PHP as a module would require XDebug: 32bit, VC9, Thread Safe.
http://xdebug.org/download.php
Also, you could test another WAMP package that comes with XDebug (for example WampDeveloper) and if it also does not work for you, it's probably not a build mismatch issue.
Hey I got this working
Eclipse 3.6.1 (because on later versions key shortcut for putting line comment don't work)
Xampp 1.7.4
Xdebug 2.1.2
The trick is to change php from VC6 to VC9 and then it just works correctly.
BTW. It's the variables panel that causes xdebug to crash apache on php VC6.
Remember to get VC9 version of xdebug for new php AND if you put your new php in directory other than
\xampp\php, then on phpinfo(); you'll see that there's no php.ini loaded so just rename old php (co you can swich them from one to other anytime) and put new php in the same directory in which original php was in "\xampp\php" and copy your php.ini (because paths doesn't change). Also remember to obtain any additional php extensions you've been using in VC9 version for new php and put them in "\xampp\php\ext"
I can confirm most of what t0meck said. Except I've moved up to xampp-win32-1.7.7-VC9 which has PHP 5.38. Taking the phpinfo() results from that to Xdebug's custom installation analyzer, it specifies the php_xdebug-2.1.2-5.3-vc9.dll, but the problem isn't entirely eliminated. As I've documented in my 'notes to self' page, the following is working for me.
After following the above procedure, the 'run as' should work on the first try, but the 'debug as' may crash Apache at every attempt. This is an issue that has driven many people to severe distraction. There is an apparent bug exposed using the debug perspective. At the top center of the perspective is a window with two tabs, the variable view and the breakpoint view. Usually, Apache crashes only when the variable view is highlighted, so highlight the breakpoint view instead. Then set a breakpoint on your project. Now, if you are one of the chosen, you will be able to step through the script using the debugger, but when you switch to the variable view it may still crash Apache. What a drag. Repeat the process and the next time you should actually see the variables and the problem will magically go away, until you restart the project. Just repeat the procedure and be satisfied with being one of the lucky ones.
Don't know if this help, I have same kind of issue, but it relate to array depth xdebug >handle in Variables view. And you can change it. Widnow > Preferences > PHP > Debug > >Installed Debug > Xdebug > Configure enlarge the "Max array depth" solved my issue.
http://bugs.xdebug.org/view.php?id=658#c1767
Just set it to 10 or bigger and it should work

Best PHP download to keep all my options open?

In the past, I used WAMPserver on windows to parse PHP for me. This is a pre-configured package, focussed on working with MySQL.
When I tried to run PostgreSQL, I got error messages that said that my version of PHP wasn't compiled to work with PostgreSQL.
So, I've recently uninstalled WAMP and every associated with it. I've downloaded Apache 2.2.11 with openSSL, installed as admin(you know, run the command prompt as administrator, cd to the directory where the download was done and have it executed, so the install was done as admin).
That's that. I now have Apache installed, "it works" shows up, so I'm that far.
Now I'm wondering, do I download the exe and install, or the zip, or something else.
What is the best thing to do to make sure that the PHP on my system can handle everything I can ever throw at it?
Also, PHP first, or MySQL/Postgre first.
And lastly, what about PEAR? I need PEAR installed, which isn't standard on Windows. I'm guessing the pear.bat file in the PHP downloads will do that for me?
EDIT: I see one close vote, yet no comment as to why. It makes me wonder how people who are so lazy and rude got to have somany points.
I would recommend downloading the zip package, as configuring php is not really that difficult, and it allows you to add features as needed.
As for whether first to install php or MySQL/PostgreSQL, - it does not really matter. You can install them in any order.
Your guess regarding PEAR is quite correct
i haven't used wamp before, so i can't comment on that
i do however use xampp which sounds very similar
in xampp if i want to enable postgres support i edit the php.ini file and uncomment the postgres section of the ini file, same with any of the extensions that i need
perhaps this might be an alternative you can try if you get stuck
There are many ways to setup a HTTP server/PHP/database machine. Sometimes the behaviour of your development setup will differ from the live server's.
I would recommend finding out the setup your web host is using, then getting a vmware appliance image that fits that as close as possible and get any additional software using it's package manager (which is easier that installing stuff on Windows).
Setup a file sharing link between the VM and the host, make sure you can view the VM's port 80 in a browser running in your host OS and you're set.

WAMP server and PHP

I am using a WAMP server on a Windows Vista machine, and I am trying to do my first steps in PHP programming.
The problem is that the PHP include function dosn't work, and I don't know what the problem is! My code runs on other servers at work, but do not run in WAMP!
With WAMP server started try going to PHP > PHP Extensions from the taskbar icon and see if the extension that the function uses in enabled. Most of what you want should be available from this list.
Try to open php MyAdmin from Wamp - to make sure Apache is process is running - if not, nothing appears. If this is the issue, I would check if it could be problem related to port 80 (which happened to me). But if it DOES work, make sure that you use correct syntax for opening the php page as http://localhost/my_page.php

Installing PHP, Apache 2.2.10 on Windows Vista

I am trying to get PHP working on my vista home machine but I am getting weird problems. First I had file permission problems for which I disabled Vista's UAC. Now I can't get the PHP interpreter working.
I have made all the necessary changes following some tutorial but I still can't get it working.
Tutorial was located here: http://www.tanguay.info/wamp/installPhp5.php5
Try XAMPP. I use that at home on a Vista machine and it worked nicely after the install.
WAMPServer is also a good option. You can easily enable/disable both PHP extensions and Apache 2 modules. Everything is set up somewhat securely (only local access to the serve), and you get phpMyAdmin already set up.
Only thing I've ever missed is Memcached, but that is fairly easy to set up on your own.
The only problem I have installing PHP and Apache on Vista is that you need to make sure that when you edit the httpd.conf that you are editing it as an admin, otherwise the file is saved in compatibility mode.
To overcome that problem just type notepad++ or whatever in your start menu, right click the item and run as administrator. Then open the file from the app.
You can use FastCGI for IIS 7. I'm using this also and it works perfectly!!
FastCGI
You can try Zend Core
It works on both IIS and Apache (it includes the installation of the Apache)
iis7 is one of the best web servers and especially for php, if you can't get it to work it means you need to google enough, because it isn't logical to blame Vista for php/apache issues

Categories