Link to home
Start Free TrialLog in
Avatar of mhdi
mhdi

asked on

PHP - Parse error: syntax error, unexpected ':'

Hi,

I have this code working on my localhost WAMP server. However after setting it up on my brand new VPS I get the following error.

Parse error: syntax error, unexpected ':' in .... on line 69

Open in new window


Any ideas what this could be? I have never seen a colon in PHP before.

Line 69 is line 8 from the snippet below...

//pagination get
$counterPagination="";
$counterPagination=0;
$address[$counterPagination]=$urlMain;
$paginationAddress="";
$paginationAddress=$urlMain;
	
pagination:
$htmlPagination = new simple_html_dom;
$ch = curl_init();

Open in new window


I assume it is something to do with my VPS setup / configuration.

Thanks
MHDI
Avatar of twohawks
twohawks
Flag of United States of America image

Is that being pulled from some sort of "xxx.ini" file somewhere?  Perhaps being dynamically written to this file?
this is a php file error, yes?
I do not do a vps (yet), however, one thing I got bit by once was code compatibility issues when moving from php executable to php-cgi environment.  Things work differently for some aspects in each of those.

Just a thought.
Avatar of mhdi
mhdi

ASKER

Yes this is a php error.

I dont have any ini files so I dont think it is dynamic as you suggested.

Ill look into the php-cgi suggestion.
Hello,

The only times I can recall that a colon is used in PHP is for shorthand conditional statements (ternary operators) and classes (scope resolution operators).

I think line 68 was meant to be a comment.  Put a // or a # in front of it and re-run your script to see if it functions normally.
ASKER CERTIFIED SOLUTION
Avatar of mhdi
mhdi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mhdi

ASKER

Found solution myself.
Wow, I didn't know we had that in php.  good to know!
{traces of DOS}
That makes 2 of us.  Thanks for the update.
A Jurassic Halmark Moment  
Apropo.. lol