Author Message
JOhnMag4u
-

Joined: 16 Jul 2007
Posts: 7

Posted: Wed May 02, 2012 7:06 pm    Post subject: 500 Server Error

I have recently put together a PHP script (performing thousands of MySQL queries) which will take about 45 seconds for my server to run. After exactly 30 seconds the page times out saying: Error 500 Internal Server Error.

I have increased all the values in my php.ini (yes I ran php info to make sure I was editing the correct php.ini file). I also increased the Abyss timeout from the default 30 to 60.

I then saw I was getting errors in my CGI error log (I had PHP set to CGI, not FastCGI). The errors did not tell me much that was helpful. I read through this forum and found some people with this problem had luck switch to fastCGI. I tried both versions of local fastCGI and I get the following in my error log:

 Code: 02/May/2012:13:49:05 -0400   SUID: 0   PUID: 0   process_shutdown_now() 02/May/2012:13:49:14 -0400   SUID: 0   PUID: 0   RUID: 0   URI:    Reading 0 bytes failed = The process cannot access the file because it is being used by another process. 02/May/2012:13:49:14 -0400   SUID: 0   PUID: 0   RUID: 0   URI:    timeout-header2! 02/May/2012:13:49:44 -0400   SUID: 0   PUID: 0   RUID: 1   URI: /newtekconversion/convertToOpenCart.php   Reading 8 bytes failed = The process cannot access the file because it is being used by another process.

I also tried decreasing the Abyss Timeout setting to 5 seconds, but it still timed out after 30. Finally I increased all php.ini timeout and memory limitations AND the Abyss Timeout setting to a ridiculous amount of time, something like 3 days, and still have a 500 error after 30 seconds exactly. I am using YSlow and Firebug in FireFox to time the page load.

Any help and/or recommendations would be greatly appreciated!

FYI, I am running: Abyss Web Server X2 (v 2.7), PHP Version 5.2.7, MySQL 4.1.22, and Windows XP Pro

 Code:

In the above code, if I comment out:
 Code: $resultSelectItemNo = mysql_query($sqlSelectItemNo) or die(mysql_error());

_________________
JohnMag4u.com
jxxaxxy
-

Joined: 11 Nov 2010
Posts: 27

 Posted: Wed May 02, 2012 10:20 pm    Post subject: I ran into this problem with the Anti-hacking Protection. Or at least I think it is the same situation. When the script runs there is either an error or removed function from php all together due to updates/new version. So somewhere it is causing errors or thinking there is an error and the anti-hack kicks in and blocks your ip for a certain amount of time. I went back and forth with abyss in emails about this with really no answer for it. Try disabling the anti-hack feature and see if your 500 issue goes away. Also if you do have a 500 error see if you can access the page with another pc (another pc meaning different network as yours will be blocked). If it does access the page from another pc then it has to do with the auto ban of the anti-hacking software. I really didn't want to disable it but I can't always control what people put up for websites or there coding skills. It was a major headache!!!!!
JOhnMag4u
-

Joined: 16 Jul 2007
Posts: 7

 Posted: Wed May 02, 2012 10:51 pm    Post subject: Thanks for your feedback. I did read a few people talking about the anti-hacking feature causing a similar problem. Unfortunately, I already had anti-hacking turned off, so this shouldn't be causing the issue._________________JohnMag4u.com
Toasty
-

Joined: 21 Feb 2008
Posts: 295
Location: Chicago, IL

 Posted: Sat Jun 16, 2012 3:38 am    Post subject: I've had similar issues. Apache does the same thing in many instances. Your best bet it to run it CLI, like this: Start > Run > type "cmd" c:\phppath\php c:\path\to\php.file This eliminates the web server, this assumes that you don't require it being web accessible. If you do, revise your query. Finally, you can make your script progressive. The inserts (I assume) you're doing should have an auto-increment column. Use this to determine where the script left off, and refresh the browser to continue the inserts._________________Portfolio: Robert Lerner
chelsearason
-

Joined: 21 Jun 2012
Posts: 1

 Posted: Sat Jun 23, 2012 4:43 am    Post subject: Is there any way to make it work with the anti-hacking on? I mean I want it but I don't like to sacrifice security.
aprelium-support
-

Joined: 20 Feb 2009
Posts: 356

Posted: Thu Jun 28, 2012 2:05 pm    Post subject:

 chelsearason wrote: Is there any way to make it work with the anti-hacking on? I mean I want it but I don't like to sacrifice security.

This behavior has nothing to do with anti-hacking. Moreover, in version 2.8 things should run more smoothly as the software is more tolerant with faultly FastCGI processes (or those which timeout.)
_________________
Support Team
Aprelium - http://www.aprelium.com
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT + 1 Hour Page 1 of 1

 Jump to: Select a forum Miscellaneous----------------Forum Rules [READ THIS IF YOU ARE A NEW USER]Announcements Web Technologies----------------PHPPerlASP.NETClassic ASPFastCGI/CGIDatabasesWeb Design Abyss Web Server----------------Powered by AbyssTutorialsNetworking IssuesSSL/CertificatesURL RewritingGeneral QuestionsBug ReportsSuggestions/Ideas Aprelium's Lounge----------------Off Topic Discussions Beta Testing----------------2.5 Beta [Closed]
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum