Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am currently having an issue with one of my websites hosted on my private server, several scripts are giving error 500 pages. The files may be corrupted personally I checked all MD5's on the files and their no longer corrupted after I have fixed them.
The following things are popping up in the logs:
/home/domain/logs/error
[Mon Jan 07 12:08:15 2013] [error] mod_fcgid: process /home/domain/fcgi-bin/php5.fcgi(36449) exit(communication error), get unexpected signal 11
[Mon Jan 07 12:08:21 2013] [error] mod_fcgid: process /home/domain/fcgi-bin/php5.fcgi(36453) exit(communication error), get unexpected signal 11
mod_fcgid: process /home/domain/fcgi-bin/php5.fcgi(..) exit(communication error), get unexpected signal 11
mod_fcgid: process /home/domain/fcgi-bin/php5.fcgi(..) exit(communication error), get unexpected signal 11
Apart from a rather terse log (I doubt that's the only errors that got logged) signal 11 means segmentation fault. Upload some newly made, simple, clean PHP file to test, else examine which configuration settings (httpd.conf, php.ini, my.cnf, .htaccess, etc, etc), includes and files to be served your "fixing" touched. Also if "corruption" means your site(s) suffered unwanted I-frame modifications best first address the cause for that.
Apart from a rather terse log (I doubt that's the only errors that got logged) signal 11 means segmentation fault. Upload some newly made, simple, clean PHP file to test, else examine which configuration settings (httpd.conf, php.ini, my.cnf, .htaccess, etc, etc), includes and files to be served your "fixing" touched. Also if "corruption" means your site(s) suffered unwanted I-frame modifications best first address the cause for that.
Ive been testing and checking things out on my server, other sites run perfectly fine it seems to be this specific ones. When I remove the client from the table 'inmate' they simply can resume using the website. It seems to be an error in the PHP File or The MySQL Database which causes this.
When adding my self to the table I simply get the error 500 when it tries to 'remove' me from the cool down and I hit refresh. Which makes it obviously it is an error generated trough the 'prison.php'
The Error:
Code:
[Mon Jan 07 15:56:19 2013] [notice] child pid 56406 exit signal Segmentation fault (11)
[Mon Jan 07 15:56:23 2013] [notice] child pid 55651 exit signal Segmentation fault (11)
[Mon Jan 07 15:56:27 2013] [notice] child pid 56387 exit signal Segmentation fault (11)
[Mon Jan 07 15:56:31 2013] [notice] child pid 56409 exit signal Segmentation fault (11)
[Mon Jan 07 15:56:36 2013] [notice] child pid 54788 exit signal Segmentation fault (11)
[Mon Jan 07 16:04:18 2013] [notice] child pid 56379 exit signal Segmentation fault (11)
[Mon Jan 07 16:04:22 2013] [notice] child pid 56804 exit signal Segmentation fault (11)
[Mon Jan 07 16:04:27 2013] [notice] child pid 56834 exit signal Segmentation fault (11)
[Mon Jan 07 16:04:32 2013] [notice] child pid 56439 exit signal Segmentation fault (11)
For your refference I will add the 'prison.php' to this post in a code tag.
Code:
<?php
require_once('../include/init.php');
if (!$account or !$account->getProfile()->id) Tools::redirect('/');
else Profile::activityOn($account->getProfile()->id);
$profile = $account->getProfile();
$_errors = array();
if (!Prison::check($profile->id)) Tools::redirect('/'); // Get out of jail if not there...
else $inmate = Prison::getInmate($profile->id);
$variables = array(
'profile' => $profile,
'account' => $account,
'current_time' => date('H:i:s d M Y'));
// Global game settings
$global_settings = new GameSettings();
$variables['global_settings'] = $global_settings;
if ($messages = Message::getAmount($profile->id)) $variables['unread_messages'] = $messages.' new';
if ($online_contacts = Contact::getNumber($profile->id, true)) $variables['online_contacts'] = $online_contacts.' online';
if ($alerts = Alert::getAmount($profile->id)) $variables['unread_alerts'] = $alerts. 'new';
$condition = new ProfileCondition($profile->id);
$stats = new ProfileStats($profile->id);
// Actions
if ($id_profile = Tools::getValue('attack')) {
$target_condition = new ProfileCondition($id_profile);
if ($condition->energy < 40) {
$_errors []= 'Error #PSN0010: '.FRONT_ERROR_PSN0010;
} elseif (!$inmate->shank) {
$_errors []= 'Error #PSN0003: '.FRONT_ERROR_PSN0003;
} elseif (!Prison::check($id_profile, $condition->location)) {
$_errors []= 'Error #PSN0001: '.FRONT_ERROR_PSN0001;
} elseif ($id_profile == $profile->id) {
$_errors []= 'Error #PSN0002: '.FRONT_ERROR_PSN0002;
} elseif (!$target_condition->canAttack()) {
$_errors []= 'Error #PSN0011: '.FRONT_ERROR_PSN0011;
} else {
$condition->change('energy', $condition->energy - 40);
if (Tools::probability($stats->fighting - 1)) {
$profile_condition_other = $target_condition;
$profile_other = new Profile($id_profile);
$result = $profile_condition_other->shank_attack($stats->fighting == 100 and rand(0,100) == 77);
if ($result['dead']) {
// Update statistics...
$stats->setStatistic('kills', $stats->statistics['kills'] + 1);
$stats->saveStatistics();
// Set death method to the prison method
$method = ProfileCondition::getDeathMethods(true);
FuneralHome::getByField(array('id_profile' => $profile_condition_other->id_profile))->setReason($method);
// 25% chance of guards seeing you... and increasing the sentence...
if (Tools::probability(25)) {
$inmate->increaseSentence(Prison::getSentence(CRIME_MURDER_IN_PRISON), CRIME_MURDER_IN_PRISON);
$alert_variables = array(); // Clear the variables...
$alert_variables['profile'] = $profile_other;
$alert_variables['action'] = 'prison_guards';
Alert::generate($profile->id, Alert::prepare($alert_variables, 'attack'));
}
// See if there was a contract around for this guy
$contract = Contract::getByField(array('id_profile' => $profile_other->id));
if ($contract->id) {
$condition->change('cash', $condition->cash + $contract->amount);
$alert_variables = array(); // Clear the variables...
$alert_variables['profile'] = $profile_other;
$alert_variables['amount'] = $contract->amount;
$alert_variables['action'] = 'contract';
Alert::generate($profile->id, Alert::prepare($alert_variables, 'attack'));
$contract->delete();
}
}
$alert_variables = array();
if ($result['dead']) {
$variables['success'] = 'You delivered a <u>fatal</u> blow to '.$profile_other->name;
$alert_variables['hit'] = $result['damage'];
}
$alert_variables['profile'] = new Profile($stats->id_profile);
$alert_variables['action'] = 'attack';
Alert::generate($profile_condition_other->id_profile, Alert::prepare($alert_variables, 'prison'));
} else {
$fails = array();
$fails []= ' made you drop the shank...';
$fails []= ' gave you a hard beating of his own...';
$fails []= ' ran away...';
$fails []= ' screamed and the guards came your way.';
$variables['failure'] = $profile_other->name.$fails[array_rand($fails)];
}
}
} elseif ($id_profile = Tools::getValue('rape')) {
if ($condition->energy < 40) {
$_errors []= 'Error #PSN0008: '.FRONT_ERROR_PSN0008;
} elseif (!Prison::check($id_profile, $condition->location)) {
$_errors []= 'Error #PSN0001: '.FRONT_ERROR_PSN0001;
} elseif ($id_profile == $profile->id) {
$_errors []= 'Error #PSN0009: '.FRONT_ERROR_PSN0009;
} else {
$condition->change('energy', $condition->energy - 40);
$inmate_other = PrisonInmate::getByField(array('id_profile' => intval($id_profile)));
$profile_other = new Profile($id_profile);
if (Tools::probability($stats->robbery - 1)) {
$robbed = round($inmate_other->cash * 0.05);
$inmate_other->cash -= $robbed;
$inmate_other->save();
$inmate->cash += $robbed;
$inmate->save();
if ($robbed) {
$variables['success'] = 'You stole $<b>'.$robbed.'</b> from '.$profile_other->name;
// Send out an alert...
$alert_variables['cash'] = $robbed;
$alert_variables['profile'] = new Profile($stats->id_profile);
$alert_variables['action'] = 'rape';
Alert::generate($inmate_other->id_profile, Alert::prepare($alert_variables, 'prison'));
} else $variables['failure'] = $profile_other->name.' didn\'t have any cash on him...';
} else {
$fails = array();
$fails []= ' was surrounded by his crew, you couldn\'t do it...';
$fails []= ' gave you a hard beating of his own...';
$fails []= ' ran away...';
$fails []= ' screamed and the guards came your way.';
$variables['failure'] = $profile_other->name.$fails[array_rand($fails)];
}
}
} elseif (Tools::getValue('shank', 'null') != 'null') {
if ($inmate->cash < 1000000) {
$_errors []= 'Error #PSN0004: '.FRONT_ERROR_PSN0004;
} elseif ($inmate->shank) {
$_errors []= 'Error #PSN0005: '.FRONT_ERROR_PSN0005;
} else {
$inmate->buyShank();
$variables['success'] = 'You have a <b>Shank</b>... quick hide it...';
}
} elseif (Tools::getValue('smokes', 'null') != 'null') {
if ($inmate->cash < 1000) {
$_errors []= 'Error #PSN0006: '.FRONT_ERROR_PSN0006;
} elseif ($condition->health >= 100) {
$_errors []= 'Error #PSN0007: '.FRONT_ERROR_PSN0007;
} else {
$inmate->cash -= 1000;
$inmate->save();
$condition->change('health', 100);
$variables['success'] = 'Good as new...';
}
} elseif (Tools::getValue('getout', 'null') != 'null') { // DEBUG CHEATS
$inmate->checkOut($condition);
Tools::redirect('/');
} elseif (Tools::getValue('check', 'null') != 'null') {
if (!Prison::check($profile->id)) Tools::redirect('/');
} elseif (Tools::getValue('cash', 'null') != 'null') {
$inmate->cash += 5000000;
$inmate->save();
$variables['success'] = 'Here ya\' go!';
$variables['inmate_self'] = $inmate;
$variables['inmates'] = PrisonInmate::getAll($condition->location);
$variables['condition'] = $condition;
$variables['stats'] = $stats;
$variables['prison_errors'] = $_errors;
$variables['in_prison'] = Prison::check($profile->id);
$template = $twig->loadTemplate('prison.html');
$template->display($variables);
Ive been testing and checking things out on my server, other sites run perfectly fine it seems to be this specific ones. When I remove the client from the table 'inmate' they simply can resume using the website. It seems to be an error in the PHP File or The MySQL Database which causes this.
You haven't told us what it exactly is you tested, if there's more clues in the error log files and if you examined other file you "fixed" including any configuration settings. Maybe check settings and stuff with a site that works OK. Else you'll have to make all services log verbose or in debug mode to gather more nfo.
You haven't told us what it exactly is you tested, if there's more clues in the error log files and if you examined other file you "fixed" including any configuration settings. Maybe check settings and stuff with a site that works OK. Else you'll have to make all services log verbose or in debug mode to gather more nfo.
There was not much in the error log beside the segfault error, the issue is solved by editing the prison.php was not functioning as intended.
Short explanation of the caused error:
The error was generated trough a class error within the execution of the prison.php in order to solve it a peace of code had to be changed in the PHP Program.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.