Parse error every time

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Parse error every time

Postby RogerK » 29. December 2015 16:28

I am new to Xampp and PHP. I installed Xampp succcesfully and the index.php programme shows correctly. I have MySql database, ProFTPD, and Apache Web server all running

I now want to demonstrate that it will work when I write a very simple test programme. The programme is:-
Code: Select all
<?php
echo “Hello World!”;
?>

Each time I try, I get the error:-
Code: Select all
Parse error: syntax error, unexpected 'World' (T_STRING), expecting ',' or ';' in /Applications/XAMPP/xamppfiles/htdocs/hello.php on line 2

I am using a Macbook Pro running OSX 10.10.5 and Xampp version 5.6.15-1.

I wrote the programme with my Mac’s Textedit and have checked that it is producing plain text and using Unicode (UTF-8) but somehow Apache appears to be misinterpreting the inverted commas. Both appear to me to be the correct start/finish version.

I imagine this is a very basic simple problem but I have been struggling for two days and any help would be gratefully received.
RogerK
 
Posts: 2
Joined: 29. December 2015 16:14
Operating System: OSX 10.10.5

Re: Parse error every time

Postby Nobbie » 29. December 2015 20:01

You are using the wrong quote characters for "Hello World".
Nobbie
 
Posts: 8767
Joined: 09. March 2008 13:04

Re: Parse error every time

Postby RogerK » 30. December 2015 12:06

Thank you very much. You have solved it. Rewriting the mini-programme with Brackets makes it quite obvious because the quote goes red. I shall avoid Textedit in future.
RogerK
 
Posts: 2
Joined: 29. December 2015 16:14
Operating System: OSX 10.10.5

Re: Parse error every time

Postby Nobbie » 30. December 2015 12:19

RogerK wrote:I shall avoid Textedit in future.


I dont know Textedit (neither any other OSX editor), but i would not blame the editor, i think it is a question of the keyboard driver. Maybe you have different keys for different quotes? This is a known issue for Windows also, there are also so called "backticks" on the keyboard. On a small monitor or a monitor with small letters it is hard to see, which quotes are generated by the keyboard.
Nobbie
 
Posts: 8767
Joined: 09. March 2008 13:04


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 5 guests