empieters Posted May 13, 2013 Share Posted May 13, 2013 (edited) Hello Can you help me? I have 2 pc's A en B. There is a program that I run. If I run a particular php script then on pc A it hangs, on B it does not. But when I do write statements to an out file I see that both programs have calculated and the script even returns after doing his work to the calling program. So on pc A it does not 'see' it is finished. To help: There is a loop that loops around 2000 times each time after reading a record from a sql database. If I break earlier for instance after 1500 times, then suddenly both programs end normally. So the question. What could happen in a loop, that prevents a program from ending and hangs, while an other pc does not? There is lots of processing after the loop, that is executed in both situations. Both PC use IE but also Firefox does the same. On top of that also IE's version is the same on both PC's. I am out of clues. Can you point me in the right direction? please mail to empieters@gmail.com if you have questions. Edited May 13, 2013 by empieters Quote Link to comment https://forums.phpfreaks.com/topic/277962-please-help-me-with-this-riddle/ Share on other sites More sharing options...
requinix Posted May 13, 2013 Share Posted May 13, 2013 Have you checked your error log(s) yet? Quote Link to comment https://forums.phpfreaks.com/topic/277962-please-help-me-with-this-riddle/#findComment-1429882 Share on other sites More sharing options...
empieters Posted May 13, 2013 Author Share Posted May 13, 2013 Nothing in the error logs Quote Link to comment https://forums.phpfreaks.com/topic/277962-please-help-me-with-this-riddle/#findComment-1429884 Share on other sites More sharing options...
requinix Posted May 13, 2013 Share Posted May 13, 2013 If it's still writing stuff to a file then the script has not hung: it just doesn't look like it's doing anything... Quote Link to comment https://forums.phpfreaks.com/topic/277962-please-help-me-with-this-riddle/#findComment-1429886 Share on other sites More sharing options...
empieters Posted May 13, 2013 Author Share Posted May 13, 2013 It IS doing something.In fact it does everything it must do. The only thing missing is that it does not seem to know the script is finished. And it has. I call the function and one line futher I echo 'finished' to an out file and that is written. It does just not understand that the script has finished. There is a loop that is run a lot of times and when I make the number smaller it DOES know it is finished. As if there a limit to the number of loops. The peak memory usage is the same all the time. It is just a riddle. It works on one PC but not on another. Same browser, same network... Quote Link to comment https://forums.phpfreaks.com/topic/277962-please-help-me-with-this-riddle/#findComment-1429895 Share on other sites More sharing options...
Barand Posted May 13, 2013 Share Posted May 13, 2013 Have you compared php.ini file settings on the PCs, eg max run time etc? Quote Link to comment https://forums.phpfreaks.com/topic/277962-please-help-me-with-this-riddle/#findComment-1429900 Share on other sites More sharing options...
empieters Posted May 13, 2013 Author Share Posted May 13, 2013 (edited) But the file is on a server, so there is only one ini is there not? Thanks It must be something that is different on 2 PC's that effect loops. Edited May 13, 2013 by empieters Quote Link to comment https://forums.phpfreaks.com/topic/277962-please-help-me-with-this-riddle/#findComment-1429903 Share on other sites More sharing options...
l0gic Posted May 14, 2013 Share Posted May 14, 2013 (edited) What.. The..? Do you mean you have two PCs ( PC-A and PC-B ) neither of them are the Server ( hosting the PHP ) but both are connecting to the Server where the run Whatever.PHP and PC-A shows different results to PC-B? If so, due to PHP being a server-side programming language ( meaning it runs all code and logic on the Server ) neither PC-A nor PC-B will have any effect on the PHP being run, so they cannot be playing havoc with loops, or anything else as that's all taken care of by the Server before either PC would see any results. So, if this is the case. And at-least one PC is showing as working correctly then you have an issue on any PC where it isn't showing the correct results. Which opens up millions of possibilities. Edited May 14, 2013 by l0gic Quote Link to comment https://forums.phpfreaks.com/topic/277962-please-help-me-with-this-riddle/#findComment-1429943 Share on other sites More sharing options...
empieters Posted May 14, 2013 Author Share Posted May 14, 2013 Yes that is correct. In real life there are 6 co-workers of mine running the program and with some it finished and with others it does not. It is just a program that one can run over the internet. If I shorten the loop by breaking halfway, all the co-workers's programs finished. I tried the first half AND the second half of the lines to proces to see if one line caused the problem, but it is not inside the lines as in both situations (first half and second half of the lines) the program finishes. Quote Link to comment https://forums.phpfreaks.com/topic/277962-please-help-me-with-this-riddle/#findComment-1429961 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.