I have huge PHP script which I have been running on Apache 2.2.12 and I have recently upgraded to Apache 2.2.14. However, my PHP script doesn't work as it stops at a certain point all the time. I have been trying to work out what the difference is in these two Apache versions, I have looked at this CHANGELOG and have not been able to determine this.
When I look in my Apache error log, I find this before my PHP script fails to do anything else.
Parent: child process exited with status 255
The errors after this are just notices and they end after a few of these.
What changes in Apache do you think can cause this? I was reading around and I found a few people saying that newer versions of Apache on Vista (windows) can detect when a PHP script is in an infinite loop and will kill that child, is this true?
Thanks all for any input.
Update
Apologies, this is no longer relevant. I think its a PHP issue. I switched from 5.2 to 5.3 and I think its do with modules. I will be openning another question.
try this
download this
http://windows.php.net/downloads/snaps/php-5.2-win32-VC6-x86-latest.zip
then copy libmysql.dll into your php directory and restart apache
Actually it does not relate to modules, but to certain validations made by the core interpreter, which breaks many nonstrict processes in different PHP applications. Beware of updating PHP to 5.3! Mwahahahaha!
Related
last year i have purchased an encrypted script wich run two crons jobs, a month ago crons stop working and i have talk to the hosting company they said its script problem , The PHP cron file works fine without any errors when visited by browser, the script provider told me that this issue should be fixed by hosting service and refuse to help !
here the command used it run every 10 MIN /home/username/public_html/cron/cron.php
cPanel Version 64.0 (build 24)
Apache Version 2.4.25
PHP Version 5.6.30
my question is it true upgrading the PHP version will affect cron job and how can i solve this?
thanx
In short, yes, upgrading PHP can effect your scripts -- the crons aren't run by Apache or PHP; the crons run from the OS level.
Your PHP upgrade is most likely affecting the crons in one of two ways:
The upgrade was large, like PHP5.6 to PHP7.0 and there's a deprecation warning somewhere (which will output in the crons' log) or the script is running some code that's now fully deprecated; most likely a query or a class/method named after a reserved word. Your logs will have more info, just make sure you have debugging turned on, otherwise your errors will be suppressed.
The new PHP settings from the upgrade have disabled some of the allowed rules from an older PHP version, such as getting away with empty or unassigned variables, and now your script is running into errors (ie. using a variable that doesn't exist, such as $_REQUEST['something'], which would have been empty but now returns an error that effects the rest of the script).
To fix this you need to know what the problem is. The easiest way is to access the log files that crons often create. If you don't get that with your host, ask them for it, or ask them to send you a copy of the error that's being created -- a quick Google on the error will tell you what the problem is. But without knowing more about the script or the error log, you probably won't get a better answer.
old command is working its just me i did copy past from my old backup and i forget the PHP at the firts off command ! nothing has changed the command should be like that exp : php /home/username/public_html/cron/cron.php
Firstly forgive me if my terminology isn't entirely accurate. I have only limited knowledge on this subject, but will best try to convey the problems we are having. My server administrator is trying to deploy php 5.5.9 on a live server. Originally the intention was to install php 5.4.x, but we opted for the latest version instead (a manual compile is required regardless due to the o/s)
The O/S is OpenSuse 12.1 and the server is a Plesk server (Plesk Version 11.0.9) with Apache 2.2.1. This particular o/s does not have the ability to update php automatically so everything has to be done manually. Since we didn't want to risk screwing up the server (currently running with php 5.3.8), we opted to install a second version of php alongside the current one. The instructions we followed are outlined here: http://kb.parallels.com/en/114753
After numerous failed attempts due to missing libraries during compilation, we were finally able to compile php 5.5.9 without error and then proceeded to run tests with 'make test'
Unfortunately, the test results came back with 32 failures and 20% of the total tests were skipped. A total of 13011 tests were done, 10410 of which were completed. The TEST SUMMARY can be downloaded from here: http://uploaded.net/file/v6ug55l8
Anyway, deciding we might aswell give it a try, we applied the changes as indicated in the first link above to the vhost.conf. However, it didn't work, and the vhost then returned Internal Server Errors for every page regardless of script or extension. The errors logs sadly do not indicate any errors, only a whole ton of internal server errors recorded by mod_security. We did notice a huge number of these in the error log: Warning: SuexecUserGroup directive requires SUEXEC wrapper. But, it doesn't seem to be related, as the same error goes back several weeks.
So, we're stuck without any idea what to do next. Our next attempt will be to try and compile a php 5.4.x instead, as perhaps something is bumping heads with 5.5.9...
Any and all advice will be appreciated. As per the opening statement, I'm not an expert here, so if you need any additional information about the machine and it's server, feel free to ask. Thankyou for your attention!
Problem solved. The vhost's CGI-BIN needed to be CHMOD 755 and not 775.
This is probably completely obvious to somebody.
I'm using PHP on Windows 2008 Server R2 and IIS 7. FastCGI, PHP V5.3.
When I make a program change, I have to repeatedly change the file and re-save a good few times before the code recompiles and my edits are reflected. This is getting seriously annoying.
I've read about bytecode caching APC or Wincache etc. in the PHP manual, but as far as I can tell there is nothing installed.
Is there a standard bytecode cache? How do I disable it?
If not, what else could be causing this?
Thanks for your help.
P.S. IIS 7 Output caching is switched off (unticked) for both User and Kernel on this website instance.
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.
When running PHP in CLI mode, most of the time (not always), the script will hang at the end of execution for about 5 seconds and then output this:
Error in my_thread_global_end(): 1 threads didn't exit
It doesn't seem to actually have any effect on the script itself.
Some web searches turned up blogs which suggest replacing the php_mysql.dll with a different version, however this has not solved the issue for me, and I suspect the info from those blogs is now out of date.
My setup:
PHP Version 5.2.4
Apache/2.2.4 (Win32)
Windows Vista Home Premium SP1
This is a known bug with some of the PHP 5.2.X version in the windows fast-cgi implementation
http://bugs.php.net/bug.php?id=41350&edit=1
I have encountered this bug before and downgrading my PHP install to 5.2.0 solved the problem.
There is no need to downgrade the entire PHP version, just replace the libmysql.dll from the PHP 5.2.1 release & things should be rolling :) Refer this link for more info.
Did you take a look at this resource? You may want to double check that you got a specific libmysql.dll (5.2.1) that is unaffected by this, and also to double check that you don't have any stray mysql libraries lying around that PHP could be picking up instead. Or, switch from FastCGI if that's an option for you.
For interests sake, the bug appears to be best detailed here. The general idea of the problem (from the mysql bug link) appears to be:
Whenever a new thread is created libmysql is told about that by Windows. It then
increases a thread counter and initializes some data. When libmysql is being unloaded
it checks whether all threads have finished, if not it tries to tell them "close now"
and gives them 5 seconds for that. In general this works in a nice way.