Page 1 of 1

I am getting this error for phpinfo();

PostPosted: 03. February 2022 03:59
by Brontobytes
for some reason when I try to run this PHP
<?php
echo "hello World Updated 2"
phpinfo();
?>

Parse error: syntax error, unexpected double-quoted string "phpinfo();", expecting "," or ";" in C:\websites\js\index.php on line 3
it is giving me this error.

also when I try to run brackets live preview it does not work. I did get xampp to recognize my websites\js folder however.
https://drive.google.com/file/d/1zlmudl9SgM6yTiu1vvUo2IMcBw3eaHQl/view?usp=sharing
I do not have something setup right. I did find a video that told me how to change the environment path variable I can refresh the browser and make the code run at least the hello world updated 2 will show up but when I add the phpinfo(); it does not like that for some reason.

Re: I am getting this error for phpinfo();

PostPosted: 03. February 2022 08:21
by Altrea
Brontobytes wrote:for some reason when I try to run this PHP
<?php
echo "hello World Updated 2"
phpinfo();
?>

Parse error: syntax error, unexpected double-quoted string "phpinfo();", expecting "," or ";" in C:\websites\js\index.php on line 3


There is a semicolon missing to end the echo statement like so:
<?php
echo "hello World Updated 2";
phpinfo();
?>


Parse error: syntax error, unexpected double-quoted string "phpinfo();", expecting "," or ";" in C:\websites\js\index.php on line 3
it is giving me this error.

Brontobytes wrote:also when I try to run brackets live preview it does not work. I did get xampp to recognize my websites\js folder however.
https://drive.google.com/file/d/1zlmudl ... sp=sharing
I do not have something setup right.

You need to tell brackets which url it needs to use to request your website, e.g. http://localhost/

Re: I am getting this error for phpinfo();

PostPosted: 03. February 2022 17:50
by Brontobytes
So I got that figured out Thank you for your help, I had to load the folder and tell it where the localhost was it now works.