Skip to content

php: update to @8.4.20, @8.5.5 ; autoconf @2.73 C23 fix#32175

Open
BjarneDMat wants to merge 2 commits intomacports:masterfrom
BjarneDMat:php85
Open

php: update to @8.4.20, @8.5.5 ; autoconf @2.73 C23 fix#32175
BjarneDMat wants to merge 2 commits intomacports:masterfrom
BjarneDMat:php85

Conversation

@BjarneDMat
Copy link
Copy Markdown
Contributor

@BjarneDMat BjarneDMat commented Apr 11, 2026

Description

autoconf @2.73 messes php{80,81,82} up 👎🏻

The reason is, that /etc/bcmath still uses K&R function declarations in libbcmath for php <= 8.2
An official, minimal fix for php82 will be released w/ @8.2.31 in May 2026

The patches, I've done, actually addresses more issues, in that they also fixes int scale <-> size_t scale issues. Thus, my patches for php{74..81} are actually more up-to-date than the official php8[23].

Due to the patches, the configure.cflags work-around is no longer necessary, as it's been replaced by the correct patches.

The below is now outdated
Thus, I've -temporarily- knownfailed php{81,82}
I'm working on a fix, but presently it eludes me 🤔🤓🤯

I've tried inserting :

This should have been a fix for C23 instead of C++23 - My Bad
        # fix for autoconf 2.73 c++23 default
        if {[vercmp ${branch} <= 8.2]} {
            configure.cxxflags-append       -std=gnu++20
        }

I've tried -std=gnu++{11,14,17,20} , but compiling still fails w/ the exact same error in ext/bcmath
I'm seriously considering trying to backport bcmath from php83 and see, what happens 🙏🏻
bcmath for php{80,81,82} is based upon the bcmath from php74.
It looks as if the bcmath code got seriously revised in php83.

I'm submitting this presently, because I find it important to upgrade php{84,85}

The workaround for php{81,82} is to install autoconf @2.72 and switch to that, when installing php{81,82}

@macportsbot
Copy link
Copy Markdown

Notifying maintainers:
@ryandesign for port php.

Copy link
Copy Markdown
Contributor

@ryandesign ryandesign left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried inserting :

        # fix for autoconf 2.73 c++23 default
        if {[vercmp ${branch} <= 8.2]} {
            configure.cxxflags-append       -std=gnu++20
        }

I've tried -std=gnu++{11,14,17,20} , but compiling still fails w/ the exact same error in ext/bcmath

I would be surprised if PHP version 8.2 and older required a C++ version as new as 2020. Previously, PHP had kept very low language requirements for maximum compatibility. I think they only started requiring C++11 a few years ago.

What is the error message you get? Is there a bug report I should be looking at for more info?

Whichever C++ version you end up specifying, make sure there is a corresponding configure.cxx_standard statement.

Comment thread lang/php/Portfile Outdated
Comment thread lang/php/Portfile Outdated
@ryandesign
Copy link
Copy Markdown
Contributor

autoconf @2.73 messes php{80,81,82} up 👎🏻
Thus, I've -temporarily- knownfailed php{81,82}

But this is only because autoconf 2.73 selects C23 on compilers that support it, right? So it doesn't fail on older OS versions with older compilers that don't support C23.

@ryandesign
Copy link
Copy Markdown
Contributor

# fix for autoconf 2.73 c++23 default

Are you sure? The autoconf 2.73 release announcement only says they default to C23 if available. It doesn't say anything about C++23.

This is what I see in the build log:

2026-04-11T09:38:25.8644280Z checking for /usr/bin/clang option to enable C23 features... -std=gnu23

It does not say anything about having checked for or selected C++23.

Therefore, if you're having trouble building something in C23 mode and want an older C mode, you'd use e.g.:

configure.cflags-append -std=gnu99
compiler.c_standard 1999

@BjarneDMat
Copy link
Copy Markdown
Contributor Author

My bad 👎🏻
I misunderstood it and thought it was C++23 and not C23 - I need 👓 🤔

@BjarneDMat BjarneDMat mentioned this pull request Apr 11, 2026
3 tasks
@BjarneDMat BjarneDMat changed the title php: update to @8.4.20, @8.5.5 ; disable php{81,82} php: update to @8.4.20, @8.5.5 ; autoconf @2.73 C23 fix Apr 11, 2026
@ryandesign
Copy link
Copy Markdown
Contributor

Ok, what about the legacy support changes?

@BjarneDMat
Copy link
Copy Markdown
Contributor Author

BjarneDMat commented Apr 11, 2026

This seems to be the problem(s) :

2026-04-11T12:31:34.1921140Z ##[error]Failed to install dependencies for php81-oracle
2026-04-11T12:42:44.3283380Z ##[error]Failed to install dependencies for php82-oracle
2026-04-11T12:54:07.8221260Z ##[error]Failed to install dependencies for php83-oracle

Do I do something about it - do we just ignore it ?

The basic problem is, that Oracle has moved all downloads behind a login-wall. Thus oracle-instantclient can no longer be installed by the buildbots 🤯👎🏻

I've marked php-oracle as known_fail yes to get around this problem 🤓🤔

@BjarneDMat
Copy link
Copy Markdown
Contributor Author

Ok, what about the legacy support changes?

That's answered in #31982

@BjarneDMat
Copy link
Copy Markdown
Contributor Author

BjarneDMat commented Apr 12, 2026

Ok, what about the legacy support changes?

  • I installed opcache for php{74..84}
  • checked that the files were installed w/ port contents php<version>-opcache
  • set opcache.enable_cli=1
  • ran this script for php{74..85} :
<?php

function isOpcacheEnabled(): bool
{
//  print_r( opcache_get_configuration() ) ;
    if (!function_exists('opcache_get_status')) {
        return false;
    }
    return !empty(opcache_get_status()['opcache_enabled']);
}

echo isOpcacheEnabled() ? 'Enabled' : 'Disabled';
echo PHP_EOL ;
declare etcDir='/opt/local/etc'

cd "${etcDir}"
while read -u 9 phpINI
do
    echo "${phpINI}"
    sed -i '' -E \
        -e '/opcache.enable_cli/s/0/1/' \
        -e '/opcache.enable_cli/s/;//'  \
        "${phpINI}"
    awk '/opcache.enable/' "${phpINI}"
echo ; done 9< <( find php?? -type f -name 'php.ini' )
cd "${OLDPWD}"

while read -u 9 phpVer
do
    echo -n "${phpVer} OPcache : "
    eval ${phpVer} -f ./bin/php/OPcacheTest.php
done 9< <( port -q installed php?? | awk '{print $1}' )

Testet on :

Model Identifier: MacPro5,1                 Model Identifier: Macmini6,1
macOS 15.7.4 24G517 x86_64                  macOS 10.15.8 19H2036 x86_64
Xcode 26.3 17C529                           Xcode 12.4 12D4e
Command Line Tools 26.2.0.0.1.1764812424    Command Line Tools 12.4.0.0.1.1610135815

@BjarneDMat BjarneDMat marked this pull request as ready for review April 20, 2026 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants