iopietro / Travianz-Legacy

Join our Discord Server: https://discordapp.com/invite/9fbJKP9 | New repo: https://github.com/iopietro/Travianz
GNU General Public License v3.0
160 stars 94 forks source link

Error on loading registration and login page #598

Closed futureman2007 closed 3 years ago

futureman2007 commented 3 years ago

bug report

  1. expected behaviour: Users can register/login. A corresponding page will be shown
  2. incorrect behaviour: When selecting "Register" or "login" on the home-page, a blank page will be shown.
  3. the operating system & version: Ubuntu18LTS
  4. PHP version on the server: 7.2
  5. MySQL / MariaDB version on the server: MariaDB 10.1.48
  6. Webserver: Apache2, version: 2.4.29 (Ubuntu)
  7. TravianZ: TravianZ-Legacy-8.3.5

Digging in the logfiles: After the login or register button was clicked in the webpage, the following php exception was thrown: Call to undefined function mb_internal_encoding() in /var/www/travianz/GameEngine/Session.php:5\nStack trace:\n#0 /var/www/travianz/GameEngine/Account.php(32): include_once()\n#1 /var/www/travianz/anmelden.php(20): include('/var/www/travia...')\n#2 {main}\n thrown in /var/www/travianz/GameEngine/Session.php on line 5, referer: http://81.169.203.197/

futureman2007 commented 3 years ago

I found the solution. And after googleing this issue i found, that noone has a solution for it posted. They fixed the problem but they don´t told the way how to fix it. So i will provide the answer: As of https://stackoverflow.com/questions/1216274/unable-to-call-the-built-in-mb-internal-encoding-method the error is thrown, because mbstrings are not a default part of PHP.

To fix the issue on Linux, install the extensions for PHP: sudo apt-get install php7.0-mbstring or sudo apt-get install php7.2-mbstring

after that you need to restart your webserver. When using apache2 (like me) on Ubuntu18LTS+: sudo systemctl reload apache2 sudo systemctl restart apache2

Now everything should work fine.