meeting-room-booking-system / mrbs-code

MRBS application code
Other
127 stars 63 forks source link

Migrated to a new server #2224

Open jberanek opened 6 years ago

jberanek commented 6 years ago

I have migrated our MRBS setup to a new server. I imported the database into the MySQL instance on the new serverr with the same database name. When I bring up MRBS, everything looks fine. That is until I go to log in. After entering my credentials, I get this:

Whoops! Unfortunately MRBS has encountered a fatal error. Please consult your system administrator.

The new server is running the following: MySQL 5.7.22 Apache 2.4.29 PHP 7.2.5 phpMyAdmin 4.8.1 Ubuntu 18.04 LTS

Can you think of anything that I might have missed?

Reported by: *anonymous

Original Ticket: mrbs/support-requests/1515

jberanek commented 6 years ago

I should mention that I basically copied all of the files from the old server to the new one. So all settings should be the same.

Original comment by: *anonymous

jberanek commented 6 years ago

I would look in your web server/PHP log, as it should provide more information on the error.

However, I'd suspect that your database doesn't have the user MRBS is trying to use defined.

Original comment by: jberanek

jberanek commented 6 years ago

Although the "after entering my credentials" might make me doubt my guess, the log file is a better start.

Original comment by: jberanek

jberanek commented 6 years ago

Thanks for your quick reply, John. Can you tell me how/where to check the log file?

Original comment by: *anonymous

jberanek commented 6 years ago

Here is what I found from the login attempt in the log:

[Tue May 29 14:17:15.076931 2018] [php7:notice] [pid 4940] [client 172.16.42.42:58177] Uncaught exception 'Error' in /var/www/html/borrs/auth/auth_imap_php.inc at line 80\nCall to undefined function MRBS\\imap_open()\n#0 /var/www/html/borrs/session/session_php.inc(160): MRBS\\authValidateUser('mcrockett@rvu.e...', '4653Xxxx')\n#1 /var/www/html/borrs/mrbs_auth.inc(9): require_once('/var/www/html/b...')\n#2 /var/www/html/borrs/defaultincludes.inc(32): require_once('/var/www/html/b...')\n#3 /var/www/html/borrs/admin.php(15): require('/var/www/html/b...')\n#4 {main}\nMRBS GET: Array\n(\n)\nMRBS POST: Array\n(\n    [csrf_token] => 3506ef53e0c8bfa3b5764b3603154586a5d5bdca5f9ff4603b7c74bd274b8c55\n    [returl] => http://rvuinet.rvu.edu/borrs/day.php?year=2018&month=05&day=29&area=1&room=9\n    [target_url] => day.php?year=2018&month=05&day=29&area=1&room=9\n    [action] => SetName\n    [username] => [snipped]\n    [password] => [snipped]\n)\nMRBS SESSION: Array\n(\n    [csrf_token] => 3506ef53e0c8bfa3b5764b3603154586a5d5bdca5f9ff4603b7c74bd274b8c55\n)\n, referer: http://rvuinet.rvu.edu/borrs/admin.php

One thing is that the folder structure is slightly different on this new server. Could there be anything in the database alluding to the folder structure of the old server that might need to be updated?

Original comment by: *anonymous

jberanek commented 6 years ago

It's normally a file called error_log in your MRBS directory. But if you can't find it you can arrange to have errors sent to the browser by adding the following lines to the bottom of internalconfig.inc.php:

error_reporting(-1);
ini_set('display_errors', '1');

But remember to remove them before turning your site live again.

Original comment by: campbell-m

jberanek commented 6 years ago

I think the problem is probably that your new server doesn't have the PHP imap extension enabled. See http://php.net/manual/en/imap.setup.php for details of how to do this.

If you can't get it installed then one possibility might be to change your authentication type from 'imap_php' to 'imap' - provided that you are not using any of the configuration options specific to imap_php.

Original comment by: campbell-m

jberanek commented 6 years ago

I would also change your password for 'mcrockett' as a security measure.

Original comment by: campbell-m

jberanek commented 6 years ago

Campbell, You are exactly right. That occurred to me while I was in a meeting earlier. Once I got back to my desk, I installed that extension and everything worked. Thanks again, guys.

Original comment by: *anonymous