When you want to share variables with different php files

There seem to be two below, but the first one somehow gave me a timeout error, so I decided to go with the second one.

Use include and require functions
Use $_SESSION and $GLOBAL
Using form

Note, however, that the following error will occur if you put any output (var_dump, blank space, new line, etc.) before session_start(), which is a declaration that uses $_SESSION!
Include, require may be included.

Warning: session_start() [function.session-start ]: Cannot send session cache limiter - headers already sent (output started at

Furthermore, it seems that $_SESSION should only be used in one place. Otherwise, the following error will occur.
http://oshiete.goo.ne.jp/qa/1244827.html

Notice: A session had already been started - ignoring session_start() in