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

[Howto]: Use PHP and Vite simultaneously in the same project #1007

Open
8 tasks
musicraccoon opened this issue Oct 21, 2023 · 2 comments
Open
8 tasks

[Howto]: Use PHP and Vite simultaneously in the same project #1007

musicraccoon opened this issue Oct 21, 2023 · 2 comments

Comments

@musicraccoon
Copy link

Have you already checked elsewhere?

What are you struggling with?

I want to use both PHP and Vite in the same project.
When switching to the browser, it should open index.php , inside which is connected localhost:5173/@vite/client .

If you run Node JS inside shell.sh , nothing works, and if run outside the container, everything works.

I tried to set up reverse proxying, then Vite opens in the browser, but it doesn't work index.php

(Windows 11 + WSL2)

What have you tried already?

What is your goal?

@guycalledseven
Copy link

guycalledseven commented Nov 8, 2023

@musicraccoon what seems to be the errors you are getting? I am doing this all the time.
in php container accessed via shell.sh you can even use nvm to instal different version of node. Before you have to make folder writeable or you'll get errors:

sudo chmod -R 777 /opt/nvm/
nvm install node
Downloading and installing node v21.1.0...
Downloading https://nodejs.org/dist/v21.1.0/node-v21.1.0-linux-arm64.tar.xz...
################################################################################################################################ 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v21.1.0 (npm v10.2.0)

nvm use node
Now using node v21.1.0 (npm v10.2.0)

node -v
v21.1.0

then inside project dir:

cd project
npm i
node index.js

@agathasweb
Copy link

I have the same problem as I reported in the post:

#1028

If I use the reverse proxy as instructed in the Devilbox documentation, everything that depends on node works perfectly. But PHP stops working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants