Discussion:
[PHP-INSTALL] php parse error after installation
kevin
2012-09-08 07:42:26 UTC
Permalink
Hi there,

I have exhausted all methods I can find to fix this problem
,which is from the following php code from php 5 for dummies book, which I
doubled checked as well from their website,



<html>

<head>

<title>PHP Test</title>

</head>

<body>

<p>This is an HTML line

<?php

echo "<p>This is a PHP line</p>";

phpinfo();

?>

</body>

</html>



When I use ms explorer 9 to run this file on my server 2008r2 I get the
following error,

Php parse error syntax error, unexpected '>' in c:\inetpub\wwwroot\test.php
on line 6. I am using ver 5.3 php

I have double checked both the php.ini file to make sure
that the following are in there and not blocked by semicolons

Fastcgi.impersonate=1

Fastcgi.logging =0

Cgi.fix_pathinfo=1

Cgi.force_redirect=0



Also I have double checked the iis7 add module mapping as is suggested in
faq on php site with still no joy very frustrating, any help would be
greatly appreciated. Thanks



Regards kevin
Daniel Brown
2012-09-08 14:58:24 UTC
Permalink
Post by kevin
Hi there,
I have exhausted all methods I can find to fix this problem
,which is from the following php code from php 5 for dummies book, which I
doubled checked as well from their website,
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
<?php
echo “<p>This is a PHP line</p>”;
Note the special quotes you're using here --- that's why. PHP
doesn't understand fancy quotes, only:

Single-quotes ( ' ), which PHP parses as a literal string.
Double-quotes ( " ), which PHP parses as a string to be
interpreted (such as the translation of variables).
Backticks ( ` ), which PHP uses to execute command-line code
(if permitted by system configuration).

Change your quotes to either single or double quotes and your
problems should vanish.
--
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/
Keith Roberts
2012-09-08 16:14:31 UTC
Permalink
Subject: Re: [PHP-INSTALL] php parse error after installation
Post by kevin
Hi there,
I have exhausted all methods I can find to fix this problem
,which is from the following php code from php 5 for dummies book, which I
doubled checked as well from their website,
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
<?php
echo “<p>This is a PHP line</p>”;
Note the special quotes you're using here --- that's why. PHP
Single-quotes ( ' ), which PHP parses as a literal string.
Double-quotes ( " ), which PHP parses as a string to be
interpreted (such as the translation of variables).
Backticks ( ` ), which PHP uses to execute command-line code
(if permitted by system configuration).
Change your quotes to either single or double quotes and your
problems should vanish.
Well spotted Daniel.

I was just gonna say use this instead:

<head>
<title>php-info</title>
</head>

<body>

<?php phpinfo(); ?>

</body>

Kind Regards,

Keith

-----------------------------------------------------------
Websites:
http://www.karsites.net
http://www.php-debuggers.net
http://www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with
TMDA [http://tmda.net]
-----------------------------------------------------------
kevin
2012-09-08 20:12:41 UTC
Permalink
Hi Daniel,
Thanks very much for that , another member pointed out my mistake
was the quotes I had used , was in fact copy and pasted to ensure no typos
but acrobat must have thought it was different character, anyway problem
definitely gone cheers

Regards kevin


-----Original Message-----
From: ***@karsites.localdomain [mailto:***@karsites.localdomain] On
Behalf Of Keith Roberts
Sent: Sunday, 9 September 2012 04:15
Cc: php-***@lists.php.net
Subject: Re: [PHP-INSTALL] php parse error after installation
Subject: Re: [PHP-INSTALL] php parse error after installation
Post by kevin
Hi there,
I have exhausted all methods I can find to fix this
problem ,which is from the following php code from php 5 for dummies
book, which I doubled checked as well from their website,
<html>
<head>
<title>PHP Test</title>
</head>
<body>
<p>This is an HTML line
<?php
echo "<p>This is a PHP line</p>";
Note the special quotes you're using here --- that's why. PHP
Single-quotes ( ' ), which PHP parses as a literal string.
Double-quotes ( " ), which PHP parses as a string to be
interpreted (such as the translation of variables).
Backticks ( ` ), which PHP uses to execute command-line code
(if permitted by system configuration).
Change your quotes to either single or double quotes and your
problems should vanish.
Well spotted Daniel.

I was just gonna say use this instead:

<head>
<title>php-info</title>
</head>

<body>

<?php phpinfo(); ?>

</body>

Kind Regards,

Keith

-----------------------------------------------------------
Websites:
http://www.karsites.net
http://www.php-debuggers.net
http://www.raised-from-the-dead.org.uk

All email addresses are challenge-response protected with TMDA
[http://tmda.net]
-----------------------------------------------------------
Daniel P. Brown
2012-09-08 20:16:41 UTC
Permalink
Post by kevin
Hi Daniel,
Thanks very much for that , another member pointed out my mistake
was the quotes I had used , was in fact copy and pasted to ensure no typos
but acrobat must have thought it was different character, anyway problem
definitely gone cheers
Yeah, Acrobat (and similar products), Word, and other editors are
notorious for translating quotes, dashes, and other punctuation
characters into a fancier style that isn't generally code-compatible.
--
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/
Loading...