Page 1 of 1

Server down, getting 500 Errors - Help!

Posted: Thu Sep 21, 2006 1:51 am
by goldhilwebmaster
Running 1.01. Oahu
Operating system  FreeBSD 
Kernel version:  4.11-RELEASE-p13 
Apache version  1.3.34 (Unix) 
PERL version  5.8.8 
PHP version  4.4.2 
MySQL version  4.0.27-log 

All was well until this evening. Then started getting 500 Internal Server Errors when attempting to do anything in admin.

What is the php.core file in my admin folder, and should it be 12980224 bytes?

I've read that I might need to increase memory for PHP? Do I need to do this? If so, exactly how do I do this?

Thanks for any help. I'm really behind the 8-ball on this one.  :'(

Larry Ullman

Re: Server down, getting 500 Errors - Help!

Posted: Thu Sep 21, 2006 2:03 am
by Dee
goldhilwebmaster wrote: What is the php.core file in my admin folder, and should it be 12980224 bytes?
A .core file is a core dump, created when a process (php in this case) crashes, see for example
http://www.ncsa.uiuc.edu/UserInfo/Resou ... ore_43.htm
goldhilwebmaster wrote: I've read that I might need to increase memory for PHP? Do I need to do this? If so, exactly how do I do this?
If you have access to the server: by increasing the memory_limit setting in php.ini and restarting apache
See for (links to) more info: http://forum.cmsmadesimple.org/index.ph ... l#msg37375

Regards,
D

Re: Server down, getting 500 Errors - Help!

Posted: Sat Oct 07, 2006 11:47 am
by CMSMS-Fan
This has always been an issue with PHP applications demanding more memory.
Most people do not have any access to the php.ini file so the easiest way, and probably the best way, because it fixes the problem for all is to edit the config.php file by adding ini_set('memory_limit','32M'); in the first line of the code after the opening code i.e:-

Code: Select all

<?php
ini_set('memory_limit','32M');
The root of the problem is that the default set when installing PHP on a server is 8M and is a well documented issue.  CMSMS from version 1.2 has been using double that at times dependent on modules installed.  So could the developers add the option within the control panel to include this code to everyone's config.php by default.
It is all very well for the developers to change their own php.ini file or to do other hacks on their servers but most of us out here pay for hosting on remote servers and have little access to the server other than ftp.

Now her's the next problem: If you have no root access to the server you can't edit the config.php file.  One of the things you have to understand with PHP is that it runs on the server as the root user ie Root or Apachie etc so the files it creates from scratch belong to those users and not the FTP user which your provider gives you access with.  But not to worry because help is at hand with the help small application I found somewhere ages ago when I first encountered this problem when using SMF.  Download the atachment which is a txt file, save it on your computer, change the file extention to .php.  Upload it to your server and hit it with a browser.  Warning: If you can hit it with a browser then so can everyone else out her.  I have mine in a secure area on my server so it is password protected.  If it is not in a secure area someone could trash your server and files.  They can upload anything to your site so use it carefully.  The other way is to upload it, use it and delete it or CMOD to 600 so no one can execute it.

I hope this is helpful and I hope the developers are listening.


[gelöscht durch Administrator]

Re: Server down, getting 500 Errors - Help!

Posted: Sat Oct 07, 2006 1:47 pm
by tsw
ini_set wont help in cases where server settings wont allow users to change these settings.. its best to try contact the server admin and ask for him to do it. that way both sides know it.

and php isnt always run with apache user permissions. there are many ways to run php as current user rights (suexec, suphp and running them as cgi scripts) but some hosts wont do this for the small overhead it causes (which is strange as it is much more safe...)

Re: Server down, getting 500 Errors - Help!

Posted: Sat Oct 07, 2006 6:51 pm
by CMSMS-Fan
Yes point taken but the majority of people who ask the question about memory run-out don't have access to the root of their server and my solution is a quick fix which works for 90% of servers, if it doesn't work you would then have to go down the route of contacting your host.  if you have to contact one of the big server farm hosts the answer will be no we will not  allow the memory to be increased as they run everything at default and if they have 1,000s of servers they are not going to change them all unless you are a big payer and it makes bussiness sence to them.
The answer is for the wrihters of PHP for instalation on servers should up their default settings.  After all the web is no longer a flat environment most sites you vist now use interactive medea like PHP.

Re: Server down, getting 500 Errors - Help!

Posted: Sun Oct 08, 2006 2:06 pm
by tsw
true, I just wanted to point that out for people trying this and failing.

Re: Server down, getting 500 Errors - Help!

Posted: Sun Oct 08, 2006 2:59 pm
by Piratos
If you have a windows server you have general a problem with memory_limit, because the windows version of php have enable_memory disabled, it has no function.
So you can set what you want but without any action, the server runs with 8 MB default.