php-ext-brotli icon indicating copy to clipboard operation
php-ext-brotli copied to clipboard

PHP Startup: brotli: Unable to initialize module

Open peixotorms opened this issue 5 years ago • 2 comments

Hi there,

I installed php-ext-brotli on PHP 7.2 and I got this error when I run php -v on ubuntu 18.04

PHP Warning:  PHP Startup: brotli: Unable to initialize module
Module compiled with module API=20180731
PHP    compiled with module API=20170718
These options need to match
 in Unknown on line 0
PHP 7.2.16-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Mar  7 2019 20:23:29) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.16-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

peixotorms avatar Mar 19 '19 14:03 peixotorms

The module (brotli.so) I built is different from the PHP version.

  • PHP 7.2: PHP API => 20170718
  • PHP 7.3: PHP API => 20180731

Install the module you built with PHP 7.2.

kjdev avatar Mar 19 '19 22:03 kjdev

Well, that's the issue... I only have PHP 7.2 installed, not 7.3. Why does it then, compile with PHP 7.3?

I upgraded PHP to 7.3 and it now works fine. No luck with PHP 7.2 only, although steup was working a few months ago on a similar setup.

peixotorms avatar Mar 20 '19 04:03 peixotorms