-
Notifications
You must be signed in to change notification settings - Fork 271
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
PHP Class finfo
not found
#1127
Comments
Oh interesting! Are we missing a php.ini setting? Or perhaps the --disable-all flag during the compilation removes this extension from the build? |
@adamziel Do you know a way for me to help find how to solve this ? |
@mho22 yes! One way would be to compare the |
@adamziel I suppose two screenshots with PHP8.2 binary So, here is a little screenshot of the only thing different when I search for Next is the data from PHP8.2 binary:
PHP-WASM8.2 :
Now is time to investigate. |
This could be relevant: I'm not sure if |
It seems like This does not confirm that it disables That said, I can't find anything about "re-enable" disabled default extensions, like :
|
Perhaps it's time to remove |
@adamziel Alright, I'm working on it. |
@adamziel I tried removing I ran a
I suppose this could be the solution. I am currently busy recompiling every PHP versions before launching the tests. By the way, I was wondering : could there be a way to make |
Lovely! 🤞it will just work for all the PHP versions :) About curl, you’d need to add https://github.com/WordPress/wordpress-playground/tree/trunk/packages/php-wasm/compile From there, you could add —with-curl to ./configure in the same way as other extensions are provided. |
@adamziel It seems when i
And this has been said about that :
https://bugs.php.net/bug.php?id=80585 I added this :
Not working at the moment. Anyways, I am on it. Concerning |
@mho22 aha, WITH_ICONV is only set to
|
There are also two |
@mho22 I would be stoked to have this in If you can get it to build, this PR should give curl access to the network. |
@adamziel It seems
I added
So I added I also tried by removing Running every recompile and then testing. Let's find out if everything works fine. I keep you posted. P.S.: I am glad to hear that |
@adamziel Only one test failed at this point :
The expected value is too specific to be a "real" error. I suppose the But I will wait for your insight about this. Anyways, this sounds promising I suppose. Let's make the Pull Request now. |
@adamziel I am trying to list the PHP extensions from
I am probably missing something obvious. But I need some enlightenments. I tried this :
|
|
Yeah, that was indeed obvious. Apologies for the silly question. I should probably ask you what the quickest way is to list the PHP extensions of php-wasm/web/light using the '@php-wasm/web' package instead. In other words, how can I list the php extensions present in the light version when I recompile it and rebuild it ? |
Aha! I'd go to http://localhost:5400/website-server/, load the PHP version you've rebuilt, and run this in the dev tools: document.body.innerHTML = (await playground.run({ code: `<?php phpinfo(); ?>` })).text |
…1132) Based on #1127. This PR enables FileInfo and Posix extensions in PHP previously disabled by `--disable-all`. ## What problem is it solving? It allows the use of `new finfo()`. Previously, the following error occurred : ``` 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 ``` ## Testing Instructions 1. `mkdir php-wasm-issue && cd php-wasm-issue` 2. `npm install @php-wasm/cli` 3. `touch test.php` : ```php <?php $finfo = new finfo( FILEINFO_MIME ); echo json_encode( $finfo ); ``` 4. `node node_modules/.bin/cli test.php`
Fixes #1127 ## What is this PR doing? It enables `fileinfo` support in kitchen-sink and Node and adds tests for it. ## What problem is it solving? Allows users to use `fileinfo`. ## How is the problem addressed? By fixing a bug in the build script that prevented `fileinfo` from being enabled. ## Testing Instructions - ensure tests pass
I encountered an issue while experimenting with
PHP CLI
.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
test.php
node node_modules/.bin/cli test.php
The text was updated successfully, but these errors were encountered: