WordPress.org

Support

Support » Localhost Installs » xammp localhost, Parse error: syntax error, unexpected T_VARIABLE

xammp localhost, Parse error: syntax error, unexpected T_VARIABLE

  • Hi I am new to wordpress,

    I have copied the wp folder from a site which has been designed previously by someone else.

    To test eveything to see how it works I have downloaded the files from the server and copied them to my htdocs folder on localhost, which uses xammp. I then exported the database and imported into phpmyadmin running localhost. I have kept the same naming conventions, username and password. I then amended the config file in wordpress to reflect the changes as I originally had a database connection error! I solved this, but I now get the error below and I am stumped.

    Parse error: syntax error, unexpected T_VARIABLE in /homepages/35/d2********/htdocs/<website name>/wp/wp-includes/option.php on line 225

    The files were downloaded from 1 and 1 and I understand there has been issues before with this, however the files are now running on localhost running php version 5,4,7 !!

    Hope someone knows what could cause an error like this please, it’s driving me mad!

    Thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • esmi

    @esmi

    Forum Moderator

    That sounds like you are running PHP 4 on your local server. You need PHP version 5.2.4 or greater.

    I am running PHP version 5.4.7, so I dont think it would be the PHP version?

    Thanks for you input tho! esmi, much appreciated 🙂 Do you have any other ideas?

    esmi

    @esmi

    Forum Moderator

    That error is classically seen on servers that have both PHP4 and 5 available, so I suspect that this is a server configuration issue.

    My php installation was a fresh install of xammp from two days ago using the installer out of the box. Has there been any other issues like this using xammp and PHP 5,4,7?

    If it is not the version could it be anything else in the wordpress files that could have been changed to cause this issue?

    If I create a .htaccess file with the below only entry, were would I put it in the wordpress file structure? Thanks

    SetEnv PHP_VER 5

    esmi

    @esmi

    Forum Moderator

    In the root WordPress folder.

    Ok the .htaccess does not help it still fails. I double checked the php version from the command line

    C:\xampp\php>php -v
    PHP 5.4.7 (cli) (built: Sep 12 2012 23:48:31)
    Copyright (c) 1997-2012 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies

    sorry esmi, driving me mad, is there anything else that I can check?

    Thanks

    esmi

    @esmi

    Forum Moderator

    Any chance you could try another local server such as EasyPHP?

    Understand what you are suggesting but it ‘should’ work with xammp! Thanks for your help esmi 🙂

    The following link provides great instructions showing how easy it is to run wordpress using xammp

    http://sixrevisions.com/tutorials/web-development-tutorials/using-xampp-for-local-wordpress-theme-development/

    this error seems to cause a lot of problems and I don’t think it is just the php version? 🙂

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘xammp localhost, Parse error: syntax error, unexpected T_VARIABLE’ is closed to new replies.
Skip to toolbar