Php webview not loading


for some reason when i try to load a php code the webview will just not load, it just gets stuck on
[Tue Dec 13 19:52:45 2022] PHP 7.4.21 Development Server (http://0.0.0.0:8000) started
no matter what i try. please any help?

Hey @enriquesmith2, welcome to the forums!

You’re on php on web server you should use, you need to use the PHP CLI that’s what works with that code!

You’re writing PHP in a HTML file… Your file should have the extension php, not html. And, like @hugoondev said, if you want to write PHP code that prints to the console, you should be using a CLI PHP Repl, not a PHP Web server Repl.

thanks so much, its working just fine now

ohh, i read on a forum to try changing the file to html and see if that worked, i obviously forgot to change it back to php. and yes as @hugoondev said i tried changing to php cli and it works just fine now. Thanks alot!

but one quiestion i do have is: im following a coding course and the teacher on the prerecorded video used regular PHP and it would load just fine on Webview for him. how come it’s not wroking for me?

Because the code your trying to use is for the PHP CLI your teacher what using the PHP web server with PHP code that can be used for the web!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.