Re: session_start() || shell access problem......
| From: | Marek Kilimajer | Date: | Sun, 21 Sep 2003 09:58:16 +0000 |
| Subject: | Re: session_start() || shell access problem...... | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-163336@lists.php.net to get a copy of this message | ||
Sessions don't work on command line and that is how you run your script - from command line.
CF High wrote:
Hey Robert. Indeed, hard to find the problem. I don't believe it's a whitespace issue, or even a "Headers sent issue", despite the fact that I'm receiving that error. Check it out: test.php contains just one line: <?$text = `usr/local/bin/php /path/to/my/php/test1.php`;?> test1.php, the file to be executed, contains just one line: <?session_start();?> There are no line breaks, spaces, etc. Still get "Headers already sent". Pretty strange, right? Correct me if I'm wrong, but I think the problem may be related to the fact that when files are executed from the command line, php now looks for include_paths, session_paths, etc. relative to the server root; not the site root. I can think of no other reason why include paths, starting sessions, and so on, return errors from the command line but ork perfectly fine when run in a browser..... Feel free to clue me in -- I know didly about shell access issues. --Noah "Robert Cummings" <robert@interjinn.com> wrote in message news:1064091763.19204.1.camel@blobule.suds...On Sat, 2003-09-20 at 15:46, CF High wrote:theHey all. I'm running a script from the command-line php interpreter as follows: (thanks to D. Souza for lead) $text =usr/local/bin/php /path/to/my/php/page.php; within the read file I want to enable sessions, so I session_start() atatop of the page: <? session_start(); ?> <? code to execute here....... ?> Regardless of how I mess around with placement of session_start(), I get"Headers already sent". Why? Nothing has been output to the browser within the read file! Furthermore, if I create a test page with just: <?$text =This often is difficult to detect when there's is implicit output outside of the <? tag. Check the top of the included file or start php script and see if there is any whitespace or newlines preceding the tag. HTH, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn |usr/local/bin/php /path/to/my/php/page.php;?> Still receive "Headers already sent". My eyes are completely fried -- anyone feel like saving my vision?| also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. |`------------------------------------------------------------'