Skip to content

PHP Class finfo not found #1127

Closed
Closed
@mho22

Description

@mho22

I encountered an issue while experimenting with PHP CLI.

node node_modules/.bin/cli test.php

> Fatal error: Uncaught Error: Class "finfo" not found in /mho22/works/php-wasm-issue/test.php:3
> Stack trace:
> #0 {main}
>   thrown in /mho22/works/php-wasm-issue/test.php on line 3

It seems like PHP's built-in extensions like fileinfo are not found. Is this correct ?

Here's step by step to reproduce the problem

mkdir php-wasm-issue

cd php-wasm-issue

npm install @php-wasm/cli

test.php

<?php

$finfo = new finfo( FILEINFO_MIME );

echo json_encode( $finfo );

node node_modules/.bin/cli test.php

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions