View Issue Details

IDProjectCategoryView StatusLast Update
0020484mantisbtinstallationpublic2016-01-30 09:59
Reporterbiju_ps Assigned Toatrol  
PriorityhighSeveritycrashReproducibilityalways
Status closedResolutionno change required 
PlatformWindows OSWindows 2008 Server 
Product Version1.2.19 
Summary0020484: Internal Server Error -500 after installation
Description

I am are trying Mantis. I have successfully installed Mantis on the system. Mantis showing the login screen .While I am trying to login with user name administrator and password root , I am getting a Internal Serever Error (500)

Using Mysql 5.6 64 bit , connecting using Mysqli
Os Windows 2008 64Bit

Additional Information

Php Error log

[07-Jan-2016 11:39:05 Asia/Kolkata] PHP Fatal error: Uncaught Error: Call to undefined function user_pref_get_language() in C:\inetpub\wwwroot\kalyanTickets\core\lang_api.php:104
Stack trace:
#0 C:\inetpub\wwwroot\kalyanTickets\core\error_api.php(82): lang_get_default()
0000001 C:\inetpub\wwwroot\kalyanTickets\core\string_api.php(33): error_handler(8192, 'Methods with th...', 'C:\inetpub\wwwr...', 31, Array)
0000002 C:\inetpub\wwwroot\kalyanTickets\core\string_api.php(33): require_once()
0000003 C:\inetpub\wwwroot\kalyanTickets\core\email_api.php(40): require_once('C:\inetpub\wwwr...')
0000004 C:\inetpub\wwwroot\kalyanTickets\core\bug_api.php(33): require_once('C:\inetpub\wwwr...')
0000005 C:\inetpub\wwwroot\kalyanTickets\core\project_api.php(36): require_once('C:\inetpub\wwwr...')
#6 C:\inetpub\wwwroot\kalyanTickets\core.php(239): require_once('C:\inetpub\wwwr...')
0000007 C:\inetpub\wwwroot\kalyanTickets\login_cookie_test.php(28): require_once('C:\inetpub\wwwr...')
#8 {main}
thrown in C:\inetpub\wwwroot\kalyanTickets\core\lang_api.php on line 104

TagsNo tags attached.
Attached Files

Relationships

related to 0011584 closedgrangeway Call to undefined function user_pref_get_language() 

Activities

atrol

atrol

2016-01-07 02:48

developer   ~0052264

Last edited: 2016-01-07 02:52

Which PHP version do you use?

Are you able to fix the issue by following those steps 0011584:0030648?

biju_ps

biju_ps

2016-01-07 02:58

reporter   ~0052265

PHP version 7

atrol

atrol

2016-01-07 03:09

developer   ~0052267

PHP version 7
Not recommended as 1.2.x has been developed/released long time before PHP 7 has been released.
Furthermore PHP 7 is not 100% upward compatible to PHP 5.x

Did you read/try my second hint?

Are you able to fix the issue by following those steps 0011584:0030648?

biju_ps

biju_ps

2016-01-07 03:20

reporter   ~0052268

No ,I have changed var to Public in relationship_api.php , but no luck

mantiError.png (16,200 bytes)   
mantiError.png (16,200 bytes)   
biju_ps

biju_ps

2016-01-07 05:36

reporter   ~0052269

I have downgraded to PHP 5.6, Working perfectly in PHP 5.6

atrol

atrol

2016-01-07 05:43

developer   ~0052270

Thanks for the feedback.

We will hardly certify/change version 1.2.x to run with PHP 7.
The final 1.3 version or 2.0 should run with it, but I am quite sure that it will need some time until PHP 7 get's stable enough for production use and we and all 3rd party libraries have found all incompatibilities.

diade

diade

2016-01-12 11:01

reporter   ~0052301

Hello,
with PHP7
file : /core/using_pref_api.php

replace
function UserPreferences( $p_user_id, $p_project_id )
by
function __construct( $p_user_id, $p_project_id )

because the same name class with the constructor is not supported by php7

atrol

atrol

2016-01-12 11:18

developer   ~0052302

Concerning 0020484:0052301, this is fixed, see 0020501

diade

diade

2016-01-12 11:42

reporter   ~0052303

Thanks

johnd

johnd

2016-01-20 04:03

reporter   ~0052334

FYI:
I came across this when I started using PHP 7.

A colleague of mine fixed it in the following fashion, here is his text to the issue:

That is a bug in MantisBT. A function is being called that is in a file that has not been loaded.

I do not know what the correct fix is (the one recommended in the MantisBT bug tracker does not work).

However, the following will work around the problem.

In the file [.core]lang_api.php around line 98 you will find the following function which starts as follows:

function lang_get_default() {
global $g_active_language;

    $t_lang = false;

Change it by adding two lines so it reads as follows:

function lang_get_default() {
global $g_active_language;

    $t_pref_file = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'user_pref_api.php';
    require_once($t_pref_file);

    $t_lang = false;

This will simply include the file that has the missing function.

As to why it works in one version of PHP but not another, I do not have an answer. Unless, somehow, the lang_get_default function is called differently depending on something about the PHP version.