Apache resets after writing to MySQL

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Apache resets after writing to MySQL

Postby Rallyaht » 05. July 2010 23:12

Hi,
I installed XAMPP Version 1.7.2 immediately after I upgraded to Windows 7 about 6 months ago. I am developing a website with a MySQL database.
Everything has been working beautifully with one exception. If the site tries to write any text or VARCHAR type field that is longer than 249 characters, to any of the database tables(InnoDB), the Apache server resets with the following error message.

Problem Event Name: APPCRASH
Application Name: httpd.exe
Application Version: 2.2.12.0
Application Timestamp: 4a66dd7b
Fault Module Name: php5ts.dll
Fault Module Version: 5.3.0.0
Fault Module Timestamp: 4a4d06fc
Exception Code: c0000005
Exception Offset: 0000c120
OS Version: 6.1.7600.2.0.0.256.48
Locale ID: 3081
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

The data is actually written to the table prior to the server crash.

I use a shared host, (Linux/Apache version 2.2.15/ MySQL version 5.0.90-community), for the live site and there are no problems at all.

I have searched this forum but any similar problems seem to relate to installations using Drupal, Wordpress or xdebug. I don’t use any of these.

I would certainly appreciate any assistance with solving this issue.

Thanks and regards
Tony
Rallyaht
 
Posts: 2
Joined: 04. July 2010 22:19

Re: Apache resets after writing to MySQL

Postby JonB » 09. July 2010 02:39

Its likely because XAMPP's MySQL defaults to the UTF8 chracter set, which is a variable double byte character set. (I just recently learned this myself working on a multi-lingual project) and seeing what was what. I'm still learning, LOL

http://en.wikipedia.org/wiki/UTF-8

VARCHAR does have a limit of 255 in MySQL, despite what InnoDB supports (pretty sure on this, but could also be out-of-date). You lose one byte to hold the field length anyway, right? (Gee I need to watch that guy from Linux CBT again, LOL.)

http://mysqldba.blogspot.com/2007/06/in ... rings.html

Check on the shared host and see what those database's character set is, I'm betting on latin_1.

I 'think' you can make the argument in SQL at creation time, rather than trying to 'fix' the XAMPP MySQL defaults (I don't know if you can change it in the phpMyAdmin with create database.)

http://dev.mysql.com/doc/refman/5.1/en/ ... erver.html

You would expect a graceful error though wouldn't you? Its actually PHP that is failing though. so there might be a fix needed there as well. (No, don't know that one),

I can't address the question on text fields as you didn't specify the particular of 'which text field type'.

this might be useful (I looked up how the function works for myself becasue this troubled me)

strlen
Official documentation: strlen
Risk: low
Impact: results in bytes not characters
strlen simply counts the number of bytes in a string, not the number of characters. This means for UTF-8 the integer it returns is actually longer than the number of characters in the string.

Note that this may not always be a problem - see the strpos discussion below for an example where working in bytes not characters produces expected results.

http://www.phpwact.org/php/i18n/utf-8

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Apache resets after writing to MySQL

Postby Rallyaht » 09. July 2010 23:24

Hi JonB
Thanks for your suggestions, but on further investigation the issue doesn't seem to be with MySQL. I can save any length text directly into a table field, through phpMyAdmin, without any problems. It's when I try to retrieve the record through the web page that the server crashes.
I have just looked at the Apache error log (for the first time ever!). Each time there is a crash I get
[Sat Jul 10 06:00:22 2010] [notice] Parent: child process exited with status 3221225477 -- Restarting.

Searching the web showed that this error occurs quite a lot, in a range of situations. There have been a number of fixes suggested mainly relating to copying libmysql.dll to various directories. None of these have worked for me.

I guess I'll just keep searching, unless anyone has any other ideas.

Thanks again
Tony
Rallyaht
 
Posts: 2
Joined: 04. July 2010 22:19

Re: Apache resets after writing to MySQL

Postby JonB » 10. July 2010 14:46

OK - I didn't fully have my geek hat on.

I'm pretty sure you actually are getting a Windows OS error. I'm guessing a memory fault.

Exception Code: c0000005
Exception Offset: 0000c120
OS Version: 6.1.7600.2.0.0.256.48
Locale ID: 3081
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789


that is the general form of a Windows unhanded exception fault.

Google Exception Code c0000005
(edited) read down a bit in this:
http://www.windowsbbs.com/windows-2000/ ... ation.html

And that makes total sense;

The Apache process restarts because a module it loaded (php5ts.dll) has had an OS fault - so the memory and process space is invalid (its an unrecoverable error).

I'm a systems integrator and I put on my 'MySQL' hat on that problem, before I had really examined the error codes.

BAD SERVER GEEK, BAD BAD - no liver snaps today!

Try your code on a different machine, even better with a different OS version - if it works - problem with machine or OS version. If it still fails, (now, I think very likley) a problem with the DLL compilation or source code. If that is the case, you will want to report the PHP bug (because that is what it will be). People are finding bugs all the time.

Good Luck

:mrgreen: <== Mr. Green Smart Version.
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 66 guests