Skip to content

PHP 8.5: register_argc_argv is Off in CLI #20279

Open

Description

@ondrejmirtes

Description

In this deprecations RFC https://wiki.php.net/rfc/deprecations_php_8_5 under "Deprecate the register_argc_argv INI directive" is the following:

We propose to deprecate this INI setting and make in default to Off in PHP 8.5, then to hardcode it to Off for all non-CLI-related SAPIs on PHP 9 (while keeping it hardcoded to On for CLI-related ones).

When I try php -r "echo ini_get('register_argc_argv');" on PHP 8.5.0-dev (cli) (built: Oct 18 2025 21:59:48) (NTS) it outputs 0. But I'm on the command line and I'd expect this to be set to 1.

PHP Version

PHP 8.5.0-dev (cli) (built: Oct 18 2025 21:59:48) (NTS)
Copyright (c) The PHP Group
Built by Shivam Mathur
Zend Engine v4.5.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.0-dev, Copyright (c), by Zend Technologies

Operating System

macOS 15.7 (and also on ubuntu-latest in GitHub Actions with setup-php)

Activity

  1. self-assigned this
    on Oct 24, 2025
  2. TimWolla commented on Oct 24, 2025

    @TimWolla
    Member

    Please see discussion in #20280. To understand this motivation of this issue: Did you raise it, because the implementation is giving you troubles in some way or did you raise it just to double-check that we didn't accidentally make a mistake?

  3. ondrejmirtes commented on Oct 25, 2025

    @ondrejmirtes
    ContributorAuthor

    I raised it because the behaviour doesn't match the content of the RFC people voted hore, and presumably what should also happen in PHP 9. register_argc_argv should still be 1 in CLI be default.

    I noticed the change only because I upgraded to PHP 8.5 in issue-bot (a bot that notices changes in reported errors in code snippets shared by users) and some additional issues appeared related to this: phpstan/phpstan#12625 (comment) (the change itself doesn't matter to me and doesn't break anything so I'd be fine with it).

  4. tamastoth-byborg commented on Nov 18, 2025

    @tamastoth-byborg

    I have read the linked discussion, so this means that Codeception must change it's code to be compatible with PHP 8.5?

    PHP Fatal error: Uncaught Codeception\Exception\ConfigurationException: register_argc_argv must be set to On for running Codeception in /app/vendor/codeception/codeception/src/Codeception/Application.php:98

    I'm using PHP 8.5.0RC5 (cli) (built: Nov 14 2025 17:24:29) (NTS) from https://launchpad.net/~ondrej/+archive/ubuntu/php in the ubuntu:22.04 docker image, with latest Codeception 5.3.2.

    Meanwhile I guess I will have to provide a hardcoded config myself in the image, so that we are not breaking all our builds all at once with this single setting.

  5. ondrejmirtes commented on Nov 18, 2025

    @ondrejmirtes
    ContributorAuthor

    I think this should be fixed in php-src to match what was voted on in the RFC.

  6. ThomasLandauer commented on Dec 19, 2025

    @ThomasLandauer

    @tamastoth-byborg No, just change your php.ini setting for now; I've added an answer to Stack Overflow: https://stackoverflow.com/q/79850953/1668200

  7. tamastoth-byborg commented on Dec 19, 2025

    @tamastoth-byborg

    Thanks, however in our development image we have the cli+fpm together and symlink their config to a single source of truth (/etc/php/$version/cli is symlinked to /etc/php/$version/fpm, then /etc/php/$version/fpm/conf.d is symlinked to /etc/php/conf.d). This allows developers to mount custom configuration files to a single path (/etc/php/conf.d) and have it work for both SAPI-s, as we are running Codeception from this container and also serve our PHP HTTP application from it for the tests (via fpm and nginx).

    I admit we could have two separate images, two separate services, but that increases maintenance needs and so far it worked for us, and it should be working still if this bug wouldn't exist.

    We did set the configuration On in php.ini, but that means it would be On for fpm too so we had to add php_admin_value[register_argc_argv] = off to the fpm pool config to switch it off again there. It works.

    I hope we can remove these workarounds when this gets fixed according to the RFC (cli On, fpm Off by default).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions