0

I newly installed Wamp 3.0.6 today and created user and pass to phpmyadmin which has all privileges.

I tested the installation with a simple PHP script:

<?php echo "hello"; ?>

and all seemed well. However when introducing braces (} or {), I get a syntax error:

<?php 
    $a = 1; 
    if ($a > 1){ 
        echo "There's more than 1";
    }
?>

Parse error: syntax error, unexpected 'echo' (T_ECHO) in C:\wamp64\www\tickets\test.php on line 4.

This error is occurring anytime a brace is used. Since this is syntactically valid PHP (as confirmed by 3v4l.org), I suspect something may be wrong with my wamp-server installation.

Any idea what's wrong here?

I have just now uninstalled and installed Wamp again. And the same thing.

I can do a simple or

Any help would be much appreciated as this is getting on my nerves.

HPierce
  • 7,249
  • 7
  • 33
  • 49
scarlet
  • 15
  • 1
  • 5
  • [Works for me!](https://3v4l.org/uSE3a) Maybe it's something else? – HPierce Jan 29 '17 at 18:42
  • I appreciate you see this as a duplicate but no php script works that includes braces. Only a a standard echo or phpinfo. That's it. I'm trying to establish if its something that needs fixing on Wamp? – scarlet Jan 29 '17 at 18:45
  • Interesting. I've **aggressively** edited your question to reflect that. Please feel free to [edit] further if I've done something wrong. Voting to reopen this, since syntax isn't the issue here. – HPierce Jan 29 '17 at 18:57
  • @HPierce But the point is its not reproducible. At least not on my WAMPServer v3.0.6 – RiggsFolly Jan 31 '17 at 15:57
  • All I can think of is that there is some minor corruption in your source file. Delete that script completely and recode it from scratch. I suggest you do not use `notepad` as an editor, if thats what you were doing, download `notepad++` its free and a very decent code editor – RiggsFolly Jan 31 '17 at 15:59
  • 1
    @HPierce Ooo nice SO got a spell checker at last – RiggsFolly Jan 31 '17 at 16:02
  • Maybe they are using Word as an editor? – RiggsFolly Jan 31 '17 at 16:10
  • I was using Dreamweaver. Also I was using notepad++ – scarlet Jan 31 '17 at 18:17

0 Answers0