Windows server: PHP violation error--what does this mean?

Windows server: PHP violation error--what does this mean?

by A. T. Wyatt -
Number of replies: 25
We have Moodle 1.6.2 running on a WIMP server (have been since August, 2006).  Several times I have seen an error message something like this:

PHP has encountered an Access Violation at 7C8224B2

when attempting to access moodle.  It appears to be somewhat random, and I can't tell you if the hex address is always the same.  The sysadmin does not know what is causing it, thus not how to fix it.  It disappears on its own after a few minutes.  I looked around on Google, but did not come up with anything that I could a) understand or b) thought would help.

Has anyone seen anything like this?  Could you point me to some help?  Is this a load problem?  I think not, because the last time it happened was at 5 a.m.!  But I guess the backups could have been running or something.

Server particulars:
Moodle1.6.2 (2006050521)
WIMP 2003 server  (IIS, but I do not know the version)
MySQL 4.1.20
PHP 5.1.4

Thanks in advance!
atw
Average of ratings: -
In reply to A. T. Wyatt

Re: Windows server: PHP violation error--what does this mean?

by Ken Wilson -

AT

This looks like it's another instance of the PHP bug which Dan Marsden has brought to our attention in the past. The PHP bug report is here (http://bugs.php.net/bug.php?id=38238).

Upgrading to php 5.1.6 is reported to be ineffective, so try moving back to php 5.1.2 and see how that goes.

Ken

In reply to Ken Wilson

Re: Windows server: PHP violation error--what does this mean?

by A. T. Wyatt -
Will do!  Thanks for the information!

atw
In reply to Ken Wilson

Re: Windows server: PHP violation error--what does this mean?

by Patrick Blaine -
Hi Ken and AT:

Just so you know, we're having the same problem in addition to (or possibly it's the cuase of) our IIS crashes that you (Ken) wrote me about the other day.  I thought I'd let you know that we tried using PHP 5.1.2 and continued to get Windows errors.  Our most common error is an application pool problem that we've been unable to find the source of.  We tried using a number of different versions of PHP, and every one ended up producing errors.  This latest round of problems only cropped up when we had a heavy userload. 

At this point, I think we're throwing in the towel and switching to Apache.  We don't have time to find another solution.

Patrick
In reply to Patrick Blaine

Re: Windows server: PHP violation error--what does this mean?

by A. T. Wyatt -
Well, I feel for you.  We aren't crippled, but this error worries me.  It doesn't happen all the time, but this is a production server; it should not be happening at all.  I have to say that we never had a problem on the LAMP instance last year, but it wasn't quite as heavily used. 

Do you think it is an IIS error, then, instead of PHP?  We have had to restart IIS several times since the semester began.  We don't know what is causing it to hang.

I think we are using IIS 6.x; we do run the patches weekly.
atw
In reply to A. T. Wyatt

Re: Windows server: PHP violation error--what does this mean?

by Patrick Blaine -
We're not really sure.  I personally think they're both conspiring together.  One glimmer of hope though--apparently PHP just released a new version that addresses a memory leak problem in 64 bit machines.  If it's the same problem, it could provide some relief.  We're, however, running a machine that only emulates 64 bit (not true 64) so I'm not sure if it will help us much.

Best of luck figuring this one out, and please do tell if you find a solution.
pb
In reply to Patrick Blaine

Re: Windows server: PHP violation error--what does this mean?

by Ken Wilson -

AT/Patrick

On thing is to try exempting the IIS worker process from DEP.

I've just done this with a clean install W2K3 R2 for PHP 5.1.6 - application pool settings are as default - and I'm not getting any of the errors that I get with DEP set On and with PHP 5.1.6 installed.

Can anyone confirm please? You need to reboot after changing the DEP settings: Right-click My Computer -> Advanced -> Settings -> Data Execution Prevention -> Turn On DEP for all programs except those I select -> Add c:\windows\system32\inetsrv\w3wp.exe.

I tested by overloading the server (using jmeter), then restarted and checked the event log for w3wp.exe application log errors.

Ken

In reply to Ken Wilson

Re: Windows server: PHP violation error--what does this mean?

by Patrick Blaine -
Hi Ken:

Thank you very much for the suggestion.  We tried implementing it, and should know in a couple of hours if we're getting the same errors.  We didn't want to overload the server, because we've got some potential users online right now.

Patrick
In reply to Ken Wilson

Re: Windows server: PHP violation error--what does this mean?

by Patrick Blaine -
Ok.  We tried Ken's suggestion, and still had some errors cropping up, but then we switched to the latest version of PHP (5.1.6) and haven't seen anything for a couple of hours now.  We can't give it a preliminary OK until tomorrow, and a definite one for about a week, but for now it seems to be running clean.

Patrick
In reply to Patrick Blaine

Re: Windows server: PHP violation error--what does this mean?

by A. T. Wyatt -
We made the change in IIS also, but have not yet upgraded the php.  I am keeping an eye out!  Will post back when we have more info.

Thanks, everyone!
atw
In reply to A. T. Wyatt

Re: Windows server: PHP violation error--what does this mean?

by A. T. Wyatt -
No joy.

"PHP has encountered an Access Violation at 7C8224B2" just came up.  It didn't last long, but it still happening.

Now we will think about upgrading the php.

atw
In reply to A. T. Wyatt

Re: Windows server: PHP violation error--what does this mean?

by Patrick Blaine -
We had some success with that, and I was just writing to tell you to do upgrade PHP as well, but right after I posted, we had a PHP Access violation that completely shut us down, and we had to reboot the server.  I'm not sure what will help this now, but we've got an Apache installation running parallel, so we might dump everything onto that and take our chances.  Will update whenever I can.
In reply to Patrick Blaine

Re: PHP violation error--DRAT it is still happening!

by A. T. Wyatt -
Yeah, us too!  We upgraded the php this afternoon.  Well, it didn't shut us down, but now the error says:
PHP has encountered an Access Violation at 7C81CAAF

The address is different, but same problem.

So it isn't the php version.

atw

In reply to A. T. Wyatt

Re: Windows server: PHP violation error--what does this mean?

by Michael McDermott -

Had the same problem since we upgraded to Moodle 1.6 on IIS and the only way round it was to reboot the server. Have downgraded PHP to 5.1.2 and fingers crossed all seems to be well, but it is early days.

Mike McDermott

In reply to Michael McDermott

Re: Windows server: PHP violation error--what does this mean?

by A. T. Wyatt -
We have never figured it out, and continue to have the problem intermittently. We did upgrade to php 1.5.6, but that did not solve the problem. Please do post if you think downgrading solves the issue.

atw
In reply to A. T. Wyatt

Re: Windows server: PHP violation error--what does this mean?

by Bob Eadie -

Joining this post rather late.  We are not getting violation errros, but the w3wp.exe process is grabbing all the processor it can get . . and this might be related to your problems?

We are on Moodle 1.6.1+ and php 5.1.3.  IIS6.

It seems to go pear-shaped when cron runs for the second or third time (and when it does its overnight backup).

If I restart cron (we run it as a service) things settle down for a while, until cron runs for the senond or third time (and I suppose does one if its infrequent tasks).

Are your systems showing the same behaviour?

Bob

In reply to A. T. Wyatt

Re: Windows server: PHP violation error--what does this mean?

by Patrick Blaine -
We also had similar problems and tried downgrading to no avail, but I wish you luck if you choose that path. We've switched to Apache instead of IIS, and that seems to have solved the problem. We're now running the latest versions of Apache and PHP very happily. One thing we hypothesize but can't prove yet is that the w3wp.exe errors could be associated with server load. For us they typically occur on Sunday night and other times when our traffic peaks.

PB
In reply to A. T. Wyatt

Re: Windows server: PHP violation error--what does this mean?

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi Everyone,

we had all sorts of issues with IIS App pools and PHP versions higher than 5.1.2

- I've tested 5.1.3, 5.1.4, 5.1.5 and I'm in the process of testing 5.1.6 on a new dev box.....hold on....5.1.6 still has the same problem - just checked my test box!

you end up with entries like this in the event log
"Faulting application w3wp.exe"

soo..... downgrading to 5.1.2 seems to be the only way to fix the app pool recycle

The issues increase when you have higher load on the server - initially you will just see the messages in the event log, but if traffic increases on your site, and the server experiences a higher than usual load it will take it down completely.

is there anyone in this thread experiencing this issue with PHP 5.1.2 - I'm interested to hear the specifics if there is....

smile

Dan
In reply to Dan Marsden

Re: Windows server: PHP violation error--what does this mean?

by Michael McDermott -
Dan,

You could have been working on my system, as your errors were exactly the same as mine, crashing on wp3wp.exe and Cron causing random problems all manifesting into a violation error. It stopped when PHP 5.1.2 was installed.

However since 5.1.2 has been installed, excel exports from gradebook corrupt after 60 entries. I know this is a different thread, but I am going back to my test server to check whether it is related to 5.1.2

smile

Mike
In reply to Dan Marsden

Re: Windows server: PHP violation error--what does this mean?

by Bob Eadie -

Thanks for this.  Although our problems are not identical (we do not get the 'faulting application' . . certainly w3wp.exe goes mad and grabs all the processor it can.

It certainly seems to be at times of high activity - but CRON activity rather than USER activity.  It goes beserk when CRON runs, and especially when a backup is being done. Specifically, during backup Phase 2: Executing and copying . . "user info" takes an absolute age (20 minutes for some courses).

I wonder if it is processor dependent?  We are running on dual Xeons, which means w3wp only grabs 25% of the TOTAL processor, which perhaps leaves it a little spare to get itself out of trouble (as it sometimes goes over the 25%).  Perhaps if you are running on a single processor, it cannot get itself out of trouble, and 'faults'.

I am keen to downgrade to 5.1.2 - but am not confident I can do that without losing settings etc. . . I will take advice (from our friendly php expert) and have a go.

Bob

In reply to Bob Eadie

Re: Windows server: PHP violation error--what does this mean?

by Gary Anderson -

On these errors, please confirm whether you are running a PHP accelerater, and if so, which one.

I had these type of problems, with Apache, until I came across X-Cache version 1.0.2 and then things worked fine with no more system level errors. http://trac.lighttpd.net/xcache/.  Note that I think I even had a problem when no cache was run, so experimenting with an appropriate accelerator might be worth investigating.

--Gary

In reply to Gary Anderson

Re: Windows server: PHP violation error--what does this mean?

by Bob Eadie -

I am not using any accelerator . . My general principle is to use a few different pieces of software as possible, as it is often the interaction between different software bits which causes problems . . so our server has Windows, php, MySQL and Moodle . . Oh - and AV . . . the bare minimum to (I thought) get things working.

I have had my fingers burnt before by adding on some 'tweaking' software, then to be told by the 'major players' that they don't guarantee their software with any other add-on.

Bob

In reply to Bob Eadie

Re: Windows server: PHP violation error--what does this mean?

by Gary Anderson -

Bob:

I share your philosophy about keeping things to the bare minimum.  I can only tell you  that a good accelerator increases responsiveness and decreases CPU load dynamically, in my experience.  Essentially it changes PHP from an interpreted language to more of a compiled language in terms of performance.

If you do choose to install one, like xcache, you can experiment between commenting in or out the load command in php.ini to see if it gives you appropriate performance and stability that you seek.  In the end, even though I share your philosophy, I went with a cache as part of my system.

--Gary

In reply to Gary Anderson

Re: Windows server: PHP violation error--what does this mean?

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Thanks for your input Gary!

I'm keen to look at PHP accelerators at some point - we've got a pretty high use site and the combination of IIS/PHP seems to be stable, but pretty cpu intensive on our boxes! - I've just upgraded to a VMWARE box running both our Web servers and backend DB, so I'm keen to make the "Best" use of the available resources on the box - can you point us to any good information on using Acelerator's in a Windows Environment?

smile

Dan
In reply to Bob Eadie

Re: Windows server: PHP violation error--what does this mean?

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
downgrading is actually pretty easy

all I do is unzip the new PHP directory,
copy the old php.ini over to the new directory
rename the old c:\php directory to something like c:\phpold
rename the new c:\php5.1.2.. directory to c:\php
Restart IIS

Hey Presto!

smile

Dan

In terms of loading/performance, we found our server fell over when it reached more than 4000 Moodle Log entries/per hour - Cron made it struggle, but the failure occured under high load in conjunction with the cron. (running dual 2.4GHZ Xeons)

In reply to Dan Marsden

Re: Windows server: PHP violation error--what does this mean?

by Jon Witts -
Picture of Plugin developers Picture of Testers
Just as a way of information to everyone running WIMP servers out there who may have encountered this problem...

I was running into this problem maybe once a week, sometimes having to completely reboot the server. However my server went down due to a completely unrelated incident (hard drive failure!), so I had to reinstall. I reinstalled it with Server 2003 R2 edition and since then have not encountered this error once (about four weeks and counting :D !)

Not sure if it is really a fix to the error, but PHP seems to behave a lot better with Server 2003 R2.

Jon