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

README of '@php-wasm/node' is outdated #2115

Open
ivanjeremic opened this issue Jan 8, 2025 · 0 comments
Open

README of '@php-wasm/node' is outdated #2115

ivanjeremic opened this issue Jan 8, 2025 · 0 comments

Comments

@ivanjeremic
Copy link

I have the newest version on @php-wasm/node installed 1.0.20 and there it says

Module '"@php-wasm/node"' has no exported member 'PHP'.

but the readme clearly says that this is the basic example:

import { PHP } from '@php-wasm/node';
const php = PHP.load('8.0', {
	requestHandler: {
		documentRoot: new URL('./', import.meta.url).pathname,
	},
});

// Create and run a script directly
php.writeFile('./index.php', `<?php echo "Hello " . $_POST['name']; ?>`);
await php.run({ scriptPath: './index.php' });

// Or use the familiar HTTP concepts:
const response = await php.request({
	method: 'POST',
	url: '/index.php',
	data: { name: 'John' },
});
console.log(response.text);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Inbox
Development

No branches or pull requests

1 participant