[PHP] include_once behaves differently in mod_php4 vs php5-cgi

2005-11-30 Thread Toomas Aas
Hello! There's a website with a following structure index.php in the site's DocumentRoot directory (for this thread, let's call it /www) functions.php, init.php and db_connect.php in /www/library index.php includes line: include_once('library/functions.php'); functions.php includes lines:

[PHP] include_once changed behavior?

2004-06-07 Thread Mattias Thorslund
Hi, In order to keep configuration files outside the web root I use: include_once('../config.php'); This used to work also when running php scripts from the command line. Now I have a new server and I get no such file or directory when using this construct from the command line. I have worked

Re: [PHP] include_once changed behavior?

2004-06-07 Thread Jason Wong
On Tuesday 08 June 2004 03:21, Mattias Thorslund wrote: In order to keep configuration files outside the web root I use: include_once('../config.php'); This used to work also when running php scripts from the command line. Now I have a new server and I get no such file or directory when

Re: [PHP] include_once changed behavior?

2004-06-07 Thread Mattias Thorslund
Jason Wong wrote: On Tuesday 08 June 2004 03:21, Mattias Thorslund wrote: In order to keep configuration files outside the web root I use: include_once('../config.php'); This used to work also when running php scripts from the command line. Now I have a new server and I get no such file or

Re: [PHP] include_once changed behavior?

2004-06-07 Thread Marek Kilimajer
Mattias Thorslund wrote: Hi, In order to keep configuration files outside the web root I use: include_once('../config.php'); This used to work also when running php scripts from the command line. Now I have a new server and I get no such file or directory when using this construct from the

Re: [PHP] include_once changed behavior?

2004-06-07 Thread Marek Kilimajer
Marek Kilimajer wrote: Mattias Thorslund wrote: Hi, In order to keep configuration files outside the web root I use: include_once('../config.php'); This used to work also when running php scripts from the command line. Now I have a new server and I get no such file or directory when using this

Re: [PHP] include_once changed behavior?

2004-06-07 Thread Mattias Thorslund
Marek Kilimajer wrote: cli php uses path relative to your current directory, cgi php uses path relative to the executing script. That IS interesting. That would explain why: php /var/www/myproject/util/my-cli-script.php ... will break unless I execute it from that same directory. I used to be

Re: [PHP] include_once changed behavior?

2004-06-07 Thread Jason Wong
On Tuesday 08 June 2004 04:14, Mattias Thorslund wrote: What could be the difference that caused this? As Marek had pointed out the behaviour was changed ... Possibly: manual Using PHP from the command line -c switch ...except I don't use the -c switch? ... IIRC just after the

Re: [PHP] include_once changed behavior?

2004-06-07 Thread Mattias Thorslund
Jason Wong wrote: Possibly: manual Using PHP from the command line -c switch From the manual: The CLI SAPI does not change the current directory to the directory of the executed script! Note: The CGI SAPI supports the CLI SAPI behaviour by means of the -C switch when run from the command

Re: [PHP] include_once() isnt!

2004-02-07 Thread Adam Bregenzer
On Tue, 2004-02-03 at 17:04, Rob wrote: Ive programmed with C/C++ for years and have recently started to dabble in PHP. Ive written a multi-part script for a friend and Ive run into a problem. snip Heres where the problem lies. Each component is in a separate file, and when I run the script,

[PHP] include_once() isnt!

2004-02-03 Thread Rob
Ive programmed with C/C++ for years and have recently started to dabble in PHP. Ive written a multi-part script for a friend and Ive run into a problem. Ive got 14 include files 3 of which are basic components that may or may not be used by other components. One is an authorisation class, another

[PHP] include_once(blah); vs $blah=blah; include($blah);

2002-06-11 Thread Henry
My web hosting company is running php 4.0.4pl1 Why should it be that these are different ?php global $root; include_once(include\blah.php); ? and ?php global $root; $blah=include\blah.php; include_once($blah); ? When I say different I mean; 1) global variable are not avaiable in the

RE: [PHP] include_once(blah); vs $blah=blah; include($blah);

2002-06-11 Thread Jonathan Rosenberg
, June 11, 2002 8:15 AM To: [EMAIL PROTECTED] Subject: [PHP] include_once(blah); vs $blah=blah; include($blah); My web hosting company is running php 4.0.4pl1 Why should it be that these are different ?php global $root; include_once(include\blah.php); ? and ?php global $root

Re: [PHP] include_once(blah); vs $blah=blah; include($blah);

2002-06-11 Thread Henry
tly (i.e., no parens around the include file name). -Original Message- From: Henry [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 8:15 AM To: [EMAIL PROTECTED] Subject: [PHP] include_once(blah); vs $blah=blah; include($blah); My web hosting company is runn

RE: [PHP] include_once(blah); vs $blah=blah; include($blah);

2002-06-11 Thread Jonathan Rosenberg
: Re: [PHP] include_once(blah); vs $blah=blah; include($blah); I did as you suggest with an interesting result: include_once blah.php; worked var $blah=blah.php; include_once $blah; gave the following error: Parse error: parse error in including file on line line number Where

Re: [PHP] include_once(blah); vs $blah=blah; include($blah);

2002-06-11 Thread Henry
9:11 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] include_once(blah); vs $blah=blah; include($blah); I did as you suggest with an interesting result: include_once blah.php; worked var $blah=blah.php; include_once $blah; gave the following error: Parse error: par

RE: [PHP] include_once(blah); vs $blah=blah; include($blah);

2002-06-11 Thread Jonathan Rosenberg
comment. -Original Message- From: Henry [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 9:45 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] include_once(blah); vs $blah=blah; include($blah); No, the line number is just of the line in the includING file of the include_once

RE: [PHP] include_once(blah); vs $blah=blah; include($blah);

2002-06-11 Thread Martin Towell
blah.php; include_once $blah; ? see if it behaves differently (i.e., no parens around the include file name). -Original Message- From: Henry [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 11, 2002 8:15 AM To: [EMAIL PROTECTED] Subject: [PHP] include_once(blah); vs $blah=blah; inclu

Re: [PHP] include_once(blah); vs $blah=blah; include($blah);

2002-06-11 Thread Jim lucas
Message - From: Martin Towell [EMAIL PROTECTED] To: 'Henry' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, June 11, 2002 4:31 PM Subject: RE: [PHP] include_once(blah); vs $blah=blah; include($blah); if that's a direct copy of what you've got, then the parse error's probably to do with the var

[PHP] include_once()

2002-03-19 Thread Mauricio Cuenca
Hello, I have a very long script with several functions in it. I wanted to split the script into several files, so I created two sub-scripts and one main script. This is the code from the main script: ?php include_once(sub_script_1.php); incude_once(sub_script_2.php); $temp

Re: [PHP] include_once()

2002-03-19 Thread Neil Freeman
script. This is the code from the main script: ?php include_once(sub_script_1.php); incude_once(sub_script_2.php); $temp = MyFunction(); ? MyFunction() is contained in the file sub_script_1.php which is properly enclosed with valid PHP start and end tags. But When I try to run

Re: [PHP] include_once()

2002-03-19 Thread anders nawroth
Have you put ?php tags in your include-files? Anders - Ursprungligt meddelande - Från: Mauricio Cuenca [EMAIL PROTECTED] Till: [EMAIL PROTECTED] Skickat: den 19 mars 2002 17:43 Ämne: [PHP] include_once() Hello, I have a very long script with several functions in it. I wanted

Re: [PHP] include_once()

2002-03-19 Thread Mauricio Cuenca
] include_once() Have you put ?php tags in your include-files? Anders - Ursprungligt meddelande - Från: Mauricio Cuenca Till: Skickat: den 19 mars 2002 17:43 Ämne: [PHP] include_once() Hello, I have a very long script with several functions in it. I wanted to split

Re: [PHP] include_once()

2002-03-19 Thread Mauricio Cuenca
: Re: [PHP] include_once() Have you remembered to set up PHP's include_path to point to the area where your scripts are located? Neil Mauricio Cuenca wrote: Hello, I have a very long script with several functions in it. I wanted to split the script into several files, so I created

RE: [PHP] include_once()

2002-03-19 Thread Martin Towell
has an error (dunno if this is a php setting or it's default behaviour???) -Original Message- From: Mauricio Cuenca [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 20, 2002 11:14 AM To: anders nawroth; [EMAIL PROTECTED] Subject: Re: [PHP] include_once() Yes, I read the documentation

[PHP] include_once vs require_once

2001-07-31 Thread mike cullerton
hey folks, i'm wondering about the difference between include_once and require_once. the manual says The require_once() statement replaces itself with the specified file The include_once() statement includes and evaluates the specified file so, what is the difference? it's almost like

[PHP] include_once

2001-02-28 Thread Hardy Merrill
Redhat 6.1 Linux PHP 4.0.4pl1 Apache 1.3.14 Anyone using "include_once"? I'm executing a PHP script "A.php" by referring to it in my Netscape browser URL - script A.php does an include_once of "B.php" - B.php contains a database connect function that does a connect to an Oracle database. I

Re: [PHP] include_once

2001-02-28 Thread Hardy Merrill
Solved - I was changing a copy of the code that the webserver was NOT looking at. "include_once" works fine. Appologies. -- Hardy Merrill Mission Critical Linux, Inc. http://www.missioncriticallinux.com Hardy Merrill [[EMAIL PROTECTED]] wrote: Redhat 6.1 Linux PHP 4.0.4pl1 Apache 1.3.14