I am getting this error for phpinfo();

Problems with the Windows version of XAMPP, questions, comments, and anything related.

I am getting this error for phpinfo();

Postby Brontobytes » 03. February 2022 03:59

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.
its worth it to take a break and calm the mind else I am a fool.
Brontobytes
 
Posts: 5
Joined: 02. February 2022 05:26
Location: Cody Wyoming
XAMPP version: 33.3
Operating System: winpro10

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

Postby Altrea » 03. February 2022 08:21

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/
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11952
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

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

Postby Brontobytes » 03. February 2022 17:50

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.
its worth it to take a break and calm the mind else I am a fool.
Brontobytes
 
Posts: 5
Joined: 02. February 2022 05:26
Location: Cody Wyoming
XAMPP version: 33.3
Operating System: winpro10


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 126 guests