Osticket: Fatal error: Call to undefined function _S() in include/class.mailer.php on line 573

Created on 10 Jul 2017  ·  4Comments  ·  Source: osTicket/osTicket

Prerequisites

  • [ ] Can you reproduce the problem in a fresh installation of the "develop" branch?
  • [x] Do you have any errors in the PHP error log, or javascript console?
  • [x] Did you check the osTicket forums?
  • [x] Did you perform a cursory search to see if your bug or enhancement is already reported?

For more information on how to write a good bug report

Description

On a fresh osticket installation:

Strict Standards: Non-static method Misc::currentURL() should not be called statically in /opt/osticket/public/bootstrap.php on line 345

Notice: Undefined index: HTTPS in /opt/osticket/public/include/class.misc.php on line 148

Strict Standards: Non-static method Bootstrap::loadConfig() should not be called statically in /opt/osticket/public/main.inc.php on line 24

Notice: Constant ROOT_PATH already defined in /opt/osticket/public/include/ost-config.php on line 39

Strict Standards: Non-static method Bootstrap::i18n_prep() should not be called statically in /opt/osticket/public/main.inc.php on line 26

Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in /opt/osticket/public/bootstrap.php on line 289

Strict Standards: Non-static method Bootstrap::loadCode() should not be called statically in /opt/osticket/public/main.inc.php on line 27

Strict Standards: Non-static method Bootstrap::connect() should not be called statically in /opt/osticket/public/main.inc.php on line 28

Strict Standards: Non-static method Bootstrap::croak() should not be called statically in /opt/osticket/public/bootstrap.php on line 190

Strict Standards: Non-static method Mailer::sendmail() should not be called statically in /opt/osticket/public/bootstrap.php on line 295

Deprecated: Non-static method Misc::randCode() should not be called statically, assuming $this from incompatible context in /opt/osticket/public/include/class.mailer.php on line 144

Deprecated: Non-static method Crypto::random() should not be called statically, assuming $this from incompatible context in /opt/osticket/public/include/class.misc.php on line 30

Notice: Undefined index: reply-tag in /opt/osticket/public/include/class.mailer.php on line 441

Deprecated: Non-static method Format::html2text() should not be called statically, assuming $this from incompatible context in /opt/osticket/public/include/class.mailer.php on line 449

Strict Standards: Only variables should be passed by reference in /opt/osticket/public/include/html2text.php on line 64

Deprecated: Non-static method Mail::factory() should not be called statically, assuming $this from incompatible context in /opt/osticket/public/include/class.mailer.php on line 566

Fatal error: Call to undefined function _S() in /opt/osticket/public/include/class.mailer.php on line 573



Steps to Reproduce

  1. [First Step]
  2. [Second Step]
  3. [and so on...]

Expected behavior: [What you expected to happen]

Actual behavior: [What actually happened]

Versions

  • osTicket 1.10
  • PHP 5.6.30

Update: this seems to be happening when osTicket cannot connect to mysql, it seems it will try to send an email and that function uses _S(), however Internationlization::bootstrap only gets called during /setup/ ?

Most helpful comment

In my case the error occurred due to the database engine being down.

All 4 comments

Just in case anyone else is encountering this issue... I had this issue on CentOS 7 running Apache - with SELinux, however the database was on a separate system.
To test whether your issue is with SELinux: setenforce 0 and refresh the browser. osTicket should now work fine. If this is the case for you, here is the solution.

SELinux is disallowing apache to create network connections, so simply allow them.

setenforce 1 # We want SELinux to remain on!
setsebool -P httpd_can_network_connect_db 1

Easy

In my case the error occurred due to the database engine being down.

Despite the database being down, the problem here is that the email notification that the db is down fails due to this compilation error.

The function _S seems to come from the il8n module, but it's a bit complicated to trace if/how this function is actually loaded.
https://github.com/osTicket/osTicket/blob/master/include/cli/modules/i18n.php#L628

There might be a problem with DB connection! make sure your user has the password. root with no password can cause this error too.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dmnc-net picture dmnc-net  ·  3Comments

joseaguardia picture joseaguardia  ·  4Comments

simonnzg picture simonnzg  ·  5Comments

F3000 picture F3000  ·  5Comments

cervedgroup picture cervedgroup  ·  5Comments