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

how to run the wasm? #25

Open
iscas-zac opened this issue Apr 3, 2023 · 1 comment
Open

how to run the wasm? #25

iscas-zac opened this issue Apr 3, 2023 · 1 comment

Comments

@iscas-zac
Copy link

Hello, here is a new frontend learner. I assume that php-wasm is used in browsers, and am then confused by the fact that its distribution is via npm. I think npm is used with node.js to run server applications.

Moreover, I can't figure out how to run it locally. Should I simply put the php-web.* under my folder, write some <script> tags and open the browser, or do I need a server somewhat, use package.json and such things? How do I make sure "the library is included in the page" in README?

I'm at a very naive stage of javascript. Please don't be shocked by my ignorance:)

@cargilcm
Copy link

cargilcm commented Aug 12, 2024

👍+1 for "I can't figure out how to run it locally (sic)" ie offline

The instructions are great for running php-tags.jsdelivr.mjs script through an external call out to cdn but despite my efforts to download the scripts locally and modify them all to point to the local location, phpwasm php scripts don't run on index.html afterward.

I hope that I've clarified for iscas-zac by hinting at how to run phowasm locally. Ie @iscas-zac you need a way to open the index.html in your browser on your OS. My OS is Android so I can for instance use termux to install node then run npx http-server . once I'm in directory with the file and use the url output by npx to load in my browser.

Hang in there you'll figure this kind of thing out

Update: I thought maybe I need to add Access-Control-Allow-Origin: * in my https server to use the mjs files locally but that has not prevailed to grant the sought functionality
Source

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