My developer team at General Motors has no PHP experience but we have to help with a Drupal/PHP site that went down. I took the 10 lines from the error logs that look important. Could anyone help us understand what's happening from these 10 lines? Any help is appreciated.
PHP Warning: Module 'hash' already loaded in Unknown on line 0
[Sun Jul 23 11:30:04 2017] [notice] Apache/2.2.12 (Linux/SUSE) mod_ssl/2.2.12 OpenSSL/0.9.8j-fips configured -- resuming normal operations
[Sun Jul 23 11:30:05 2017] [notice] Graceful restart requested, doing restart
PHP Warning: Module 'hash' already loaded in Unknown on line 0
[Sun Jul 23 11:30:05 2017] [notice] Apache/2.2.12 (Linux/SUSE) mod_ssl/2.2.12 OpenSSL/0.9.8j-fips configured -- resuming normal operations
[Sun Jul 23 11:30:39 2017] [error] [client 198.208.85.51] ALERT - possible memory corruption detected - unknown Hashtable destructor (attacker '198.208.85.51', file '/www/theblog/index.php', line 19), referer: https://theblog.com/
[Sun Jul 23 22:18:58 2017] [error] Hostname theblock.com. provided via SNI and hostname theblock.com provided via HTTP are different
[Sun Jul 23 22:18:58 2017] [error] Hostname theblock.com. provided via SNI and hostname theblock.com provided via HTTP are different
[Sun Jul 23 22:59:46 2017] [error] [client 198.208.85.51] PHP Fatal error: Call to a member function getElementsByTagName() on a non-object in /www/theblock/modules/filter/filter.module on line 1123
[Sun Jul 23 23:07:21 2017] [error] [client 198.208.85.51] PHP Fatal error: Call to a member function getElementsByTagName() on a non-object in /www/theblock/modules/filter/filter.module on line 1123
Recollecting what was last done might help to resolve your issue. Since in apache error log the showing issue in filter module, check for latest text format if you have updated. (The failing point is when conversion happens from a DOM object back to an HTML snippet). Also verify if you have installed any new module prior to this failure.(if yes try to disable that module using db)
Related
My website crashes at random times because of a problem with MySQL and I can't quite pinpoint it. For one, the crash itself happens very seldom (perhaps once a month) so I can't replicate it. Because of that, I don't know what exactly is causing the issue.
When I first built our site many years ago, I was using mysql_ calls to connect to the database. I learned the error of my ways and started using PDO. Unfortunately, there is a LOT of code that used the mysql_ calls and I haven't gotten around to replacing every single one of them yet. So, my site has a mix between PDO and mysql_ calls.
When the site connects to the database, it first calls mysql_connect() and then connects to PDO through a wrapper.
The error I'm receiving comes into play when I use mysql_connect(). I've dug through logs and I can't find a specific cause for the error. As soon as it happens, it crashes the MySQL server and therefore the website. I can't even assume that mysql_ is the problem because it crashes before it even gets to the PDO wrapper. It might just be a MySQL connection issue.
I've done some searching and it looks like some others have recommended revising bind-address in my.cnf, which I've done.
I've also gone through the website and tried to remove as many mysql_ calls as possible.
Here's some example logfile output, with some info redacted:
Error connecting to database. Reason: Lost connection to MySQL server at 'reading initial communication packet', system error: 111
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Warning: Creating default object from empty value in database.php on line 89
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Fatal error: Call to a member function setErrorCallbackFunction() on a non-object in database.php on line $
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Warning: Creating default object from empty value in database.php on line 89
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Fatal error: Call to a member function setErrorCallbackFunction() on a non-object in database.php on lin$
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Warning: mysql_connect(): Lost connection to MySQL server at 'reading authorization packet', system error: 0 in $
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Warning: Creating default object from empty value in database.php on line 89
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Fatal error: Call to a member function setErrorCallbackFunction() on a non-object in database.php on line $
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Warning: Creating default object from empty value in database.php on line 89
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Fatal error: Call to a member function setErrorCallbackFunction() on a non-object in database.php on lin$
[Mon Jun 09 13:01:29 2014] [error] [client ****] PHP Warning: mysql_connect(): Lost connection to MySQL server at 'reading authorization packet', system error: 0 in $
Any help would be greatly appreciated.
If the MySQL server crashes, then this issue is caused by the MySQL daemon itself and not your client code.
It can't be the database (schema) either, as you don't get to this point. (the DB is selected after succesful connection )
Make sure that:
MySQL binaries are the latest version or at least the latest version that ships via your distribution package management (same for all libs used by MySQL)
the RAM in your server is sound, maybe run a memcheck
the harddisk in your server is sound, maybe run smart utils or a full disk scan
I'm using Debian 7 Wheezy with latest updates installed, including those from dotdeb-PHP repo. So PHP 5.5.8 is present.
I've installed eqDKP-plus (eqdkp-plus.eu) on my webserver. PHP is embedded through mod_fcgid in Apache.
Since 2 days everytime I visit any site of eqdkp I get response Code 500.
Following log-entries:
[Mon Jan 13 17:03:43 2014] [warn] [client xxxxxx] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Mon Jan 13 17:03:43 2014] [error] [client xxxxxx] Premature end of script headers: viewnews.php
[Mon Jan 13 17:07:46 2014] [error] mod_fcgid: process /var/www/cgi-bin/cgi_wrapper/cgi_wrapper(16094) exit(communication error), get signal 11, possible coredump generated
Do you guys have any ideas on how solve this problem? In the last few days/weeks I didn't change anything on my server, so this makes no sense to me.
I am getting the Apache Errors from AWS PHP Library, Here is the error I am getting from Apache error log file,
[Fri Aug 09 15:47:12 2013] [error] Failed to determine HOME directory after trying "sh: 1: cd: can't cd to ~" (exit code 2)
[Fri Aug 09 15:47:12 2013] [error] PHPSESSID f97oht9qlsuvknc45t075hohn5
[Fri Aug 09 15:47:12 2013] [error] f97oht9qlsuvknc45t075hohn5
[Fri Aug 09 15:47:12 2013] [error] f97oht9qlsuvknc45t075hohn5 =
I tried to fix the error with the help of these steps, after that I got the other 3 lines errors,
[Fri Aug 09 15:47:12 2013] [error] PHPSESSID f97oht9qlsuvknc45t075hohn5
[Fri Aug 09 15:47:12 2013] [error] f97oht9qlsuvknc45t075hohn5
[Fri Aug 09 15:47:12 2013] [error] f97oht9qlsuvknc45t075hohn5 =
How do I fix these errors?
Thanks for advance help.
If you are using version 1.6.x of the SDK and explicitly providing credentials to the client object (instead of relying the SDK's config discovery mechanism), then you could try using the AWS_DISABLE_CONFIG_AUTO_DISCOVERY constant to circumvent all of the self-discovery code.
You must define the constant before you include the SDK.
define('AWS_DISABLE_CONFIG_AUTO_DISCOVERY', true);
require '/path/to/sdk.class.php';
This will remove the need of the hack as described on isnoop's blog and may also resolve the issue with the other three lines showing up in your log (though I'm not sure why the SDK would cause those lines to appear).
I am not sure if this is related to PHP code/Joomla plugin/component or server issue so to go and post my question at serverfault.
I have a dedicated server running CentOS release 6.4 (Final) and CPanel 11.38.1 (build 15) with [Apache/2.2.24 (Unix) PHP/5.2.17] and recently we had brute force attacks which were causing system hangs with messages like "HANG: chkservd on server". After setting up a DenyHosts and changing ssh default port the server stabilized for some days until it started to suddenly hang with no specific errors in logs nor any email notifications.
The server runs just one website but with some traffic (about 2000 visitors per day) and a large Joomla database. The site was up and running flawlessly since March 2013, until two weeks ago.
After investigating, I have noticed that the error_log under the public_html (default Joomla site directory) size was over 200MB but with no specific error messages but just lines with date/time and zeros "0"!
[24-Jul-2013 12:09:18] 0
[24-Jul-2013 12:09:18] 0
[24-Jul-2013 12:09:18] 0
[24-Jul-2013 12:09:19] 0
[24-Jul-2013 12:09:19] 0
[24-Jul-2013 12:09:19] 0
[24-Jul-2013 12:09:19] 0
[24-Jul-2013 12:09:20] 0
[24-Jul-2013 12:09:26] 0
[24-Jul-2013 12:09:26] 0
[24-Jul-2013 12:09:30] 0
Almost every second, thousand lines like those above!
Sometimes the site crashes with "jos-Error: Application Instantiation Error" and some other times with an error:
PHP Fatal error: Call to a member function get() on a non-object in ...
which is due to database issues when Joomla tries to load params from the database and it fails.
I have setup a backup of the site on a local windows server machine with apache and php installed [Apache/2.2.19 (Win32) PHP/5.3.6] and these zero "0" errors also spawn on every site call with some more details in \Apache2\logs\error.log like:
[Wed Jul 24 14:42:32 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/
[Wed Jul 24 14:42:32 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/
[Wed Jul 24 14:42:32 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/
[Wed Jul 24 14:42:33 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/
[Wed Jul 24 14:42:33 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/
[Wed Jul 24 14:42:33 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/
[Wed Jul 24 14:42:56 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/mousiki
[Wed Jul 24 14:42:56 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/mousiki
[Wed Jul 24 14:42:56 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/mousiki
[Wed Jul 24 14:42:57 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/mousiki
[Wed Jul 24 14:42:57 2013] [error] [client 192.168.1.66] 0, referer: http://virtdev.ose.domain.com/mousiki
thus I assume it is not server related, but Joomla site related from a plugin/component.
Also, we have scanned the site with online site scanners and plain file search with antivirus tools for bot injections with no positive results.
How we can locate what is causing these zeros as errors?
Finally I found what is/was causing these zero errors.
First of all, to locate what was spawning these errors I did a grep to all sites php files for the php function error_log() (http://php.net/manual/en/function.error-log.php), which writes directly the string argument message without any other information like filename, line numbers etc. At the results I saw there was an error_log(0); at a Joomla plugin that it was enabled. After opening the plugin php file, I figured out that it was my addition in order to debug something and I've had totally forgotten there. So, after deleting the line there was no more zero character errors. I don't even remember what I wanted to achieve by that call, it doesn't make any sense at all. Maybe I wanted to use error_reporting(0) to disable all errors and mistyped.
And to make it clear, these errors were not related and responsible at all for the server crash/hang. I fixed the crashes by creating a new database and restoring the backup file, so, the old database was damaged.
Now, after 24 hours, there was no crashes/hangs and everything works perfect again.
EDIT:
After some further investigation, I have realized that this error_log(0) was not my addition and it was already there when I installed the plugin! The plugin/component is Joooid, an Android client for Joomla (http://www.joooid.com). The code is located at the plg_joooidcontent inside joooidcontent.php:
...
/**
* #since 1.6
*/
public function onContentPrepare($context, &$row, &$params, $page=0)
{
error_log(0);
//echo "<pre>";
$row ->text = $this->executeTokens($row->text);
//print_r($row);
//die();
}
...
Even now it is there with the latest release. I will send them a link to this question so to inform them about it.
After installing MODX Revolution I cannot log in - just a blank page is displayed. My setup: MODX downloaded from git, PHP 5.3, Apache 2.2, OS ubuntu.
In apache error log I see this message:
[Sun Sep 04 08:03:12 2011] [error] PHP Fatal error: Call to a member
function render() on a non-object in
/var/www/modx/manager/controllers/default/welcome.class.php on line
64 [Sun Sep 04 08:03:12 2011] [error] PHP Stack trace: [Sun Sep 04
08:03:12 2011] [error] PHP 1. {main}()
/var/www/modx/manager/index.php:0 [Sun Sep 04 08:03:12 2011] [error]
PHP 2. modManagerRequest->handleRequest()
/var/www/modx/manager/index.php:71 [Sun Sep 04 08:03:12 2011] [error]
PHP 3. modManagerRequest->prepareResponse()
/var/www/modx/core/model/modx/modmanagerrequest.class.php:124 [Sun
Sep 04 08:03:12 2011] [error] PHP 4.
modManagerResponse->outputContent()
/var/www/modx/core/model/modx/modmanagerrequest.class.php:173 [Sun
Sep 04 08:03:12 2011] [error] PHP 5. modManagerController->render()
/var/www/modx/core/model/modx/modmanagerresponse.class.php:106 [Sun
Sep 04 08:03:12 2011] [error] PHP 6.
WelcomeManagerController->process()
/var/www/modx/core/model/modx/modmanagercontroller.class.php:133
Actually, Paul Graffam is right in the comments, when building from git (either through a clone or download from github), you need to run transport.core.php as well as some other things the first time you do it.
Specific instructions can be found here: http://rtfm.modx.com/display/revolution20/Git+Installation
An alternative if you don't want to go through those steps is to download a nightly build from http://modx.com/download/nightlies/ - you can install them as normal there.
(Realise I'm a bit late to the question, but figured others might stuble across it in the future and there's no answer yet)