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

Undefined constant "GLOB_BRACE" with standalone server #484

Closed
hockdudu opened this issue Jan 19, 2024 · 4 comments
Closed

Undefined constant "GLOB_BRACE" with standalone server #484

hockdudu opened this issue Jan 19, 2024 · 4 comments

Comments

@hockdudu
Copy link
Contributor

When using the standalone binary server (https://github.com/dunglas/frankenphp/releases/tag/v1.0.3), I get the following error when using the GLOB_BRACE constsant:

Fatal error: Uncaught Error: Undefined constant "GLOB_BRACE" in /tmp/test-frankenphp/index.php:3 Stack trace: #0 {main} thrown in /tmp/test-frankenphp/index.php on line 3

My example script:

<?php

$files = glob('{a,b,c}.txt', GLOB_BRACE);
var_dump($files);

Command:

frankenphp php-server --listen 127.0.0.1:8080

This error does not occur when using the Docker image dunglas/frankenphp:latest.

@hockdudu
Copy link
Contributor Author

hockdudu commented Jan 19, 2024

The PHP documentation states that GLOB_BRACE isn't available in some Linux systems like Alpine Linux.

I tried, and I'm able to reproduce this with the Docker image dunglas/frankenphp:latest-alpine.

Does that mean the server binary is based on Alpine Linux in some way?

@dunglas
Copy link
Owner

dunglas commented Jan 19, 2024

@hockdudu yes, the static binary is using the musl libc (as Alpine), which is known not to support GLOB_BRACE.

@dunglas dunglas closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2024
@hockdudu
Copy link
Contributor Author

Thanks for the swift answer 😄

I may have missed it, but is this documented somewhere?

@dunglas
Copy link
Owner

dunglas commented Jan 19, 2024

In the musl docs IIRC, but it could be nice to add it in the "known issues" section of FrankenPHP docs! Would you mind to open a PR?

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

No branches or pull requests

2 participants