Version 60 for Ubuntu 22.04 is released

Well, I managed to get z-push to work, but I had to hack my way around.

The bottom line is, z-push 2.6.2 requires php 7.4, there’s no way around it, (see this comment for an effort to migrate to 8.x on another project).

So, what I did was to install the required 7.4 packages on the box, and manually change some configurations.

I installed these packages:

php7.4-cli
php7.4-common
php7.4-curl
php7.4-fpm
php7.4-imap
php7.4-json
php7.4-mbstring
php7.4-opcache
php7.4-readline
php7.4-soap
php7.4-xml

After that, I manually added a 7.4 upstream to nginx’s local.conf (yes, I’m aware this is not ideal):

upstream php7.4-fpm {
        server unix:/var/run/php/php7.4-fpm.sock;
}

And modified any reference to php-fpm for any z-push location (example):

        # Z-Push (Microsoft Exchange ActiveSync)
        location /Microsoft-Server-ActiveSync {
                include /etc/nginx/fastcgi_params;
                fastcgi_param SCRIPT_FILENAME /usr/local/lib/z-push/index.php;
                fastcgi_param PHP_VALUE "include_path=.:/usr/share/php:/usr/share/pear:/usr/share/awl/inc";
                fastcgi_read_timeout 630;
                fastcgi_pass php7.4-fpm;

                # Outgoing mail also goes through this endpoint, so increase the maximum
                # file upload limit to match the corresponding Postfix limit.
                client_max_body_size 128M;
        }
        location ~* ^/autodiscover/autodiscover.xml$ {
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME /usr/local/lib/z-push/autodiscover/autodiscover.php;
                fastcgi_param PHP_VALUE "include_path=.:/usr/share/php:/usr/share/pear:/usr/share/awl/inc";
                fastcgi_pass php7.4-fpm;
        }

Lastly, I manually modified z-push-admin.php and z-push-top.php to use php7.4 by changing the first line to:

#!/usr/bin/env php7.4

This was only needed to be able to run the tools directly, otherwise you can still run them using php7.4:

$ php7.4 /usr/local/lib/z-push/z-push-admin.php -a lastsync

EDIT: Take this changes with a grain of salt. So far, everything seems to be working, but I’m not sure if I broke anything else on my box, or what are the consequences of running multiple PHP versions in the long run :slight_smile: