8.7.80 - missing php-files in php MAPI deb package [Ubuntu 16.04]



  • Hi all,

    I noticed, that the z-push gab sync script wasn’t working any longer. This is caused by missing php files in /usr/share/kopano/php/mapi/, which were delivered with the php7-mapi package in the past. Last working version which includes the files is php7-mapi_8.7.80.27-0+22.1_amd64.deb on my system, at least since version core-8.7.80.138_0+39-Ubuntu_16.04-amd64, these php-files are missing in the package.

    Is that a failure or do I need to install another package to fix the issue?

    Best Jan


  • Kopano

    Hi @deHoeninger ,

    yes, these files have been removed from the php-mapi package, since both z-push and webapp are maintaining own copies anyways and there are no php components anymore within “Kopano Core” that would require them.

    I have checked this on a test system again, and here z-push-gabsync continues to work, though.



  • Hi @fbartels,

    you are right, z-push has those files included in the kopano-backend path under /usr/share/z-push/backend/kopano/mapi/. So no need to ship them with the mapi package.

    Nevertheless, I’m getting the following error, once I’m calling the gab-sync.php script.

    PHP Warning:  include_once(mapi/mapi.util.php): failed to open stream: No such file or directory in /usr/share/z-push/tools/gab-sync/lib/kopano.php on line 28
    PHP Warning:  include_once(): Failed opening 'mapi/mapi.util.php' for inclusion (include_path=':/usr/share/kopano/php:/usr/share/z-push/tools/gab-sync/') in /usr/share/z-push/tools/gab-sync/lib/kopano.php on line 28
    PHP Warning:  include_once(mapi/mapidefs.php): failed to open stream: No such file or directory in /usr/share/z-push/tools/gab-sync/lib/kopano.php on line 29
    PHP Warning:  include_once(): Failed opening 'mapi/mapidefs.php' for inclusion (include_path=':/usr/share/kopano/php:/usr/share/z-push/tools/gab-sync/') in /usr/share/z-push/tools/gab-sync/lib/kopano.php on line 29
    PHP Warning:  include_once(mapi/mapitags.php): failed to open stream: No such file or directory in /usr/share/z-push/tools/gab-sync/lib/kopano.php on line 30
    PHP Warning:  include_once(): Failed opening 'mapi/mapitags.php' for inclusion (include_path=':/usr/share/kopano/php:/usr/share/z-push/tools/gab-sync/') in /usr/share/z-push/tools/gab-sync/lib/kopano.php on line 30
    PHP Warning:  include_once(mapi/mapicode.php): failed to open stream: No such file or directory in /usr/share/z-push/tools/gab-sync/lib/kopano.php on line 31
    PHP Warning:  include_once(): Failed opening 'mapi/mapicode.php' for inclusion (include_path=':/usr/share/kopano/php:/usr/share/z-push/tools/gab-sync/') in /usr/share/z-push/tools/gab-sync/lib/kopano.php on line 31
    PHP Warning:  include_once(mapi/mapiguid.php): failed to open stream: No such file or directory in /usr/share/z-push/tools/gab-sync/lib/kopano.php on line 32
    PHP Warning:  include_once(): Failed opening 'mapi/mapiguid.php' for inclusion (include_path=':/usr/share/kopano/php:/usr/share/z-push/tools/gab-sync/') in /usr/share/z-push/tools/gab-sync/lib/kopano.php on line 32
    PHP Notice:  Use of undefined constant PT_BINARY - assumed 'PT_BINARY' in /usr/share/z-push/tools/gab-sync/lib/kopano.php on line 35
    PHP Warning:  mapi_prop_tag() expects parameter 1 to be integer, string given in /usr/share/z-push/tools/gab-sync/lib/kopano.php on line 35
    PHP Notice:  Use of undefined constant PT_BOOLEAN - assumed 'PT_BOOLEAN' in /usr/share/z-push/tools/gab-sync/lib/kopano.php on line 38
    PHP Warning:  mapi_prop_tag() expects parameter 1 to be integer, string given in /usr/share/z-push/tools/gab-sync/lib/kopano.php on line 38
    Please verify the php-mapi configuration, as the php-mapi includes can not be found in the php include path. Aborting.
    

    This is caused by the following code in /usr/share/z-push/tools/gab-sync/lib/kopano.php:

    include_once('mapi/mapi.util.php');
    include_once('mapi/mapidefs.php');
    include_once('mapi/mapitags.php');
    include_once('mapi/mapicode.php');
    include_once('mapi/mapiguid.php');
    

    To make a long story short, cause the kopano backend folder /usr/share/z-push/backend/kopano/mapi is not part of the include_paths, the script couldn’t find those files.

    I’ve seen, that the gab2contacts.php script is dealing that issue with a

    define('PATH_TO_ZPUSH', '../../src/');
    

    in advance and calling the mapi files in lib/kopano.php with a

    include_once(PATH_TO_ZPUSH .'backend/kopano/mapi/mapi.util.php');
    include_once(PATH_TO_ZPUSH .'backend/kopano/mapi/mapidefs.php');
    include_once(PATH_TO_ZPUSH .'backend/kopano/mapi/mapitags.php');
    include_once(PATH_TO_ZPUSH .'backend/kopano/mapi/mapicode.php');
    include_once(PATH_TO_ZPUSH .'backend/kopano/mapi/mapiguid.php');
    include_once(PATH_TO_ZPUSH .'lib/utils/utils.php');
    

    Might be a more fault-tolerant apprach for the gab-sync script as well.

    What do you mean?

    Best Jan



  • Ok, played a bit around.

    In my case it’s sufficient to add the z-push root path to the include paths in the gab-sync.php

    Adding a

    define('PATH_TO_ZPUSH', '../../');
    

    and changing the line

    set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH_CLI);
    

    to

    set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH_CLI . PATH_SEPARATOR . BASE_PATH_CLI . PATH_TO_ZPUSH);
    

    was enough. No need to change the lib/kopano.php at all.

    Best Jan


  • Kopano

    Hi Jan,

    thanks for reporting this. I’ve created the JIRA issue to follow this up: https://jira.z-hub.io/browse/ZP-1463. If you like, you can contribute the fix following the guidelines: https://wiki.z-hub.io/display/ZP/Development+guidelines.

    Manfred



  • Hi Manfred,

    I will try to do so. I’ve sent you a mail.

    Best Jan


Log in to reply