[thelist] HTTP 500 error

Nadeem Hosenbokus nadeem at multigraphics.biz
Thu Aug 23 02:37:28 CDT 2007



I am at a loss. We recently launched a site (HYPERLINK
"http://www.myjob.mu/"http://www.myjob.mu) written in PHP using MySQL (and
not yet fully Firefox compatible and still using tables and not CSS – I only
had 2 months to write this whole thing!). Our tests revealed no problems and
on the first day the site ran fine.


On the second day we started getting 500 errors. The hosting support service
told me that there were stalled processes and by monitoring the processes on
the server I managed to identify some pages that were causing the problem.


These pages all contained a particular SQL query that, with the live data
(as opposed to our meagre test data), took over 200 seconds to execute! So I
removed these pages and broke down the way the data was displayed in order
to circumvent the necessity for the long query and things were working fine.


There are no longer any lengthy queries and all queries have a ‘limit
xxx,20’ at the end (where xxxis determined by the page you’re on). 


Then today, after the addition of a new page two days ago, a 500 error came


The new page is not significantly different from several other pages: 


I have a page that has been in the site since the problems stopped that
lists only the last 20 vacancies (HYPERLINK
hp). The new page (HYPERLINK
te_all.php) lists all vacancies displaying 20 per page so the code is
exactly the same except for one additional SQL statement (“select
count(vacancyid) from vacancies”) and a change to the original SQL query to
retrieve the data (“limit 0,20” is replaced with “limit
$limitstart,$limitend”). Then there is the additional PHP code to create the
page menus for the remaining results but this code is on several other pages
that have not caused any problems in the past.


Initially I thought that the problem was due to the limit on database
connections (20 per db user – the site using only one db user) but, although
it was the cause for the original problems, when I compare the SQL queries
and test them (execution time between 0.02 and 0.04 seconds) I can’t accept
that the problem is with my query and MySQL this time round.


I have checked my .htaccess file and there is only one line that defines the
error page for 500 errors. My file permissions are what we normally have on
our sites (664). I am not running any third-party modules nor am I accessing
any off-site resources. Also, we have numerous sites hosted with our hosting
provider and have not come across this problem on any of our other sites. 


Has anyone encountered a similar problem or have any ideas/insight into


Many thanks in advance,


A very stressed and tired developer… 

Nadeem Hosenbokus
Lead Consultant
Exocet Studios - a brand of Multigraphics Ltd
Office:  (+230) 212 6390 / 208 6499
Mobile: (+230) 254 8221
Fax:     (+230) 212 6789
24 St. Georges Street, Port Louis
HYPERLINK "http://www.multigraphics.biz"www.multigraphics.biz

This email may contain confidential information that is intended for the
recipient(s) only. If you have received this email and are not an addressee,
or in part responsible for the delivery of this message, then you should not
read, copy or deliver this message to anyone. Kindly notify the sender and
then destroy this message. Any views, opinions, conclusions, comments or any
other information in this message that is not related to official business
shall be understood as being neither provided by or endorsed by


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.484 / Virus Database: 269.12.2/967 - Release Date: 22/08/2007

More information about the thelist mailing list