Total PHP newbie
Posted by: John Cookson (---.cpe.net.cable.rogers.com)
Date: January 12, 2006 07:08PM

Although I started in computers before DOS (CP/M systems), I can't seem to get off the ground with PHP. I am very proficient in CSS and HTML, use Homesite 5.5, Photoshop CS etc. and can whip up websites really quickly. I knew I would have to get on with learning PHP because my small commercial websites require that the customer be able to change their own product pricing.

Tried to get an AMP setup going a year ago but quit out of frustration. Gee, I'm probably the only guy in the world ever to get frustrated with the whole PHP thing...

Bought my Learning PHP 5 book. Manually installed MySQL 4.1, Apache 2.0.55 and PHP 5.1. Carefully followed all instructions with the paths, adding PHP instructions to the HTTPD file, made the necessary changes to the php.ini and it all sort of worked. I could never get this to run: <?php phpinfo(); ?> at all and it would not run this simple "This is a PHP line" test seen below without coming up with a parse error, unexpected on line 8. Ripped it all out and tried a few more times and did get the "phpinfo" to run but not the other example. Now I am totally bald from ripping my hair out and my wife no longer likes me.

Bit the bullet and installed WAMP5. It seems really great and is quite easy to use. Got myself an PHP IDE: PHP Designer 2006 and was ready to go. Started through my basic examples of PHP from the book and WAMP5 comes up with exactly the same error message! Unreal! I can see nothing wrong with the code below that came right out of my training book. I also searched for any errant php.ini files from the previous installs but there is only the one in WAMP5. I do remember copying over libmysql.dll file into Windows but had also removed it.

This simple example will not run and we get this error message:

Parse error: parse error, unexpected '>' in C:\wamp\www\hello.php on line 8

<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>


This will run no problem at all:

<html>
<head>
<title>Info</title>
</head>
<body>
PHP Info: <?php phpinfo(); ?>
</body>
</html>

Anybody have any ideas? I have made no adjustments to WAMP5 at all. Right out of the box it should run simple code like that example. I had everything running before just like it's running on WAMP5 so I did a fairly good job and am still stuck.

Options: ReplyQuote
Re: Total PHP newbie
Posted by: rzr (---.ro)
Date: January 12, 2006 08:47PM

Are those things normal double quotes ?
echo "<p>This is a PHP line</p>";

Options: ReplyQuote
Re: Total PHP newbie
Posted by: Kathy (---.cpe.net.cable.rogers.com)
Date: January 15, 2006 05:56AM

I'm with you on this one. I've been having this problem for the last couple days with a couple of my local sites. On one site I added a wordpress theme, on another I've tried installing phpbb2. In both cases the files are un-edited downloads. I've checked my code and can find nothing wrong with it that would be causing the error. It's always directed at the last line of code.

The wordpress theme I installed on my live site to try, even with the local errors. I uploaded the files unchanged, as extracted from the .zip file, and everything worked on the live server. Since I'm not getting the error on the live site and I've gotten it with two different local installs with completely different software I'm assuming Wamp is the problem. Anyone have any suggestions on how to fix this?

Options: ReplyQuote


Sorry, only registered users may post in this forum.