VTiger 5.4.0 with PHP 5.4.30

From JazzTeamWiki
Jump to: navigation, search

I migrated vTiger 5.4.0 from one hosting to another one. First hosting had PHP of 5.4.24 version, another new one 5.4.30. I just copied all the PHP files in order not to repeat installation process, and applied backup of MySQL DB to new hosting, and expected all should work, but that was wrong assumption. I got the following trying to load index page of vTiger on a new hosting:

Strict Standards: Declaration of dbTable::create() should be compatible with dbObject::create() in /home/jazzteam/public_html/crm/adodb/adodb-xmlschema.inc.php on line 605

Strict Standards: Declaration of dbIndex::create() should be compatible with dbObject::create() in /home/jazzteam/public_html/crm/adodb/adodb-xmlschema.inc.php on line 769

Strict Standards: Declaration of dbData::create() should be compatible with dbObject::create() in /home/jazzteam/public_html/crm/adodb/adodb-xmlschema.inc.php on line 956

Strict Standards: Declaration of dbQuerySet::create() should be compatible with dbObject::create() in /home/jazzteam/public_html/crm/adodb/adodb-xmlschema.inc.php on line 1207

Strict Standards: Only variables should be assigned by reference in /home/jazzteam/public_html/crm/include/database/PearDatabase.php on line 20

Strict Standards: Only variables should be assigned by reference in /home/jazzteam/public_html/crm/include/database/PearDatabase.php on line 21

Strict Standards: Only variables should be assigned by reference in /home/jazzteam/public_html/crm/include/database/PearDatabase.php on line 937

Strict Standards: Only variables should be assigned by reference in /home/jazzteam/public_html/crm/include/database/PearDatabase.php on line 225

Fatal error: Cannot re-assign auto-global variable _FILES in /home/jazzteam/public_html/crm/include/utils/CommonUtils.php on line 1395

That was really surprising, and after some googling I understood this is due to different version of PHP processor (5.4.24 and 5.4.30) and also due to different versions of settings related to PHP.

First of all I started fighting with that errors, e.g. it was easy for PearDatabase.php, just to remove & when assigning variables on appropriate lines. But I understood also that it could be more warnings and errors.

At old hosting I had php.ini at root folder (public_html), but at new hosting I had not such files, also cpanel did not propose smth. similar. After googling I got it could be possible to create .htaccess file in my vTiger installation folder.Such variant worked for me in order not to see Strict Standard and other annoying messages:

php_value error_reporting 22519

In order to understand how this number appeared please refer official documentation. In my case I have E_ALL (32767) - E_STRICT (2048) - E_DEPRECATED(8192) - E_NOTICE(8). http://php.net/manual/en/errorfunc.constants.php

After applying that line at .htaccess, I had only this error:

Fatal error: Cannot re-assign auto-global variable _FILES in /home/jazzteam/public_html/crm/include/utils/CommonUtils.php on line 1395

This error doesn’t have nothing common with register_globals PHP settings. At this file CommonUtils.php on that line 1395 I made the following change:

From

function SaveImage($_FILES, $module, $id, $mode) {

to

function SaveImage($FILES, $module, $id, $mode) {

and it fully fixes this problem. This problem is covered here http://stackoverflow.com/questions/14954446/fatal-error-cannot-re-assign-auto-global-variable

After making all that I saw normal vTiger login screen, but when was trying to login, got the following:

Fatal error: Call to undefined function session_unregister() in /home/jazzteam/public_html/crm/modules/Users/Authenticate.php on line 71

Surely we have a risk if we solve that, something new appear, etc. But fortunately it is not the case!

Just change that


session_unregister('login_password');

session_unregister('login_error');

session_unregister('login_user_name');


to that


unset($_SESSION['login_password']);

unset($_SESSION['login_error']);

unset($_SESSION['login_user_name']);


And your vTiger starts working!


Please also refer to following links which could be useful:

Working with .htaccess file

http://perishablepress.com/advanced-php-error-handling-via-htaccess/

https://kb.mediatemple.net/questions/1658/Using+.htaccess+files#gs