Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Parse Error

edited September 2011 in Vanilla 2.0 - 2.8
I'm trying to port phpbb2 to vanilla 2 using this porter but get the following:

Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/forum/public_html/vanilla2export.php on line 57

Any help would greatly be appreciated!
Tagged:

Answers

  • Open the file /home/forum/public_html/vanilla2export.php
    Find line 57
    Try to figure out why the parse error occurs
    If you can't figure it out, post a piece of code, 5 lines above line 57 and 5 lines under line 57

    There was an error rendering this rich post.

  • /** * Object for exporting other database structures into a format that can be imported. */ class ExportModel { 57 const COMMENT = '//'; const DELIM = ','; const ESCAPE = '\\'; const NEWLINE = "\n"; const NULL = '\N'; const QUOTE = '"';

    TIA for the help. :)
  • That's the problem, the //
    I think you either need to escape it by '\//' or '\/\/' or something else.
    Give these 2 options a try and post the results here.

    There was an error rendering this rich post.

  • What version of PHP do you have?
  • Host has PHP v5.2.17. I'll give @UnderDog's suggestion a try and post results.
  • candymancandyman ✭✭
    edited November 2011
    I have the same error.

    Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /web/htdocs/www.mysite.it/home/vanilla2export.php on line 58

    That line in the vanilla2porter.php read:

    const COMMENT = '//';

    Any help, please?
  • x00x00 MVP
    edited November 2011
    it is not to do with escaping. Make sure you are using php5, some host have two version of php.

    if so you can use
    SetEnv DEFAULT_PHP_VERSION 5

    in your .htaccess

    grep is your friend.

  • Thanx x00, I have PHP 4.4.9 :(

    I must ask the mainteiner for the upgrade or is there a solution to run the Porter with the old PHP 4?

    I ask this 'cause phpBB may stop working with PHP 5: it needs the deprecated HTTP_*_VARS arrays which is turned off by default in PHP 5.
    Anyway the DB should work, I think.
  • Vanilla/Garden doesn't run on on php 4.

    grep is your friend.

  • it shouldn't matter, what phpbb runs on it is the database that it works with

    grep is your friend.

  • candymancandyman ✭✭
    edited November 2011
    OK.

    I'm almost sure that the early version of the Porter (1.1) run with PHP4.
    I've made a quite successfull migration months ago.

    Unfortunately I need phpBB to run for some time to solve another problem...

    I would ask for the upgrade.
  • Ah but you don't have to do this concurrently.

    grep is your friend.

Sign In or Register to comment.