Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Unit building PHP modules. Version confusion. #1007

@skillslasher

Description

@skillslasher

When trying to build modules for PHP of different versions, at the moment of configuring the build, the latest PHP package is picked up, not the one specified in the configuration parameters.

For example.
The system has php7.4, php8.1, php8.2 installed.
./configure php --module=php7.4 --config=php-config --lib-path=/usr/lib/php/7.4/sapi

configuring PHP module
checking for PHP ... found

  • PHP SAPI: [apache2handler embed cgi cli fpm]
    checking for PHP version ... 8.2.12
    checking for PHP embed SAPI ... found
    checking for PHP Zend Thread Safety ... not found
    checking for PHP zend_signal_startup() ... found
  • PHP module: php7.4.unit.so

With these ./configure settings, it will still pick up the most recent package on the system, which is php8.2
Naturally, such a module does not work properly afterwards.
Forcing the default PHP interpreter to be changed to php7.4 did nothing.

Can you please tell me how to fix the problem?
System: Ubuntu 22.04.3.
Unit version 1.31.1
PHP 7.4.33
PHP 8.1.25
PHP 8.2.12

Metadata

Metadata

Assignees

No one assigned

    Labels

    z-phpLanguage-Module for PHP (SAPI)z-question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions