Search

My site suddenly can not be accessed, displayed Server Error 500 , I looked at the log, I do not know what it is

Attachments:
2015-08-18_8-28-25.jpg

@nonozone check that your database is accessible. Sometime when working locally I get that error when my database is unreachable / connections full. So php/symphony cannot get a connection to the database and seems to crash at a point where the date time zone is not set so it's not showing the correct error.

Why do other sites on the server as usual, including a another symphony site?

Check that the timezone configuration parameter is set in your config.php file.

Has anything changed in the server recently? A new deployment? Software update?

@brendo only apt-get update and apt-get upgrade in Debian. maybe updated the mysql-server.

My server timezone: root@demo# date -R Wed, 19 Aug 2015 08:51:09 +0800

the configure in symphony config.php:

77 ###### REGION ###### 78 'region' => array(
79 'timeformat' => 'g:i a',
80 'date
format' => 'm/d/Y',
81 'datetime_separator' => ' ',
82 'timezone' => 'Asia/Shanghai',
83 ),
84 ########

there is nothing wrong.

I do not understand why, I put local code uploaded to the server, this issue is resolved.

In fact, I did not make any changes on the server, but this problem has occurred twice.

Hmm strange. So to confirm, this is shared server which has multiple Symphony sites running on it. Until recently, all Symphony sites were running correctly, but now one site is having issues and erroring out with the message about the timezone not being set.

Is that correct?

  • Do you have any more backtrace than what is available in your screenshot (I'm curious where the DateTimeObj is being called from - perhaps it's a rogue extension)
  • Are all sites running with the timezone of Asia/Shanghai?

The easiest way to fix this is do as the error message suggests, set the date.timezone variable in your PHP conf. It won't answer why this has only just started to occur and why it only affects one of you Symphony sites and not all of them though.

@brendo

YES,it is.

All my websites are running with the timezone of A/S.

And this site is my mentioned before, the database php file miss a spaces(like <php?class...) when create or edit the DS.

Attachments:
2015-08-21_13-52-46.jpg

I found a solution,setting the date.timezone setting in php.ini to

date.timezone = America/New_York

or other timezone.

This issue spontaneously happened to one of my sites over the weekend.

[some date] [warn] [client [rogue IP]] mod_fcgid: stderr: PHP Fatal error:  Uncaught exception 'Exception' with message 'DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'GMT/0.0/no DST' instead' in /somepath/symphony/lib/core/class.datetimeobj.php:265, referer: [some referrer]
[some date] [warn] [client [rogue IP]] mod_fcgid: stderr: Stack trace:, referer: [some referrer]
[some date] [warn] [client [rogue IP]] mod_fcgid: stderr: #0 /somepath/symphony/lib/core/class.datetimeobj.php(265): DateTime->__construct(), referer: [some referrer]
[some date] [warn] [client [rogue IP]] mod_fcgid: stderr: #1 /somepath/symphony/lib/core/class.datetimeobj.php(222): DateTimeObj::parse('now'), referer: [some referrer]
[some date] [warn] [client [rogue IP]] mod_fcgid: stderr: #2 /somepath/symphony/lib/core/class.datetimeobj.php(199): DateTimeObj::format('now', 'c', false, NULL), [some referrer]
[some date] [warn] [client [rogue IP]] mod_fcgid: stderr: #3 /somepath/symphony/lib/core/class.log.php(342): DateTimeObj::get('c'), referer: [some referrer]
[some date] [warn] [client [rogue IP]] mod_fcgid: stderr: #4 /somepath[truncated] in /somepath/symphony/lib/core/class.datetimeobj.php on line 265, referer: [some referrer]

I checked config.php and it's still setting the correct timezone. I could see no changes to the files that the error log was complaining about.

This all seems to coincide with an apparent bot that was searching for files like /htaccess.txt, /components/com_mailto/views/sent/metadata.xml, /joomla.xml, /wp-admin/js/media-upload.dev.js You get the idea. This site has never had WordPress or Joomla installed, so definitely guessed URLs.

I cannot see any server updates during this time, and I cannot see any unauthorised access.

Can you think of any attack that might inadvertently reset/remove the PHP time zone?

What version of PHP are you running? If the site has been working before, my guess is your usual timezone just swapped to daylight savings, but the PHP/timezone database on the server doesn't know about DST in that region.

To test, you could try setting the same timezone from your config file in the php.ini file, or ask your host if there were any updates.

@brendo Thanks for the quick response.

PHP version is 5.3.3, time zone is Europe/London.

This issue started on 7 Nov, but BST ended on 25 Oct.

It's a private server, but the last automatic update occurred on 29 Oct according to the web control panel, but the changelog mentions nothing about PHP or timezones.

When I was trying to fix, setting date.timzone in a php.ini file in the root of the site did not work. I ended up applying date.timezone = "Europe/London" to the PHP settings page within the server's web control panel.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details