portalBlock Posted October 6, 2014 Posted October 6, 2014 Hello, I seem to be getting Error 500 on my PHP scripts, if I wait a while then load the page again then it works. Is this due to CPU restrictions or have I done something wrong? This also happens if say 3 people view the page at the same time. Please help as this gets kinda annoying. Server: StevieDomain: portalBlock.heliohost.org / portalBlockz.netUsername: PM if needed.
portalBlock Posted October 9, 2014 Author Posted October 9, 2014 Sure. Its any PHP page really, so heres one: http://i.portalBlockz.net/Fg5nW Thank you for looking into it. Edit: It seems the image viewing one is ok, not sure what page it may be then. It is sort of random.
Byron Posted October 9, 2014 Posted October 9, 2014 This support request is being escalated to our root admin.
portalBlock Posted October 11, 2014 Author Posted October 11, 2014 Edit: Not sure what happened to this post... lots of jibberish. Some more information:Ok so basically the page @ http://portalBlockz.net/client-area/ contains a session_start, if statement and a echo. This page seems to give a 500 Error 6/10 times(for me). Edit 2: Added some more stuff, it seems though that its for about 2 minutes after I make a change to a PHP file that I get the 500 on any PHP page(possibly html also). I am guessing that's just extra CPU usage for updating the PHP cache(If you cache PHP).
Tjoene Posted October 13, 2014 Posted October 13, 2014 When you are experience the 500 error, is it in one of these situations? 500 errors can be caused by a lot of things. The most common areExceeding Process Limit The solution is to not run as many processes. Opening cpanel, connecting to FTP, checking mail, connecting to webdisk, etc all increase your process count, and if you exceed your limit php will show 500 errors since it cannot start a new php process. This sometimes affects only the webmaster since opening cPanel and FTP etc is common when you're editing your site, but normal users won't have these errors since they will only be accessing your website not all the other services. The process limit is higher on Johnny so for some websites the solution to 500 errors might be to switch servers.Syntax Error in .htaccess If you have a syntax error in one of your .htaccess files it can cause a 500 error. The easiest way to check if this is the case is to delete or rename your .htaccess files and see if the 500 error goes away.Incorrect Permissions If the script or the directory that the script is in doesn't have the correct permissions it can cause 500 errors too. If you're running a php script the file permission should be 644. If you're running a cgi script it should have 755 permissions. Your directories should have 755 or 750 permissions.Exceeding Time Limit If your script exceeds the time limit it can be killed by the system which will also result in a 500 error. The solution to this problem is to break your long executing scripts into multiple faster scripts that can call each other. For instance longscript.php always results in a 500 error because it exceeds the time limit, but if script1.php runs for a short time, and then calls script2.php which calls script3.php they can together execute the same code as longscript.php without exceeding the time limit and being killed.High Server Load If the server is currently experiencing high server load scripts can return a 500 error when they would normally work. This is more common on Johnny than Stevie since Johnny is more unstable, and accounts that cause high load on Stevie are suspended. There isn't really anything that can be done about high load 500 errors other than trying again later when the load is lower.
portalBlock Posted October 13, 2014 Author Posted October 13, 2014 Hi thank you for your reply. I think the only options would be 1 or 5, if it does not affect my users at all then thats fine. If in the future it does begin to affect them is it possible to get a raise on the usage cap for my account?
Tjoene Posted October 14, 2014 Posted October 14, 2014 For a regular site, the cpu cap shouldn't be a problem. But it is best to avoid having your site and cpanel open at the same time. This will generally trigger the 500 error on the site.If you need to develop your site, perhaps it's best to use a local server software (e.g. XAMPP).
Recommended Posts