Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console test fails if posix module is not enabled. #54892

Closed
k-sahara opened this issue May 12, 2024 · 1 comment
Closed

Console test fails if posix module is not enabled. #54892

k-sahara opened this issue May 12, 2024 · 1 comment

Comments

@k-sahara
Copy link
Contributor

Symfony version(s) affected

7.0.7

Description

I am installing php on AlmaLinux with remi. (except for php-posix)
Execute the following commands

php ./phpunit  src/Symfony/Component/Console/Tests/ApplicationTest.php

before

How to reproduce

OS

[vagrant@localhost symfony]$ cat /etc/os-release
NAME="AlmaLinux"
VERSION="9.4 (Seafoam Ocelot)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.4"
PLATFORM_ID="platform:el9"
PRETTY_NAME="AlmaLinux 9.4 (Seafoam Ocelot)"
ANSI_COLOR="0;34"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:almalinux:almalinux:9::baseos"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-9"
ALMALINUX_MANTISBT_PROJECT_VERSION="9.4"
REDHAT_SUPPORT_PRODUCT="AlmaLinux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.4"
SUPPORT_END=2032-06-01

Follow the steps below to install remi php.

sudo dnf upgrade -y --refresh 
sudo dnf install -y yum-utils
sudo dnf config-manager --set-enabled crb
sudo dnf install -y epel-release
sudo dnf install -y epel-next-release

sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm
dnf -y install php-cli php-fpm php-devel php-pear php-curl php-gd php-opcache \
 php-zip php-common php-bcmath php-imagick php-xmlrpc php-json php-readline php-memcached \
 php-redis php-mbstring php-apcu php-xml php-dom php-redis php-memcached php-memcache php-process
sudo dnf -y install php-pecl-igbinary php-intl php-pecl-msgpack \
 php-pgsql php-pecl-yaml php-pecl-zip php-pecl-redis5 php-phpiredis
systemctl restart php-fpm

These steps do not include php-posix.

phpinfo is as follows

phpinfo()
PHP Version => 8.2.18

System => Linux localhost.localdomain 5.14.0-427.13.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 30 18:22:29 EDT 2024 x86_64
Build Date => Apr  9 2024 18:46:23
Build System => Red Hat Enterprise Linux release 9.3 (Plow)
Build Provider => Remi's RPM repository <https://rpms.remirepo.net/> #StandWithUkraine
Compiler => gcc (GCC) 11.4.1 20230605 (Red Hat 11.4.1-2)
Architecture => x86_64
Server API => Command Line Interface
Virtual Directory Support => disabled

Possible Solution

Adding a check for function_exists solves this problem.

        if (!function_exists('posix_kill')) {
            $this->markTestSkipped('posix_kill not available');
        }

Additional Context

No response

@nicolas-grekas
Copy link
Member

This extension is supposed to be enabled by default. We cannot support too minimalistic compilation options. You might want to enable the extension, or to use another source of packages.
Still, thanks for submitting both an issue and a PR!

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

Successfully merging a pull request may close this issue.

4 participants