Lunarpages Web Hosting Forum

Author Topic: My sites are all DOWN - 500 Internal Server Errors  (Read 11309 times)

Offline EnglishMajor

  • Trekkie
  • **
  • Posts: 17
Re: My sites are all DOWN - 500 Internal Server Errors
« Reply #15 on: February 11, 2019, 12:10:58 PM »
P.S. If I'm going to complain about customer support, I should also give credit where it is due, as I did in a related thread.  Laurențiu Victor Vișan provided a very detailed response when other customer service representatives did not. Although his suggestions did not resolve all issues, they resolved some.

Offline Malin Cenusa

  • Junior System Administrator
  • Support
  • Spaceship Navigator
  • *****
  • Posts: 86
  • The World Is Not Enough
    • Solutions Straight from Tech Support
Re: My sites are all DOWN - 500 Internal Server Errors
« Reply #16 on: February 15, 2019, 11:38:02 AM »
Hello @EnglishMajor, thank you for providing the requested ticket ID. I was able to track down the ticket and asked my supervisor to review and address it further.

Next, concerning your enquiry about the possibility to identify running processes, the amount of memory used and the possibility to kill them. Unfortunately cPanel does not provide such functionality. There is similar functionality integrated into the WHM panel, but on the shared environment, access to it is limited to our technicians only.

However, there are ways around this. One would be through shell access which we offer as an add-on. The shell access would offer you to execute commands via the terminal and get a list of all processes running under your user along with the PID's and resources used. This also allows you to kill the processes if needed.

Another solution, which may not work if there are not enough resources would be to use PHP scripts to pass commands to the shell.

A PHP file with the following contents would allow you to get all processes running under your username:

<?php system("ps -eo pid,user,cmd | grep `whoami`");  ?>

A similar PHP file with a form where you input the process ID and it executes the kill command would help you kill a specific process.

Both functions work only if the "system()" function is not disabled for security reasons in php.ini. If it is you can simply comment out the value while you do the execution of the PHP script.

Next, I have also revised your account's usage with my colleagues and noticed that the usage was stable over the past days. There were no suspicious processes recorded and most of the resource exhaust appears to have come from attacks targeting the scripts installed or from crawlers. We also noticed that you have blocked the vast majority through .htaccess which helps keep the resources within limits.

My colleagues will revise more in depth and will get back to you on the matter.
Malin Cenusa

Junior System Administrator - Managed Shared Hosting Team

Offline EnglishMajor

  • Trekkie
  • **
  • Posts: 17
Re: My sites are all DOWN - 500 Internal Server Errors
« Reply #17 on: February 15, 2019, 01:03:14 PM »
Thank you, @Malin Cenusa. That is very helpful. I will definitely experiment with the PHP commands you mentioned. I expect there to be enough resources to execute a single line of code from time to time. ;-)

The problem with banning hackers by ip in .htaccess is that they are always reappearing with new ip addresses. Does LP do any banning on a server configuration level?

Offline BuckyBob

  • Spaceship Captain
  • *****
  • Posts: 123
Re: My sites are all DOWN - 500 Internal Server Errors
« Reply #18 on: June 13, 2019, 09:13:52 AM »
Well, ONE of my sites is down,
and tracing the error_log file
tells me it's some mysql calls in a php file.

Without getting too specific,
this php file was compliant with php 4, and sorta worked with php 5
but now that php 7 is working, this script breaks.

I know what to do to edit this file, make it php 7 compliant,
but - is there any other fix, perhaps to put in something on a php.ini file ? 

Thanks in advance for answering me - if I am hijaaking this thread I apologize. 

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6429
Re: My sites are all DOWN - 500 Internal Server Errors
« Reply #19 on: June 13, 2019, 09:27:19 AM »
Unfortunately, LP refuses to support PHP 7.1 any more, and has 7.2 as the minimum possible level. 7.2 is very strict about what is allowed. You may be able to get moved to a PHP 5.6 server, but in any case should take the reprieve to update your site.

Are you specifically getting PHP errors, or are you getting warnings about using deprecated features? Such warnings can be shut off with a PHP ini_set() call, but keep in mind that eventually those will turn into real, fatal errors. I.e., they should still be fixed ASAP. I'm not familiar with any MySQL upgrades that are causing problems, but I suppose it's possible (MySQL is often upgraded along with PHP).

I have complained very loudly about their refusal to allow PHP 7.1 any more, but they insist it's out of support (which it isn't, for another 6 months).
Visit My Site

E-mail Me
-= From the ashes shall rise a sooty tern =-

Offline BuckyBob

  • Spaceship Captain
  • *****
  • Posts: 123
Re: My sites are all DOWN - 500 Internal Server Errors
« Reply #20 on: June 13, 2019, 09:36:59 AM »
ya, i not write 7.1 or 7.2 - and the problem is with php4 compliant script being 'run' by php 7.2
It just doesn't work - the mysql calls in this script are php4 compliant.
So, I've got to mod the file to be php 7.2 compliant - my easiest example is a call to 'mysqli' , must change over 100 instances of a call via 'mysql' to 'mysqli' .  it's not just a single word replacement, the functions have to be rewritten to be php 7.2 compliant .  Hooray open source ! ug !

Yes, the errors are php errors, the script stops with the first error :D
I understand the pattern, as well. ug !

I'm ok with making the change. 
I will not ask to move to another server (I have many domains in my account here, and am happy mostly).

Thank you for your insight - I really appreciate it !
---
Unfortunately, LP refuses to support PHP 7.1 any more, and has 7.2 as the minimum possible level. 7.2 is very strict about what is allowed. You may be able to get moved to a PHP 5.6 server, but in any case should take the reprieve to update your site.

Are you specifically getting PHP errors, or are you getting warnings about using deprecated features? Such warnings can be shut off with a PHP ini_set() call, but keep in mind that eventually those will turn into real, fatal errors. I.e., they should still be fixed ASAP. I'm not familiar with any MySQL upgrades that are causing problems, but I suppose it's possible (MySQL is often upgraded along with PHP).

I have complained very loudly about their refusal to allow PHP 7.1 any more, but they insist it's out of support (which it isn't, for another 6 months).
« Last Edit: June 13, 2019, 09:39:38 AM by BuckyBob »

Offline MrPhil

  • Senior Moderator
  • Berserker Poster
  • *****
  • Posts: 6429
Re: My sites are all DOWN - 500 Internal Server Errors
« Reply #21 on: June 13, 2019, 03:09:21 PM »
Just to nitpick a little (as if you need it...), modern versions of PHP now typically support only MySQLi, rather than the ancient MySQL API. It's tedious work to convert MySQL calls to MySQLi, but not rocket science (unless you want to rewrite procedural code to OO). PHP itself has a number of gotchas, such as banning object constructors named the same as the class (use __construct instead). See https://www.php.net/manual/en/migrationXX.deprecated.php, where XX is 72, 71, 70, 56, 55, etc.
Visit My Site

E-mail Me
-= From the ashes shall rise a sooty tern =-