7

I installed multiple drupal 7 sites using the Web Platform Installer on Windows Server 2008.

Until know they worked without any problems, but recently internal server error 500 started to show up (once every so many requests), now it happens for all requests to any of the php sites.

There's not much detail to go on, and nothing changed between the time when it was working and now (well nothing I know of anyway)

The log file is flooded with messages such as

[09-Aug-2011 09:08:04] PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0
[09-Aug-2011 09:08:16] PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0
[09-Aug-2011 09:08:16] PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0
[09-Aug-2011 09:08:20] PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0
[09-Aug-2011 09:08:22] PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0
[09-Aug-2011 09:08:51] PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0
[09-Aug-2011 09:09:56] PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0
[09-Aug-2011 09:09:57] PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0
[09-Aug-2011 09:12:13] PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0
[09-Aug-2011 09:15:09] PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0
[09-Aug-2011 09:15:09] PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0
[09-Aug-2011 09:21:28] PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0
[09-Aug-2011 09:21:28] PHP Fatal error:  Allowed memory size of 262144 bytes exhausted (tried to allocate 261904 bytes) in Unknown on line 0

I have tried increasing the memory limit in php.ini as such:

memory_limit = 512MB

But that doesn't seem to solve the problem either.

This is in the global php configuration in IIS When I looked at the sites one by one, I noticed that PHP seemed to have been disabled.

PHP is not enabled. Register new PHP version to enable PHP via FastCGI

So I tried to register the php version again

C:\Program Files\PHP\v5.3\php-cgi.exe

But when I try to apply the changes I get

There was an error while performing this operation Details: Operation is not valid due to the current state of the object

There doesn't seem to be any other information than that. I have no idea why all of a sudden php isn't available for the sites anymore.

PS: I have rebooted IIS, the server, etc... This server is hosted on amazon S3, so I gave the server some more power

Update These seem to be two different issues

  1. I used memory_limit=128MB instead of memory_limit=128M
    Notice the "M" instead of "MB"
  2. A memory_limit of 128M was not enough, had to increase it to 512M

The first issue caused internal server errors for every request.

Increasing to 512MB seemed to have solved the problem for a little while, but after a while the server errors return. Note that the PHP manager inside of IIS still shows there is no PHP available for the sites (the global config does see it as available)

So the problem remains unsolved

TimothyP
  • 299
  • 1
  • 5
  • 15
  • Have you tried rebooting the server? – joeqwerty Aug 10 '11 at 00:19
  • Obviously I have :D In fact, it's on amazon s3, so I even upgraded the server to a higher level. – TimothyP Aug 10 '11 at 00:27
  • Well it wasn't obvious because it wasn't stated in your question. Not being pedantic, just wanted to know for sure. Thanks for clarifying. – joeqwerty Aug 10 '11 at 00:29
  • Was not meant in a bad way :) My bad :) – TimothyP Aug 10 '11 at 00:39
  • No offense taken. :) – joeqwerty Aug 10 '11 at 00:47
  • Did you ever solve this? having the same problem myself. Have increased the php.ini memory size bu the error is still quoting a limit below what I set it to. – Rich Dec 06 '12 at 00:37
  • 2
    I did not solve it sorry, simply decided to get the php sites off the windows server and onto a second linux server. Since we're using cloud servers it took a few minutes to spin up a new one as opposed to spending time trying to get this working. – TimothyP Dec 06 '12 at 03:39
  • I found that IIS was adding a web.config file to the website's home file directory which was causing the "Operation is not valid due to the current state of the object" error. Once I renamed to web.config.old then PHP Manager picked up the PHP version again. – Jonty Jun 06 '17 at 14:45
  • Whats your issue? The 262Mbyte allocation? – bjoster Jan 08 '18 at 16:31

2 Answers2

1

Can you try installing the PHP Manager for IIS and see if PHP is configured properly for your site?

Download is here, http://phpmanager.codeplex.com/

hope this helps. -mark

Mark Brown
  • 11
  • 1
-2

Fresh new installation of Drupal shouldn't require a lot of memory. Most havy page is '/modules'. If any other page require more memory it means a slow/bad/wrong code was added to site. It could be a 3rd party modules or slow sql queries.

Try this:

  • Go to PHP Status page (admin/reports/status/php) and check memory limits there.
  • Memory limits could also be set in settings.php file and in .htaccess file. Check those files.
  • Install devel module. Enable showing slow sql queries and analize them. Once you've found a bad module just disable it and check memory usage and sql-queries again.
VladSavitsky
  • 101
  • 2
  • 0.25 MB is an **insanely** low memory limit. – ceejayoz Sep 08 '17 at 15:31
  • @ceejayoz Sure thing! But I didn't suggest this amount and it's not a default server's setting. Why are you wrote about '0.25Mb' memory limit? – VladSavitsky Oct 02 '17 at 19:04
  • OP wrote about it, not me. The errors they shared state "Allowed memory size of 262144 bytes exhausted" and I very much doubt any Drupal tweaking is going to make it work on that little RAM. It's unlikely they can even *load* `admin/reports/status/php` or install the `devel` module with it that low - it's likely 100% unusable. – ceejayoz Oct 02 '17 at 19:16