Help! Have a php error (says jerkface GoDaddy service rep) and I'm a nooooob!

Discussion in 'HTML & Website Design' started by Paul Teitelman, Jun 3, 2008.

  1. #1
    Hey,

    Trying to get some help and I'd figure I'd turn to the lovely members of the DP community. Your help would be most appreciated and I am known to give rep where it's due:

    I am just trying to download a wordpress theme for my sites and here is my code, apparently there is an error in the 4th line:

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./wp-blog-header.php');
    ?>

    PLEASE HELP!!! What/how can i fix this?
     
    Paul Teitelman, Jun 3, 2008 IP
  2. itcn

    itcn Well-Known Member

    Messages:
    795
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    118
    #2
    What does the error say? I am assuming you want to use your word press theme in an external PHP file. It may perhaps be because you simply have the wp-blog-header.php file in a different directory. Put the actual relative path to the file in the require line
    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', false);
    require('/the/path/to/your/wp-blog-header.php');
    ?>
     
    itcn, Jun 3, 2008 IP
    Paul Teitelman likes this.
  3. FPForum

    FPForum Notable Member

    Messages:
    4,172
    Likes Received:
    102
    Best Answers:
    0
    Trophy Points:
    225
    Digital Goods:
    2
    #3
    What itcn said. GoDaddy uses some different absolute paths unlike cPanel and I think its something like:
    /home/content/1/2/3/username/html/location/of/wp-blog-header.php

    1/2/3 are the first three letters in your username IE
    /home/content/u/s/e/username/html/
     
    FPForum, Jun 3, 2008 IP
    Paul Teitelman likes this.
  4. urbn

    urbn Peon

    Messages:
    184
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    For security reasons some hosts don't allow you to use the mappath.

    You can try the following
    In your root directory (where your index.php file is create a new file called test.php
    open test.php add the following line:
    echo realpath('test.php');

    View the test.php in your web browser. You will get the direct path to your home directory. Add this path (minus test.php) in replace of the ./

    Sounds a bit confusing but what you need to do is find the exact path to the file to call it. You may have to update all of your wordpress files to use this system.
     
    urbn, Jun 3, 2008 IP
    Paul Teitelman likes this.
  5. Paul Teitelman

    Paul Teitelman Peon

    Messages:
    243
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for the help guys I'll try these tips out but I deleted all my old files buy I never changed the path files so I'll download the wordpress theme again and try out what you mentioned.
     
    Paul Teitelman, Jun 4, 2008 IP