f



where is php.ini for the PHP CLI binary?

#!/bin/php
<?php
echo "hello, world!";
?>

That produces the following:

PHP Warning:  Directive 'register_globals' is deprecated in PHP 5.3
and greater in Unknown on line 0
PHP Warning:  Directive 'register_long_arrays' is deprecated in PHP
5.3 and greater in Unknown on line 0
hello, world!

I'd like to update my php.ini file to make those errors go away but
don't know where it is.  Any ideas as to how I could go about finding
it?
0
terra1024 (490)
8/13/2010 7:27:12 PM
comp.lang.php 32646 articles. 0 followers. Post Follow

6 Replies
2481 Views

Similar Articles

[PageSpeed] 0

yawnmoth wrote:
> #!/bin/php
> <?php
> echo "hello, world!";
> ?>
> 
> That produces the following:
> 
> PHP Warning:  Directive 'register_globals' is deprecated in PHP 5.3
> and greater in Unknown on line 0
> PHP Warning:  Directive 'register_long_arrays' is deprecated in PHP
> 5.3 and greater in Unknown on line 0
> hello, world!
> 
> I'd like to update my php.ini file to make those errors go away but
> don't know where it is.  Any ideas as to how I could go about finding
> it?

It is/should be in the root directory where your index.php document is 
stored. Check with your ISP to confirm that the file is named php.ini. 
Mine, for example, is named php5.ini, and everything failed miserably 
before I properly named it.

Do you have #!bin/php in the [pagename].php document? Try removing it.

Bill B
0
me4 (19624)
8/13/2010 7:44:39 PM
yawnmoth wrote:
> #!/bin/php
> <?php
> echo "hello, world!";
> ?>
> 
> That produces the following:
> 
> PHP Warning:  Directive 'register_globals' is deprecated in PHP 5.3
> and greater in Unknown on line 0
> PHP Warning:  Directive 'register_long_arrays' is deprecated in PHP
> 5.3 and greater in Unknown on line 0
> hello, world!
> 
> I'd like to update my php.ini file to make those errors go away but
> don't know where it is.  Any ideas as to how I could go about finding
> it?

#!/bin/php
<?php
phpinfo();
?>

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
jstucklex (14659)
8/13/2010 7:59:12 PM
On Aug 13, 3:44=A0pm, Bill Braun <m...@privacy.net> wrote:
> yawnmoth wrote:
> > #!/bin/php
> > <?php
> > echo "hello, world!";
> > ?>
>
> > That produces the following:
>
> > PHP Warning: =A0Directive 'register_globals' is deprecated in PHP 5.3
> > and greater in Unknown on line 0
> > PHP Warning: =A0Directive 'register_long_arrays' is deprecated in PHP
> > 5.3 and greater in Unknown on line 0
> > hello, world!
>
> > I'd like to update my php.ini file to make those errors go away but
> > don't know where it is. =A0Any ideas as to how I could go about finding
> > it?
>
> It is/should be in the root directory where your index.php document is
> stored. Check with your ISP to confirm that the file is named php.ini.
> Mine, for example, is named php5.ini, and everything failed miserably
> before I properly named it.
>
> Do you have #!bin/php in the [pagename].php document? Try removing it.

Man, there's a lot of wrong things in this post...

0
8/15/2010 5:36:09 AM
Op 13-08-10 21:59, Jerry Stuckle schreef:
> yawnmoth wrote:
>> #!/bin/php
>> <?php
>> echo "hello, world!";
>> ?>
>>
>> That produces the following:
>>
>> PHP Warning: Directive 'register_globals' is deprecated in PHP 5.3
>> and greater in Unknown on line 0
>> PHP Warning: Directive 'register_long_arrays' is deprecated in PHP
>> 5.3 and greater in Unknown on line 0
>> hello, world!
>>
>> I'd like to update my php.ini file to make those errors go away but
>> don't know where it is. Any ideas as to how I could go about finding
>> it?
>
> #!/bin/php
> <?php
> phpinfo();
> ?>
>

$> php -r "phpinfo();" | grep php.ini

or

C:\> php -r "phpinfo();" | findstr /i "php.ini"

-- 
Luuk
0
luuk (890)
8/15/2010 3:13:34 PM
On Fri, 13 Aug 2010 12:27:12 -0700, yawnmoth wrote:
> #!/bin/php
> <?php
> echo "hello, world!";
> ?>
[snip]
> I'd like to update my php.ini file to make those errors go away but
> don't know where it is.  Any ideas as to how I could go about finding
> it?

Besides the other options already provided, a reasonably recent version 
of PHP will also let you execute "/bin/php --ini" to get a list of the 
loaded INI files.

Adam
0
usenet2123 (14)
8/16/2010 3:25:36 AM
On 13 Aug, 20:44, Bill Braun <m...@privacy.net> wrote:
> It is/should be in the root directory where your index.php document is
> stored.
Not usually no! Besides this post is specifically about the CLI!!

> Check with your ISP to confirm that the file is named php.ini.
An ISP supplies a connection to the internet, not hosting!!!

0
Captain
8/16/2010 10:45:29 AM
Reply: