[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

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
0
mhdi
Asked:
mhdi
  • 5
  • 3
  • 2
  • +1
1 Solution
 
twohawksCommented:
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?
0
 
twohawksCommented:
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.
0
 
mhdiAuthor Commented:
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
bigeven2002Commented:
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.
0
 
mhdiAuthor Commented:
Found it.

"pagination:" is a go to command. http://php.net/manual/en/control-structures.goto.php
However... "The goto operator is available as of PHP 5.3."

I had to upgrade from 5.2 to 5.3 to get it too work.

Thanks for your help
0
 
mhdiAuthor Commented:
Found solution myself.
0
 
twohawksCommented:
Wow, I didn't know we had that in php.  good to know!
0
 
twohawksCommented:
{traces of DOS}
0
 
bigeven2002Commented:
That makes 2 of us.  Thanks for the update.
0
 
Ray PaseurCommented:
0
 
twohawksCommented:
A Jurassic Halmark Moment  
Apropo.. lol
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now