taybenlor / runno

Browser-based runtime for programming languages and WASI binaries.
https://runno.dev
MIT License
634 stars 27 forks source link

Cannot perform autoload for composer installed vendor libraries. (PHP runtime) #292

Open rainx opened 8 months ago

rainx commented 8 months ago

Background

I am running a PHP demo with PHP runtime with composer dependencies. I found it cannot handle autoload correctly.

How to reproduce.

I can recreate this issue by the following steps. (using this demo: https://getcomposer.org/doc/01-basic-usage.md#autoloading)

$log = new Monolog\Logger('name'); $log->pushHandler(new Monolog\Handler\StreamHandler('app.log', Monolog\Logger::WARNING)); $log->warning('Foo');

I got the following error message:

X-Powered-By: PHP/8.2.0 Content-type: text/html; charset=UTF-8


Fatal error: Uncaught Error: Class "Monolog\Logger" not found in /program:4 Stack trace:

0 {main}

thrown in /program on line 4



I tried to use the PHP `scandir` function to check the directory under '/vendor', and it did have the necessary files under it. 

Hope someone can look into it.  thanks a lot, that's really a cool project. 
taybenlor commented 8 months ago

Hey!

Thanks for filing this. Just wanted to confirm with you that I've seen this and plan to allocate some time to investigating it.

As some background, I'm using the VMWare Labs WASI runtime (https://github.com/vmware-labs/webassembly-language-runtimes). So I'm limited by what it supports.

rainx commented 8 months ago

@taybenlor Great, thanks for your reply, and if you need more information to help investigate, just let me know.