Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation WordPress PHP Issue

    I have recently moved my WordPress installation over to a different server. I can no longer access my site.

    My new host gives an error message when accessing my site:

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/iwhblog1/public_html/admin.php on line 30

    The code for admin.php is:

    PHP Code:
    <?php
    /**
     * WordPress Administration Bootstrap
     *
     * @package WordPress
     * @subpackage Administration
     */

    /**
     * In WordPress Administration Screens
     *
     * @since 2.3.2
     */
    if ( ! defined('WP_ADMIN') )
        
    define('WP_ADMIN'TRUE);

    if ( ! 
    defined('WP_NETWORK_ADMIN') )
        
    define('WP_NETWORK_ADMIN'FALSE);

    if ( ! 
    defined('WP_USER_ADMIN') )
        
    define('WP_USER_ADMIN'FALSE);

    if ( ! 
    WP_NETWORK_ADMIN && ! WP_USER_ADMIN ) {
        
    define('WP_BLOG_ADMIN'TRUE);
    }

    if ( isset(
    $_GET['import']) && !defined('WP_LOAD_IMPORTERS') )
        
    define('WP_LOAD_IMPORTERS'true);

    require_once(
    dirname(dirname(__FILE__)) '/home/iwhblog1/wp-load.php' include_path='/usr/local/php53/pear';

    if ( 
    get_option('db_upgraded') ) {
        
    $wp_rewrite->flush_rules();
        
    update_option'db_upgraded',  false );
    Line 30 is:
    PHP Code:
    require_once(dirname(dirname(__FILE__)) '/home/iwhblog1/wp-load.php' include_path='/usr/local/php53/pear'


    I am new to PHP although I now HTML as WordPress a lot. I cannot access any of my WP site, but I can access the files for it.

    Any help would be greatly appreciated! :)

  • #2
    Regular Coder stevenmw's Avatar
    Join Date
    Jun 2007
    Location
    OK
    Posts
    497
    Thanks
    27
    Thanked 31 Times in 31 Posts
    Check you config file to make sure all the DB connection info is correct. Make sure any settings that you established on the old server are changed to match the new server.

    Do you have info / content you don't want to lose? I'd just reinstall WP.

  • #3
    New Coder
    Join Date
    May 2012
    Posts
    17
    Thanks
    0
    Thanked 3 Times in 3 Posts
    You have dirname repeated twice in that string

  • #4
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Looks like you have manually edited the core of Wordpress, which is generally a bad idea because it prevents your ability to update easily. That admin.php file should be under /wp-admin/ and that line should look like this:
    PHP Code:
    require_once(dirname(dirname(__FILE__)) . '/wp-load.php'); 

  • #5
    New to the CF scene
    Join Date
    Jul 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do you have info / content you don't want to lose? I'd just reinstall WP.
    Make sure any settings that you established on the old server are changed to match the new server.Check you config file to make sure all the DB connection info is correct click here for more info.

  • #6
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,547
    Thanks
    8
    Thanked 1,094 Times in 1,085 Posts
    I would save your theme directory in a safe place and
    totally re-install WordPress from square one.

    If your blog database is important, you can save that also.

    The only place where you should edit or customize is
    your theme directory ... no other places.

    Also make sure .htaccess has been created correctly.

  • #7
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,546
    Thanks
    45
    Thanked 259 Times in 256 Posts
    Well, I'd say you can edit/customize your core with the complete understanding that it will screw up on upgrades/moves and that you must know 100% what you're doing and how to replicate it in the future.

    That being said, I've never come across a situation where it was worth the hassle.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •