php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #20411 argc, argv and CLI
Submitted: 2002-11-13 10:20 UTC Modified: 2002-11-14 05:25 UTC
From: firmolari at terra dot es Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.2.3 OS: Solaris 2.8
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: firmolari at terra dot es
New email:
PHP Version: OS:

 

 [2002-11-13 10:20 UTC] firmolari at terra dot es
I?ve installed PHP 4.2.3 in Solaris 2.8 with the ldap funntions

That?s it.

./configure --with-ldap

Everything works fine except the variables $argc and $argv. They don?t work.

If you use

echo "Value of ARGC = $argc"; it doesn?t work.

I?ve sured myself that the register_argc_argv varible is set to "1".

That?s a bug from this version. My previous version intalled was PHP 4.1.1 (without LDAP) and work ok both variables.


EXAMPLE:


<?php
// File: bug.php

echo "The value is $argc";

?>

Command:
>php bug.php 123

RESULT:
The value is

------------------------

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-13 12:03 UTC] derick@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip
 [2002-11-13 12:15 UTC] sniper@php.net
In PHP 4.2.0, the 'register_globals' setting default changed to
'off'. See http://www.php.net/release_4_2_0.php for more info.
We are sorry about the inconvenience, but this change was a necessary
part of our efforts to make PHP scripting more secure and portable.
 [2002-11-13 14:26 UTC] philip@php.net
In CLI, register_globals doesn't affect this anymore, right?  Please share the history of this so it can be fully documented.  Currently the docs say they will exist regardless.

Changing to doc problem :-))
 [2002-11-14 02:48 UTC] firmolari at terra dot es
That?s OK. Sorry, as Philip said, it was a documentation problem. That?s because I updated from PHP 4.1.1, to PHP 4.2.3.

Thanks.
 [2002-11-14 05:25 UTC] philip@php.net
Thanks for the report, this is now documented.  In CLI $argc and $argv exist as of PHP 4.3.0 no matter the register_globals setting.  In CGI register_globals still applies.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Aug 06 00:00:02 2025 UTC