WordPress.org

Ready to get started?Download WordPress

Forums

xammp localhost, Parse error: syntax error, unexpected T_VARIABLE (12 posts)

  1. foodboy
    Member
    Posted 1 year ago #

    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

  2. esmi
    Forum Moderator
    Posted 1 year ago #

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

  3. foodboy
    Member
    Posted 1 year ago #

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

  4. foodboy
    Member
    Posted 1 year ago #

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

  5. esmi
    Forum Moderator
    Posted 1 year ago #

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

  6. foodboy
    Member
    Posted 1 year ago #

    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?

  7. foodboy
    Member
    Posted 1 year ago #

    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

  8. esmi
    Forum Moderator
    Posted 1 year ago #

    In the root WordPress folder.

  9. foodboy
    Member
    Posted 1 year ago #

    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

  10. esmi
    Forum Moderator
    Posted 1 year ago #

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

  11. foodboy
    Member
    Posted 1 year ago #

    Understand what you are suggesting but it 'should' work with xammp! Thanks for your help esmi :)

  12. foodboy
    Member
    Posted 1 year ago #

    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? :)

Topic Closed

This topic has been closed to new replies.

About this Topic