Problem with Apache/PHP
Posted by: Avarus (---.upc-h.chello.nl)
Date: April 22, 2007 05:52PM

Hi everyone,

A while ago I've installed WAMP5 (v1.7.0) on a WinXP computer. When I go to either [localhost] or [127.0.0.1], I got this error (aswell in IE7.x and MF):

Parse error: syntax error, unexpected T_STRING in D:\Programma's\WAMP5\www\index.php on line 86

Whenever I place another .html file in the www directory, I can view it correctly. But whenever I place a .php file in it, the php will not show up. The same goes for embedded php in a .html file: the html does show up, the php does not. This is an example code of some embedded code:

<html>
<head>
<title>PHP Test</title>
</head>
<body>
<?php
echo "Hello world!";
?>
</body>
</html>

When I switch to php4 (add-on), I got this error (read carefully, nearly the same as the previous one):

Parse error: parse error, unexpected T_STRING in D:\Programma's\WAMP5\www\index.php on line 86

I also have copied some correctly working .php files from my server (CentOS, LAMP server with same php and apache versions) to my WinXP comp, but it had no effect. I guess this problem is php related, maybe the smart guys in here can help me with this...

Thank you in advance

Options: ReplyQuote
Re: Problem with Apache/PHP
Posted by: CyberSpatium (71.237.217.---)
Date: April 22, 2007 09:21PM

make sure the file has a .php extension,not a .html extension. also, it does,not seem you are posting your whole php code because the error says on line 86, but your code is only 10 lines long.




CyberSpatium
----------------------
WAMP English Forum Admin

Need help? Check out my WAMP User Manual/Guide here!

Please visit my latest website Clarify Loans:
clarifyloans.com

Options: ReplyQuote
Re: Problem with Apache/PHP
Posted by: Avarus (---.upc-h.chello.nl)
Date: April 22, 2007 10:32PM

The error is from the index.php, the default index of Apache located in www. The code I gave was just an example to show that it's not just an error in that particular index file (by the way I saved that example as test.php and test.html, both did not work).

While writing this post I may have found the problem which I am able to fix. I'll check it, you'll hear from me soon enough...

EDIT: Yes, I have found it. Check line 86 from the original Apache2 index.php file:

$pma_conf_file = 'D:/Programma's/WAMP5/phpmyadmin/'.'config.inc.php'

I have installed WAMP to a parent folder named "Programma's" (in English it is programs without the ', but in Dutch you need to put that ' there). When PHP was checking for his root folder, he came across that ' and interprented it as the end of the line. Now I have it installed to C:/Program Files/WAMP5, it's all running smooth and easy...

Thank you for your help anyway



Post Edited (04-22-07 22:39)

Thanks

Options: ReplyQuote


Sorry, only registered users may post in this forum.