SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL Error, PHP

    I installed phpBB on my own personal server, and allowed my stepdad to make the site how he wanted it.

    Tonight, we purchased a server, and hosting, and I was trying to move the files over to the new server, but I keep getting this error:

    PHP Code:
    SQL ERROR mysql4 ]

    Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) [2002]

    An sql error occurred while fetching this page. Please contact an administrator if this problem persists. 
    Any idea what this is caused by?

  2. #2
    SitePoint Evangelist simshaun's Avatar
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Might wanna get in touch with your host and make sure MySQL is setup correctly.

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I fixed that problem
    now I have this one

    Here is the error:

    PHP Code:
    Parse errorsyntax errorunexpected ')' in /home/content/m/y/s/myslashtruck/html/forums/common.php on line 165 
    here is lines 160-172

    PHP Code:
        $url .= $script_path;
        
    header('Location: index.php);
        exit;
    }

    if(defined(DEBUG_EXTRA'
    ))
    {
        
    $base_memory_usage 0;
        if (
    function_exists('memory_get_usage'))
        {
            
    $base_memory_usage memory_get_usage();
        }

    See an error dealing with that?

  4. #4
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry for double post, I found that error.
    But I have NO idea what this means
    PHP Code:
    Parse errorsyntax errorunexpected T_CONSTANT_ENCAPSED_STRING in /home/content/m/y/s/myslashtruck/html/forums/common.php on line 168 

  5. #5
    SitePoint Evangelist simshaun's Avatar
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if(defined(DEBUG_EXTRA'))
    should be
    if(defined('DEBUG_EXTRA'))

  6. #6
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    error:

    PHP Code:
    Parse errorsyntax errorunexpected T_STRING in /home/content/m/y/s/myslashtruck/html/forums/common.php on line 168 
    code now

    PHP Code:
        $url .= $script_path;
        
    header('Location: index.php');
        exit;
    }

    if(
    defined('DEBUG_EXTRA'))
    {
        
    $base_memory_usage0
        function_exists
    ('memory_get_usage');
        {
            
    $base_memory_usage memory_get_usage();
        }


  7. #7
    SitePoint Evangelist simshaun's Avatar
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $base_memory_usage= 0
    should be
    $base_memory_usage= 0;

    function_exists('memory_get_usage');
    should be
    if (function_exists('memory_get_usage'))

  8. #8
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something mangled your file. It would never have worked like that on the other server, so the file got changed somehow. You don't want to try to fix all these files. Just get them uploaded correctly, try different programs.

    What program are you using to copy the files over?

  9. #9
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just uploaded the file from the other server, and I changed one bit.

    [php] $url .= $script_path;
    header('Location: ' . $url);
    exit;
    }[/php

    I changed to:
    PHP Code:
        $url .= $script_path;
        
    header('Location: index.php');
        exit;

    Should I have left it alone?

    Either way, I am still getting this error:

    PHP Code:
    WarningCannot modify header information headers already sent by (output started at /home/content/m/y/s/myslashtruck/html/forums/config.php:19in /home/content/m/y/s/myslashtruck/html/forums/common.php on line 161 

  10. #10
    SitePoint Evangelist simshaun's Avatar
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are obviously changing more than that
    Your code was semi-correct in post #3 and mangled in #6.

    The reason you are getting the Cannot modify header information error is because you are outputting something before header('Location: index.php') is called.
    Either that or there is whitespace before your first opening php tag.

  11. #11
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Should I just post the whole common.php code where this is and see if you guys can find the error?

    It is from phpbb, but, would you like me to post it all?

    I re-uploaded it from my other server and left EVERYTHING the same..Same error.

  12. #12
    SitePoint Evangelist simshaun's Avatar
    Join Date
    Apr 2008
    Location
    North Carolina
    Posts
    438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dude you might be better off just re-downloading phpbb and re-uploading

  13. #13
    SitePoint Enthusiast
    Join Date
    Jan 2004
    Location
    Boston, MA
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I second re-uploading the files, sometimes it just don't work out right and an upload will typically fix it.

    You especially do not want to start running into issues down the road, if you upload a fresh good set of files now you can save yourself some trouble in the future.
    www.okihost.com
    Quality Hosting Solutions Since 2002


Bookmarks

Posting Permissions

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