Dear all,
I'm an absolute beginner in the area of PHP, Apache and MySQL. So, please endure my too basic question.
I installed XAPMM and configured what the book (Apress PHP For Absolute Beginners) recommended.
When i issue http://localhost/xampp/, i see the XAMPP page, which i pressume my installation is OK.
Then i created a file called test.php with the contents below :
<?php
echo “Hello world!”;
?>
But when i run it by issuing http://localhost/Ezyledger/test.php
I got
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in D:\xampp\htdocs\Ezyledger\test.php on line 2
Then i tried to replace the test.php with the following :
<script language="php">
echo 'This is some text';
</script>
Then i see the text (This is some text).
My question is is my PHP / Apache configured properly and working fine ? It is important because else, i cannot follow the example in the book that i am trying to learn from there.
Your valuable advice is highly appreciated.
Is my Php really working ?
Moderator: General Moderators
Re: Is my Php really working ?
Not sure, but the problem may be that you are using "curly" quotes -- try replacing them with straight quotes or apostrophes:
Curly quotes are often the result of coding in a word processing program like Word. Try Notepad, TextEdit, etc. instead.
Code: Select all
<?php
echo "Hello World!";
echo 'Hello World!';
?>Re: Is my Php really working ?
Yep its the quotes, thats why I prefer single quotes.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: Is my Php really working ?
Moved to PHP-Code.
Does nobody read the forum descriptions anymore
Does nobody read the forum descriptions anymore