Just received a notice from my host stating that "we have suspended this site due to the fact that it is spawning multiple apache children on our servers and taking up a lot of resources." error code Here is line 579 - 586 This code is from the index.php of the latest version of PHProxy Thank you William
Usually these errors are not show, because PHP's error reporting is set to E_ALL ^ E_NOTICE by default. There are two ways to fix it, one by modifying the script, and another by modifying your PHP settings. I assume that PHProxy has a config.php file, or similar which is included in all files. You can set this line at the top of it: error_reporting(E_ALL ^ E_NOTICE); PHP: If you have access to your php.ini file, you can change the value there, so you don't have to modify every bad written script you want to run. The other (quickest) way would be putting @ signs infront of the variables that cause these errors. if ($cookie_id[0] === 'COOKIE') { @$cookie_id[3] = str_replace('_', '.', @$cookie_id[3]); //stupid PHP can't have dots in var names if (count($cookie_id) < 4 || (@$cookie_content[1] == 'secure' && $_url_parts['scheme'] != 'https')) { continue; } PHP:
I would guess it's eating up resources because it's a proxy and thats what they do. The error messages are just a minor issue in the code (or your php config, depending how you look at it), hence the term 'notice'.
Professionally written scripts should not leave any notices, warnings or errors, not even if error reporting is set to E_ALL. Each time one of those occurs, the log file has to be opened, the error has to be written to it, and the files closed again. This all takes unnecessary time and slows the performance of your script down. No matter what kind of script it is, this should not happen...
True, but as you said the default suppresses notices (and if suppressed, it's not logged). Considering a massive number of commercially available scripts would generate notices, if a host were to set error reporting to E_ALL, you could safely say its an issue with the php config. Of course in development it should be set as high as E_STRICT to avoid any bad practices but that's beside the point.
nico if this something you could do would you be willing to look at the script and tell hard it would be to so what you mention in your first sentence.. Also a price.. Seems this would be a good fix for proxy users if it reduces resources. Could you pm if interested