FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » FUDforum Installation Issues » nntp.php & register_argc_argv off
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
nntp.php & register_argc_argv off [message #6125] Wed, 02 October 2002 17:00 Go to next message
valiant is currently offline  valiant   Switzerland
Messages: 80
Registered: September 2002
Location: Zurich
Karma: 0
Member
Hi

I'm trying to run nntp.php in the shell.
As I'm not the httpd user I copied the file to nntp_1.php which is chmoded 777.
I execute it with:
./nntp_1.php 2

I get fallowing error:

PHP Notice: Undefined index: argc in /home/andress/fudforum/scripts/nntp_1.php on line 22
<br />
<b>Notice</b>: Undefined index: argc in <b>/home/andress/fudforum/scripts/nntp_1.php</b> on line <b>22</b></br />
Missing Forum ID Paramater


register_globals is on
register_argc_argv is off
PHP 4.22

I've traced the error and it's the first if statement:

if( $HTTP_SERVER_VARS['argc'] < 2 ) exit("Missing Forum ID Paramater\n");


I changed it to:

if( $_SERVER['argc'] < 2 ) exit("Missing Forum ID Paramater\n");


But that didn't help.

I've tested if there's anything in argv[0], but it's empty.

Could you help me please?

Thanks - Andy
Re: nntp.php & register_argc_argv off [message #6126 is a reply to message #6125] Wed, 02 October 2002 17:21 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Your problem lies in the fact you got 'register_argc_argv' off, you need to turn them on.

FUDforum Core Developer
Re: nntp.php & register_argc_argv off [message #6127 is a reply to message #6126] Wed, 02 October 2002 17:28 Go to previous messageGo to next message
valiant is currently offline  valiant   Switzerland
Messages: 80
Registered: September 2002
Location: Zurich
Karma: 0
Member
Sure?
Is there no workaround as with the register_globals?

Anyway, I'm requesting that...Thanks - Andy
Re: nntp.php & register_argc_argv off [message #6134 is a reply to message #6127] Wed, 02 October 2002 22:15 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
I'll take a look into it.

FUDforum Core Developer
Re: nntp.php & register_argc_argv off [message #6151 is a reply to message #6125] Fri, 04 October 2002 00:54 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Fixed in CVS.

FUDforum Core Developer
Re: nntp.php & register_argc_argv off [message #6163 is a reply to message #6151] Fri, 04 October 2002 12:58 Go to previous messageGo to next message
valiant is currently offline  valiant   Switzerland
Messages: 80
Registered: September 2002
Location: Zurich
Karma: 0
Member
hmm, thanks but it dind't work for me.

my admin won't activeate register_argc_argv but there's a workaround.

i'm gonna use my own php.ini for command line.

#!/usr/sepp/bin/php -c /path/to/.php.ini

not yet tested, but should work...
Re: nntp.php & register_argc_argv off [message #6165 is a reply to message #6163] Fri, 04 October 2002 13:58 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Really? now that's unusual register_argv_argc is something that you can set via ini_set(), which is exactly what the script does.

FUDforum Core Developer
Re: nntp.php & register_argc_argv off [message #6172 is a reply to message #6165] Fri, 04 October 2002 16:03 Go to previous messageGo to next message
valiant is currently offline  valiant   Switzerland
Messages: 80
Registered: September 2002
Location: Zurich
Karma: 0
Member
tested it your-self on a register_argc_argv off setup?

i'm still getting the same "Missing Forum ID Parameter" message and yes, i'm calling the script with a parameter (>./nntp_1.php 2).
Re: nntp.php & register_argc_argv off [message #6178 is a reply to message #6172] Fri, 04 October 2002 18:50 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Well, I am using latest CVS, where this option has no affect @ all Razz

You can try this:

#!/usr/local/bin/php -w register_argc_argv=1

this may do the trick.


FUDforum Core Developer
Re: nntp.php & register_argc_argv off [message #6180 is a reply to message #6178] Fri, 04 October 2002 22:04 Go to previous messageGo to next message
valiant is currently offline  valiant   Switzerland
Messages: 80
Registered: September 2002
Location: Zurich
Karma: 0
Member
i didn't test the thing with the custom php.ini file.

#!/usr/local/bin/php -w register_argc_argv=1

didn't work as well.

i've tried the script with hardcoded values (, without argv, ) and i got a undefined function call in nntp.inc.
don't look at it. i'm going to study the whole thing in the next few days. i'm just too tired at the moment, after my yearly exams...

good night - andy
Re: nntp.php & register_argc_argv off [message #6188 is a reply to message #6180] Sat, 05 October 2002 13:13 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
What PHP version are you using?

FUDforum Core Developer
Re: nntp.php & register_argc_argv off [message #6193 is a reply to message #6188] Sat, 05 October 2002 15:22 Go to previous messageGo to next message
valiant is currently offline  valiant   Switzerland
Messages: 80
Registered: September 2002
Location: Zurich
Karma: 0
Member
System Configuration
PHP built On: SunOS drwho 5.8 Generic_108528-15 sun4u sparc SUNW,Ultra-80
MySQL Version: 3.23.47
PHP Version: 4.2.2
Web Server: Apache/1.3.26 (Unix) ApacheJServ/1.1.2 PHP/4.2.2 mod_ssl/2.8.10 OpenSSL/0.9.6d
WebServer to PHP interface: apache
Forum Version: 2.3.2RC3
Relavent PHP Settings: Safe Mode: ON
Display Errors: ON
File Uploads: ON
Magic Quotes: OFF
Register Globals: ON
Output Buffering: ON
Disabled Functions: none
PSpell Support: No

Re: nntp.php & register_argc_argv off [message #6196 is a reply to message #6193] Sat, 05 October 2002 15:38 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You are showing me the version of your webservers's PHP, the binary is different and quite possibly a different version.

To get the binaries version do:

php -v


FUDforum Core Developer
Re: nntp.php & register_argc_argv off [message #6208 is a reply to message #6196] Sat, 05 October 2002 19:53 Go to previous messageGo to next message
valiant is currently offline  valiant   Switzerland
Messages: 80
Registered: September 2002
Location: Zurich
Karma: 0
Member
the binary is version 4.2.2 too...
Re: nntp.php & register_argc_argv off [message #6255 is a reply to message #6208] Sun, 06 October 2002 22:50 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Seems like a possible php bug to me. The -w option should've turned them on, the fact it didn't implies some sort of a problem with PHP.

FUDforum Core Developer
Re: nntp.php & register_argc_argv off [message #6315 is a reply to message #6163] Tue, 08 October 2002 01:24 Go to previous messageGo to next message
valiant is currently offline  valiant   Switzerland
Messages: 80
Registered: September 2002
Location: Zurich
Karma: 0
Member
Actually that seems to work.

I've set up a personal php.ini with register_argc_argv on and called it with
php -q -c /path/to/my/php.ini

and now I get some error messages as "can't set time limit in safe mode".
Do I have to disable safe mode for the nntp.php script and how do you do that?

Thanks again - Andy
Re: nntp.php & register_argc_argv off [message #6316 is a reply to message #6315] Tue, 08 October 2002 02:05 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
to disable safe_mode simply set it to off in php.ini

safe_mode = Off


FUDforum Core Developer
Re: nntp.php & register_argc_argv off [message #6320 is a reply to message #6316] Tue, 08 October 2002 10:55 Go to previous messageGo to next message
valiant is currently offline  valiant   Switzerland
Messages: 80
Registered: September 2002
Location: Zurich
Karma: 0
Member
tried that one, but didn't work.
still showing the same errors...
Re: nntp.php & register_argc_argv off [message #6321 is a reply to message #6316] Tue, 08 October 2002 11:25 Go to previous messageGo to next message
valiant is currently offline  valiant   Switzerland
Messages: 80
Registered: September 2002
Location: Zurich
Karma: 0
Member
you suggested running the script with fallowing option:
#!/usr/local/bin/php -w register_argc_argv=1


actually it was
#!/usr/local/bin/php -d register_argc_argv=1

option -w in php version is for "Display source with stripped comments and whitespace."
now I get an error on line 443 of nntp.inc.
call to undefined function: nlb2r()


now i'm searching the function as it is used in an if else clause on line 443...
Re: nntp.php & register_argc_argv off [message #6322 is a reply to message #6125] Tue, 08 October 2002 12:04 Go to previous messageGo to next message
valiant is currently offline  valiant   Switzerland
Messages: 80
Registered: September 2002
Location: Zurich
Karma: 0
Member
strange, now i don't get the nlb2r() error but a few other undefined functions.

i had to add fallowing lines to nntp.php:

fud_use('fileio.inc');
fud_use('drawmsg.inc');
fud_use('alt_var.inc');



i guess the argc_argv problem is solved.

thanks! - andy
Re: nntp.php & register_argc_argv off [message #6326 is a reply to message #6322] Tue, 08 October 2002 12:39 Go to previous message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
Good catch, those were indeed bugs, they are now fixed.

FUDforum Core Developer
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How do i create a DataBase?
Next Topic: can't run Rebuild Theme:(
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Dec 12 14:16:57 GMT 2024

Total time taken to generate the page: 0.04957 seconds