Closed JohnAntoine closed 4 months ago
Interesting most likely that has something to do with my php-assembly wizardry. I but I am pretty sure I know where the issue is.
Feel free to let me know if I can help in any way I can. Your plugin is the most streamlined solution I found while looking for a way to run a modern PHP stack. Thank you for your work.
Awesome that you like the solution - obviously I hope to improve it so far, that it becomes some sort of a modern PHP go-to solution.
Regarding the error: Can you maybe show me an example, how you are using the header()
?
I understand why the error might be happening, but for some reason I am not able to reproduce it.
When trying to do a 301 or 302 redirect using
I get
Warning: Cannot modify header information - headers already sent by (output started at /node_modules/vite-plugin-php/dist/router.php(27) : eval()'d code:1) in /node_modules/vite-plugin-php/dist/router.php(27) : eval()'d code on line 2
An
index.php
with nothing but aheader('Location: http://localhost:3000/some-place');
in it produces that error.Here's my
vite.config.js
in case something is wrong with it. I even commented out theserver.proxy
section in case it interfered with something.Doing
npm run build
and running a PHP server in thedist
directory works and redirects as expected.Edit
It seems like any operation related to the
header
fail the same way, even in the starter repo. Trying tosession_start()
insystem/main.php
of the starter repo produces the same error.