KakkArlak Posted June 22, 2010 Share Posted June 22, 2010 Hi, So, it seems that when a client makes more than 1 connection to the web server ( Windows + Apache 2.0.x + PHP 5.1.6 ) it dies. e.g. I put 1 phpthumb call - e.g. <img src="/library/classes/3rdparty/phpthumb/phpThumb.php?src=/media/images/gallery/cart1.jpg&w=100&h=100" /> That works. But if I put like 3 on the page, it just loads forever ( according to firebug ) .. and it never shows! Any help will be appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/ Share on other sites More sharing options...
ChemicalBliss Posted June 24, 2010 Share Posted June 24, 2010 The problem could be many things, check these off one by one: 1. Server problem - Try another server. 2. Browser problem - Try another computer/browser 3. Script problem - Try another thumbnail script. -cb- Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1076933 Share on other sites More sharing options...
KakkArlak Posted June 25, 2010 Author Share Posted June 25, 2010 The problem could be many things, check these off one by one: 1. Server problem - Try another server. 2. Browser problem - Try another computer/browser 3. Script problem - Try another thumbnail script. -cb- Thanks! No problems on another server, have tried that. ( Debian Linux vs this Windows one - Newer PHP vs this 5.1.6 ) Tried other browsers, same thing. Script's been working for 2+ years, works on other servers. ( currently on 10+ live servers ) Because of that, I'm convinced it's a server thing. Might not be apache, but anything on Windows SBS 2003. The server is a bit f'up. But redo'ing it isn't an option. The reason I'm trying to put a few sites on it, is because it's old sites that's using deprecated php functions, so I'm running 5.1.6 on it. On our main production/development web server, everything works fine, except the old stuff ofcourse, because it has php 5.2.10 on it.. Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1077046 Share on other sites More sharing options...
KakkArlak Posted June 25, 2010 Author Share Posted June 25, 2010 See attached pic for example! The code on that page is : <img src="/phpthumb/phpThumb.php?src=/media/image/gallery/pack1.jpg&w=100&h=100" /> <img src="/phpthumb/phpThumb.php?src=/media/image/gallery/pack2.jpg&w=100&h=100" /> And that file definitely exists, because if I do only one of these, it works perfectly! [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1077157 Share on other sites More sharing options...
ChemicalBliss Posted June 25, 2010 Share Posted June 25, 2010 If it works on other servers there is nothing in the script that will fix this issue. I would suggest - Re-Install the apache/php/mysql server hosts. Or you will have to find the problem yourself - which could literally be impossible - or live with the fact that script wont work im afraid. -cb- Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1077163 Share on other sites More sharing options...
KakkArlak Posted June 25, 2010 Author Share Posted June 25, 2010 If it works on other servers there is nothing in the script that will fix this issue. I would suggest - Re-Install the apache/php/mysql server hosts. Or you will have to find the problem yourself - which could literally be impossible - or live with the fact that script wont work im afraid. -cb- Meh, looks like I'm gonna have to re-install. I was wanting to avoid that.. Anyways, Thanks for the help !! Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1077168 Share on other sites More sharing options...
ChemicalBliss Posted June 25, 2010 Share Posted June 25, 2010 One thing you could try is disabling specific apache and php modules, reinstalling modules and downloading new/old versions of the offending module(s). -cb- Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1077198 Share on other sites More sharing options...
KakkArlak Posted June 25, 2010 Author Share Posted June 25, 2010 One thing you could try is disabling specific apache and php modules, reinstalling modules and downloading new/old versions of the offending module(s). -cb- ooooh! I shoulda thought about that. Because I already had problems with the mysql extension for php. I redownloaded a fresh copy of php 5.1.6 to get it to work properly! Will post back if I get some results when checking modules/extension. Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1077213 Share on other sites More sharing options...
KakkArlak Posted June 28, 2010 Author Share Posted June 28, 2010 So, what I did in the end was uninstall Apache 2.0.x I installed the latest Apache 2.2.x , and with it php 5.2.6 .. I noticed that, that wasn't even my issue. Because it still didn't work. I noticed that the "php_value include_path" was breaking my thing! I believe it's a php issue. Because when I changed php, that's when it broke in the first place. Here's the virtualhost : <VirtualHost 192.168.0.11:80> ServerAdmin tech@clickthinking.com ServerName optimalenergy.dev DocumentRoot d:\websites\optimalenergy\website DirectoryIndex index.php index.html default.php #php_value doc_root d:/websites/optimalenergy/website #php_value include_path d:\websites\optimalenergy\website\ php_flag allow_call_time_pass_reference On </VirtualHost> I tried the include path in the virtualhost, in a htaccess file, and in a auto_prepend_file ... none had any effect. I attached my php.ini file.... Any help appreciated! [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1078301 Share on other sites More sharing options...
ChemicalBliss Posted June 28, 2010 Share Posted June 28, 2010 This is getting confusing, Lets clear it up a bit. You have a php script that creates thumbnails on-the-go from images on the server. Problem: When you put multiple img tags on the html Output, apache crashes as the browsers requests all the images simultaneously. Ruled Out: Apache Server/Modules (reinstalled) PHP Script itself (Works on other servers) Operating System (Does it work on other windows boxes?) Operating System Configuration (Have you tried installing a different httpd server?) PHP Server/Extensions (Have you tried different versions of PHP? PHP4, for instance?) So you have stated the script works perfectly fine on newer servers? Then technically it's not the code, though there could be, for instance, restricted functions. (Though this shouldn't crash Apache). You have also reinstalled Apache, so it cannot be a misconfiguration/corruption of the Apache server or one of its modules. Therefor, It could still be something with the Operating System (Settings/Compatibility of Processes) or PHP (Settings/Extensions). From your last post, put the php_value lines in a .htaccess file: php_value doc_root d:/websites/optimalenergy/website php_value include_path d:\websites\optimalenergy\website\ * Note: .htaccess files will only work with servers that use php as an apache module (rather than a CGI Executable). If you get internal server errors, you are most likely running a CGI version of PHP, in which case, you must use the internal PHP functions: ini_set() or set_include_path(). - Bear in mind you will overwrite any existing include paths. Hope this Helps, -cb- Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1078437 Share on other sites More sharing options...
KakkArlak Posted June 28, 2010 Author Share Posted June 28, 2010 Thanks for the reply. I've tried php 5.1.6 and 5.2.6, and it does work on 5.2.10 on another ubuntu server. Only php extensions enabled is mysql and gd2 htaccess does work, although wherever I try to change the include path, it crashes. Wether it's in the Virtualhost, in htaccess, or through ini_set in php. Operating system is Windows SBS 2003. I have a live SBS 2003 machine as well, will test on that once I get to the office. I must admit, the Operating system is messed up. I was not the one who installed it originally. There's probably 10 php installations. Dunno which was installed and/or only extracted source.. I do know, that php 5.0.3 and apache 2.0.x was the last working versions. But I can't use 5.0.3 because it's too old for the Zend_Framework. Did you catch the part in my previous post, where I said it works if the include path isn't changed? and when I don't change it, the include path is ".;C:/php5/PEAR" ... yet, the php that I have running with apache at the moment is under C:/php .... Also, I don't particularely want to use another web server... I guess I could use the existing IIS on the machine, but I generally prefer apache. PS. The IIS shouldn't affect the apache, it hasn't before. They run on different IP addresses. Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1078449 Share on other sites More sharing options...
ChemicalBliss Posted June 29, 2010 Share Posted June 29, 2010 Wo wo hang on - The script works fine if you don't change the include path? Personally i would never use include path setting in php, as you can get very messy scripts that are almost non-portable by using them. If you do not change the include path at all, does the script work as expected? When you set the include path in the php.ini file - does the server start? If it crashes, when exactly does it crash? And the same for inside the .htaccess file. Please also chack if your using a module or CGI Executable (in apache.conf do you have a line like this: LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll" If you do then your using the PHP apache module, htaccess settings should work fine. I assume you have a default httpd.conf file (bar doc root etc etc). The last thing you could try is that auto_prepend value - using ini_set() or set_include_path() in the file you specify. Auto_Prepend should work, if it doesnt then you have some problems with misconfiguration/corruption on your computer. I would completely remove any instances of server files, IIS if you can, anything to do with webservers - totally clean your computer, run anti-virus/spyware cleaners/clean temp files etc (cc Cleaner is good), Fix registry entries etc etc. Then reinstall the latest apache 2.2x php 5.3x, Run the apache Monitor to make sure your running those versions, use phpinfo() to make sure all the settings are how they should be - make sure you clean __all__ instances of "php.ini" off your computer before reinstalling php. Good Luck, -cb- (As the script works on other servers its definitely to do with your setup somehow). Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1078649 Share on other sites More sharing options...
KakkArlak Posted June 29, 2010 Author Share Posted June 29, 2010 Thanks! Yes, I do have the apache php module loaded.. I have tried putting ini_set in an auto_prepend_file .. and it had the same effect. The server doesn't really crash (as in the apache2 service stops), all it does is, any request to apache "hangs" and I have to restart it to get it to work again. I also can't remove IIS on there, because the server is currently being used in a production environment. ( I moved all the sites that were on apache to a linux server though ). Also, can't have 5.3x, because the whole point of getting apache to work on this windows machine, is because I need to run an older php version for some legacy websites using deprecated functions. But, in the meantime, I'm gonna try clean up a bit. (Tomorrow morning only though, when no-one's at the office. GMT 2+ ) Thanks for the help. Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1078678 Share on other sites More sharing options...
ChemicalBliss Posted June 29, 2010 Share Posted June 29, 2010 Ok that clears up a bit, You say the server hangs, when you use multiple img tags - but only when you set the include_path ? so what i would suggest, is copying the offending script, then narrow down the offending code that hangs the system by: 1. Remove big chunks (like half, to start with), from the code, so it still works but obviously without the expected result, as long as it gives some output, eg hello world. 2. keep removing smaller and smaller chunks of code until you have the exact code that is causing the time-out. 3. Post the code you found on here. - im guessing if it truly is the fault of the php value include_path then it will be any include() that would hang apache. -cb- Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1078684 Share on other sites More sharing options...
KakkArlak Posted June 30, 2010 Author Share Posted June 30, 2010 Ok, so I have already simplified the code long ago, to a few lines. // in prepend file ini_set('include_path',ini_get('include_path').':\websites\optimalenergy\website'); // output = .;C:\php5\pear;D:\websites\optimalenergy\website // in "test.php" error_reporting(E_ALL); echo ini_get('include_path');echo '<br><br>'; if (isset($_GET['one'])) { echo '<img src="/library/classes/3rdparty/phpthumb/phpThumb.php?src=/media/image/gallery/pack2.jpg&w=300&h=100" />'; } elseif (isset($_GET['two'])) { echo '<img src="/library/classes/3rdparty/phpthumb/phpThumb.php?src=/media/image/gallery/pack1.jpg&w=300&h=100" />'; echo '<img src="/library/classes/3rdparty/phpthumb/phpThumb.php?src=/media/image/gallery/pack2.jpg&w=300&h=100" />'; } If I go ?one , the above works. ( 1 image call to phpthumb ) ... but if I use ?two, it "hangs" ! And, I most certainly believe that phpthumb isn't the problem, because that's being used by us on probably 10 other servers, windows and linux, and there's no problems with that there. So ya, if I remove the line in the prepend file, phpthumb works fine! But then obviously, all the includes on the site doesn't work, because there's no include path, and that's the way it was built. (bad I know, but it was built long ago. Probably +/- 5-6 sites ) EDIT: I think it's a PHP problem, because if I remove phpthumb and do straight image calls, then it works with an include path set. But, on the site, e.g. ajax calls to php files, if there's more than one, it fails! Look at how www.andbeyondafrica.com loads, and you'll see all the requests. Look at an example "real" page loading... It's a gallery page, so there's about 9-12 images loading... or trying to. And then after them some other normal images fail. (PIC attached) [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1079066 Share on other sites More sharing options...
ChemicalBliss Posted June 30, 2010 Share Posted June 30, 2010 Sorry i wasnt clear - You need to find the offending code in phpThumb. Something is obviously conflicting with the php_include setting. Remove parts of the script until you find the code that is hanging it. There will be a certain piece of code. -cb- Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1079187 Share on other sites More sharing options...
KakkArlak Posted July 1, 2010 Author Share Posted July 1, 2010 Sorry i wasnt clear - You need to find the offending code in phpThumb. Something is obviously conflicting with the php_include setting. Remove parts of the script until you find the code that is hanging it. There will be a certain piece of code. -cb- Even though the same code works on other servers? And on this same server, ONE call to that file also works. It's only when it's 2 or more... Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1079764 Share on other sites More sharing options...
ChemicalBliss Posted July 1, 2010 Share Posted July 1, 2010 Its called debugging, we dont know exactly what is causing this. we need to know what is, find out what code is dying and ill help you, if you had already debugged as i mentioned we would be much closer to a solution. -cb- Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1079792 Share on other sites More sharing options...
KakkArlak Posted July 2, 2010 Author Share Posted July 2, 2010 Hi, thanks for all the help, but I think I fixed it. Yesterday, I did the same setup on my home pc ( also windows ). .. and after 5min, everything just worked. After a fresh installation. So something on the server here, must be conflicting and causing that problem? So in the end.. I had the idea of running php as CGI, instead of as a module. ( installed the non-safe threaded version at home ) The non-safe on didn't wanna work as a module on the work's server, don't know why, so I'm running php as CGI now, and everything works fine! Except ofcourse, php_value doesn't work... but I'm doing that in a prepend file now. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1080149 Share on other sites More sharing options...
ChemicalBliss Posted July 2, 2010 Share Posted July 2, 2010 I'm glad you got it sorted. Non Thread safe PHP Builds can be a little unstable at times, depends on your processor and operating system health. Thread-Safe Builds are a little slower but should cause much less problems. -cb- Quote Link to comment https://forums.phpfreaks.com/topic/205518-simultaneous-connections-on-apache/#findComment-1080238 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.