Page 1 of 1

session_start(): Cannot send session cookie

Posted: Tue May 01, 2007 2:43 pm
by unorthodokz
Hey ya'll. I'm new to PHP, but I've worked through it and gotten a script with a database running properly on my comp (Windows). I'm trying to load it up to a GoDaddy host that is Linux based. I added the MySQL database through the steps that they provided me and simply loaded all of the files/directories to the server through an FTP. When I go to the page now (http://www.musicdocumentaries.org) I'm receiving this error:

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/content/m/u/s/musicdocument/html/index.php:2) in /home/content/m/u/s/musicdocument/html/library/config.php on line 7

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/content/m/u/s/musicdocument/html/index.php:2) in /home/content/m/u/s/musicdocument/html/library/config.php on line 7
Table 'unorthodokz.tbl_shop_config' doesn't exist

I'm hoping that this is a simple fix, but I'm stumped. Is there something differently about Linux that I'm missing, or did I not config something properly for the page? My $dbHost, User, Pass, and Name all look to be changed correctly.

Any thoughts? Any bit of help is MORE THAN APPRECIATED!

Thanks,

Charlie

Posted: Tue May 01, 2007 3:14 pm
by feyd
Please search the forums for "headers already sent"

Posted: Tue May 01, 2007 3:24 pm
by unorthodokz
Yeah, I definitely searched for it and got a bunch of random stuff that was completely useless to the problem.

Posted: Tue May 01, 2007 8:23 pm
by feyd
unorthodokz wrote:Yeah, I definitely searched for it and got a bunch of random stuff that was completely useless to the problem.
Keep digging through the results.. since it's been talked about thousands of times by now, the answer is buried under other users asking the same questions and us responding just the same.

Posted: Wed May 02, 2007 7:27 am
by unorthodokz
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


I fixed the error about the headers already sent.  but I still am receiving this:

Table 'unorthodokz.tbl_shop_config' doesn't exist

Using GoDaddy's (the host) guides I set up the database and have it configured right.  However, I didn't add a table in the PHPMyAdmin because I never used it before when the script was loaded on my local computer.

This is the only thing in my code that I could find that was possibly applicable:

Code: Select all

function getShopConfig()
{
	// get current configuration
	$sql = "SELECT sc_name, sc_address, sc_phone, sc_email, sc_shipping_cost, sc_order_email, cy_symbol 
			FROM tbl_shop_config sc, tbl_currency cy
			WHERE sc_currency = cy_id";
	$result = dbQuery($sql);
	$row    = dbFetchAssoc($result);

    if ($row) {
        extract($row);
	
        $shopConfig = array('name'           => $sc_name,
                            'address'        => $sc_address,
                            'phone'          => $sc_phone,
                            'email'          => $sc_email,
				    'sendOrderEmail' => $sc_order_email,
                            'shippingCost'   => $sc_shipping_cost,
                            'currency'       => $cy_symbol);
    } else {
        $shopConfig = array('name'           => '',
                            'address'        => '',
                            'phone'          => '',
                            'email'          => '',
				    'sendOrderEmail' => '',
                            'shippingCost'   => '',
                            'currency'       => '');    
    }

	return $shopConfig;						
}
Do I need to add a table to my PHPMyAdmin or whats the deal?


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed May 02, 2007 7:32 am
by feyd
It sounds like you may have made an mistake during installation of this software.

Posted: Wed May 02, 2007 7:34 am
by unorthodokz
on my local computer or the host?

Posted: Wed May 02, 2007 7:52 am
by feyd
Wherever the error is happening.