Re: [PHP] php cli question

2010-09-15 Thread Bostjan Skufca
Here are the results I got when question of migration from apache to nginx
was brought up:
http://blog.a2o.si/2009/06/24/apache-mod_php-compared-to-nginx-php-fpm/
(BTW there is some FPM in main PHP distribution now)

As for resource management, I recommend looking at php sources
(Zend/zend_alloca.c:zend_mm_shutdown() specifically) and building a custom
extension that frees discarded memory resources on your request or timer or
sth else. Not sure if it is possible like that but this is just a
suggestion, don't quote me on that :)
Also, for such questions I recommend you to join php-internals mailing list,
it seems more appropriate.

b.


On 15 September 2010 04:19, J Ravi Menon jravime...@gmail.com wrote:

 On Tue, Sep 14, 2010 at 1:15 PM, Per Jessen p...@computer.org wrote:
  J Ravi Menon wrote:
 
  On Tue, Sep 14, 2010 at 12:43 AM, Per Jessen p...@computer.org wrote:
  J Ravi Menon wrote:
 
  Few questions:
 
  1) Does opcode cache really matter in such cli-based daemons? As
  'SomeClass' is instantiated at every loop, I am assuming it is only
  compiled once as it has already been 'seen'.
 
  Yup.
 
  Just to clarify, you mean we don't need the op-code cache here right?
 
  That is correct.
 
  2) What about garbage collection? In a standard apache-mod-php
  setup, we rely on the end of a request-cycle to free up resources -
  close file descriptiors, free up memory etc..
  I am assuming in the aforesaid standalone daemon case, we would
  have to do this manually?
 
  Yes.
 
  So 'unset($some_big_array)'  or 'unset($some_big_object)' etc.. is the
  right way to go for non-resource based items? i.e. it needs to be
  explicitly done?
 
  It's not quite like C - if you reassign something, the previous contents
  are automagically freed.  I use unset() if I know it could be a while
  (hours) before it'll likely be reassigned, but it won't be used in the
  meantime.
 

 Thanks Per for clarifying this for me. Now on my follow up question:

 [Note: I think it is related to the issues discussed above hence
 keeping it on this thread but if I am violating any guidelines here,
 do let me know]

 One reason the aforesaid questions got triggered was that in our
 company right now, there is a big discussion on moving away from
 apache+mod_php solution to nginx+fast-cgi based model for handling all
 php-based services. The move seems to be more based some anecdotal
 observations and possibly not based on a typical php-based app (i.e.
 the php script involved was trivial one acting as some proxy to
 another backend service).

 I have written fast-cgi servers in the past in C++, and I am aware how
 the apahcefast-cgi-servers work (in unix socket setups).  All
 our php apps are written with apache+mod_php in mind (no explicit
 resource mgmt ), so this was a concern to me.

 If the same scripts now need to run 'forever' as a fastcgi server, are
 we forced to do such manual resource mgmt? Or are there solutions here
 that work just as in mod_php?

 This reminded me of the cli daemons that I had written earlier where
 such manual cleanups were done, and hence my doubts on this
 nginx+fast-cgi approach.

 thx,
 Ravi


 
 
  --
  Per Jessen, Zürich (14.6°C)
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] php cli question

2010-09-15 Thread J Ravi Menon
Thanks Bostjan for the suggestion. I did raise the issue and here is the reply:

http://news.php.net/php.internals/49672

Thx,
Ravi


On Wed, Sep 15, 2010 at 2:38 AM, Bostjan Skufca bost...@a2o.si wrote:
 Here are the results I got when question of migration from apache to nginx
 was brought up:
 http://blog.a2o.si/2009/06/24/apache-mod_php-compared-to-nginx-php-fpm/
 (BTW there is some FPM in main PHP distribution now)

 As for resource management, I recommend looking at php sources
 (Zend/zend_alloca.c:zend_mm_shutdown() specifically) and building a custom
 extension that frees discarded memory resources on your request or timer or
 sth else. Not sure if it is possible like that but this is just a
 suggestion, don't quote me on that :)
 Also, for such questions I recommend you to join php-internals mailing list,
 it seems more appropriate.

 b.


 On 15 September 2010 04:19, J Ravi Menon jravime...@gmail.com wrote:

 On Tue, Sep 14, 2010 at 1:15 PM, Per Jessen p...@computer.org wrote:
  J Ravi Menon wrote:
 
  On Tue, Sep 14, 2010 at 12:43 AM, Per Jessen p...@computer.org wrote:
  J Ravi Menon wrote:
 
  Few questions:
 
  1) Does opcode cache really matter in such cli-based daemons? As
  'SomeClass' is instantiated at every loop, I am assuming it is only
  compiled once as it has already been 'seen'.
 
  Yup.
 
  Just to clarify, you mean we don't need the op-code cache here right?
 
  That is correct.
 
  2) What about garbage collection? In a standard apache-mod-php
  setup, we rely on the end of a request-cycle to free up resources -
  close file descriptiors, free up memory etc..
  I am assuming in the aforesaid standalone daemon case, we would
  have to do this manually?
 
  Yes.
 
  So 'unset($some_big_array)'  or 'unset($some_big_object)' etc.. is the
  right way to go for non-resource based items? i.e. it needs to be
  explicitly done?
 
  It's not quite like C - if you reassign something, the previous contents
  are automagically freed.  I use unset() if I know it could be a while
  (hours) before it'll likely be reassigned, but it won't be used in the
  meantime.
 

 Thanks Per for clarifying this for me. Now on my follow up question:

 [Note: I think it is related to the issues discussed above hence
 keeping it on this thread but if I am violating any guidelines here,
 do let me know]

 One reason the aforesaid questions got triggered was that in our
 company right now, there is a big discussion on moving away from
 apache+mod_php solution to nginx+fast-cgi based model for handling all
 php-based services. The move seems to be more based some anecdotal
 observations and possibly not based on a typical php-based app (i.e.
 the php script involved was trivial one acting as some proxy to
 another backend service).

 I have written fast-cgi servers in the past in C++, and I am aware how
 the apahcefast-cgi-servers work (in unix socket setups).  All
 our php apps are written with apache+mod_php in mind (no explicit
 resource mgmt ), so this was a concern to me.

 If the same scripts now need to run 'forever' as a fastcgi server, are
 we forced to do such manual resource mgmt? Or are there solutions here
 that work just as in mod_php?

 This reminded me of the cli daemons that I had written earlier where
 such manual cleanups were done, and hence my doubts on this
 nginx+fast-cgi approach.

 thx,
 Ravi


 
 
  --
  Per Jessen, Zürich (14.6°C)
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php cli question

2010-09-14 Thread Per Jessen
J Ravi Menon wrote:

 Few questions:
 
 1) Does opcode cache really matter in such cli-based daemons? As
 'SomeClass' is instantiated at every loop, I am assuming it is only
 compiled once as it has already been 'seen'.

Yup.

 2) What about garbage collection? In a standard apache-mod-php setup,
 we rely on the end of a request-cycle to free up resources - close
 file descriptiors, free up memory etc..
 I am assuming in the aforesaid standalone daemon case, we would
 have to do this manually?  

Yes.

 Note: I have written pre-forker deamons in php directly and
 successfully deployed them in the past, but never looked at in depth
 to understand all the nuances. Anecdotally, I have
 done 'unset()' at some critical places were large arrays were used,
 and I think it helped. AFAIK, unlike Java, there is no 'garbage
 collector' thread that does all the magic?

Correct.



-- 
Per Jessen, Zürich (12.9°C)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php cli question

2010-09-14 Thread J Ravi Menon
On Tue, Sep 14, 2010 at 12:43 AM, Per Jessen p...@computer.org wrote:
 J Ravi Menon wrote:

 Few questions:

 1) Does opcode cache really matter in such cli-based daemons? As
 'SomeClass' is instantiated at every loop, I am assuming it is only
 compiled once as it has already been 'seen'.

 Yup.

Just to clarify, you mean we don't need the op-code cache here right?



 2) What about garbage collection? In a standard apache-mod-php setup,
 we rely on the end of a request-cycle to free up resources - close
 file descriptiors, free up memory etc..
     I am assuming in the aforesaid standalone daemon case, we would
 have to do this manually?

 Yes.


So 'unset($some_big_array)'  or 'unset($some_big_object)' etc.. is the
right way to go for non-resource based items? i.e. it needs to be
explicitly done?

thx,
Ravi



 Note: I have written pre-forker deamons in php directly and
 successfully deployed them in the past, but never looked at in depth
 to understand all the nuances. Anecdotally, I have
 done 'unset()' at some critical places were large arrays were used,
 and I think it helped. AFAIK, unlike Java, there is no 'garbage
 collector' thread that does all the magic?

 Correct.



 --
 Per Jessen, Zürich (12.9°C)


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php cli question

2010-09-14 Thread Per Jessen
J Ravi Menon wrote:

 On Tue, Sep 14, 2010 at 12:43 AM, Per Jessen p...@computer.org wrote:
 J Ravi Menon wrote:

 Few questions:

 1) Does opcode cache really matter in such cli-based daemons? As
 'SomeClass' is instantiated at every loop, I am assuming it is only
 compiled once as it has already been 'seen'.

 Yup.
 
 Just to clarify, you mean we don't need the op-code cache here right?

That is correct.

 2) What about garbage collection? In a standard apache-mod-php
 setup, we rely on the end of a request-cycle to free up resources -
 close file descriptiors, free up memory etc..
 I am assuming in the aforesaid standalone daemon case, we would
 have to do this manually?

 Yes.
 
 So 'unset($some_big_array)'  or 'unset($some_big_object)' etc.. is the
 right way to go for non-resource based items? i.e. it needs to be
 explicitly done?

It's not quite like C - if you reassign something, the previous contents
are automagically freed.  I use unset() if I know it could be a while
(hours) before it'll likely be reassigned, but it won't be used in the
meantime. 



-- 
Per Jessen, Zürich (14.6°C)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php cli question

2010-09-14 Thread Nathan Rixham

Per Jessen wrote:

J Ravi Menon wrote:

2) What about garbage collection? In a standard apache-mod-php
setup, we rely on the end of a request-cycle to free up resources -
close file descriptiors, free up memory etc..
I am assuming in the aforesaid standalone daemon case, we would
have to do this manually?

Yes.

So 'unset($some_big_array)'  or 'unset($some_big_object)' etc.. is the
right way to go for non-resource based items? i.e. it needs to be
explicitly done?


It's not quite like C - if you reassign something, the previous contents
are automagically freed.  I use unset() if I know it could be a while
(hours) before it'll likely be reassigned, but it won't be used in the
meantime. 


Has anybody done a comparison of setting to null rather than unset'ing; 
does unset invoke the garbage collector instantly? i.e. is unset the 
best approach to clearing objects from memory quickly?


Best,

Nathan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] php cli question

2010-09-14 Thread J Ravi Menon
On Tue, Sep 14, 2010 at 1:15 PM, Per Jessen p...@computer.org wrote:
 J Ravi Menon wrote:

 On Tue, Sep 14, 2010 at 12:43 AM, Per Jessen p...@computer.org wrote:
 J Ravi Menon wrote:

 Few questions:

 1) Does opcode cache really matter in such cli-based daemons? As
 'SomeClass' is instantiated at every loop, I am assuming it is only
 compiled once as it has already been 'seen'.

 Yup.

 Just to clarify, you mean we don't need the op-code cache here right?

 That is correct.

 2) What about garbage collection? In a standard apache-mod-php
 setup, we rely on the end of a request-cycle to free up resources -
 close file descriptiors, free up memory etc..
 I am assuming in the aforesaid standalone daemon case, we would
 have to do this manually?

 Yes.

 So 'unset($some_big_array)'  or 'unset($some_big_object)' etc.. is the
 right way to go for non-resource based items? i.e. it needs to be
 explicitly done?

 It's not quite like C - if you reassign something, the previous contents
 are automagically freed.  I use unset() if I know it could be a while
 (hours) before it'll likely be reassigned, but it won't be used in the
 meantime.


Thanks Per for clarifying this for me. Now on my follow up question:

[Note: I think it is related to the issues discussed above hence
keeping it on this thread but if I am violating any guidelines here,
do let me know]

One reason the aforesaid questions got triggered was that in our
company right now, there is a big discussion on moving away from
apache+mod_php solution to nginx+fast-cgi based model for handling all
php-based services. The move seems to be more based some anecdotal
observations and possibly not based on a typical php-based app (i.e.
the php script involved was trivial one acting as some proxy to
another backend service).

I have written fast-cgi servers in the past in C++, and I am aware how
the apahcefast-cgi-servers work (in unix socket setups).  All
our php apps are written with apache+mod_php in mind (no explicit
resource mgmt ), so this was a concern to me.

If the same scripts now need to run 'forever' as a fastcgi server, are
we forced to do such manual resource mgmt? Or are there solutions here
that work just as in mod_php?

This reminded me of the cli daemons that I had written earlier where
such manual cleanups were done, and hence my doubts on this
nginx+fast-cgi approach.

thx,
Ravi




 --
 Per Jessen, Zürich (14.6°C)


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP CLI question

2003-06-06 Thread Monte Ohrt
Hi,

A couple of questions:

1) Is there a way to make the CLI version of PHP ignore certain settings
in the php.ini file? For instance, I don't want the ioncube accelerator
invoked when using PHP from the command line. My current work around is
to use two separate init files, php.ini and php-cli.ini ... and this
brings me to my second question:

2) Is there a way to specify a different name for the php.ini file,
apart from hacking php_ini.c ? It seems I can only change the _path_ to
the file, but not the filename itself.

TIA
Monte



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP CLI question

2003-06-06 Thread Cal Evans
http://www.php.net/manual/en/function.ini-set.php

* Cal Evans
* http://www.christianperformer.com
* Stay plugged into your audience
* The measure of a programmer is not the number of lines of code he writes
but the number of lines he does not have to write.
*

- Original Message -
From: Monte Ohrt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 9:22 AM
Subject: [PHP] PHP CLI question


 Hi,

 A couple of questions:

 1) Is there a way to make the CLI version of PHP ignore certain settings
 in the php.ini file? For instance, I don't want the ioncube accelerator
 invoked when using PHP from the command line. My current work around is
 to use two separate init files, php.ini and php-cli.ini ... and this
 brings me to my second question:

 2) Is there a way to specify a different name for the php.ini file,
 apart from hacking php_ini.c ? It seems I can only change the _path_ to
 the file, but not the filename itself.

 TIA
 Monte



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP CLI question

2003-06-06 Thread Monte Ohrt
Hi Cal,

I may be missing something, but I don't see how this page answers either
of my questions. ini_set() is for setting configuration options.

Monte

On Thu, 2003-06-05 at 09:23, Cal Evans wrote:
 http://www.php.net/manual/en/function.ini-set.php
 
 * Cal Evans
 * http://www.christianperformer.com
 * Stay plugged into your audience
 * The measure of a programmer is not the number of lines of code he writes
 but the number of lines he does not have to write.
 *
 
 - Original Message -
 From: Monte Ohrt [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, June 05, 2003 9:22 AM
 Subject: [PHP] PHP CLI question
 
 
  Hi,
 
  A couple of questions:
 
  1) Is there a way to make the CLI version of PHP ignore certain settings
  in the php.ini file? For instance, I don't want the ioncube accelerator
  invoked when using PHP from the command line. My current work around is
  to use two separate init files, php.ini and php-cli.ini ... and this
  brings me to my second question:
 
  2) Is there a way to specify a different name for the php.ini file,
  apart from hacking php_ini.c ? It seems I can only change the _path_ to
  the file, but not the filename itself.
 
  TIA
  Monte
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP CLI question

2003-06-06 Thread Adam Voigt
From a ./php -h:

 -c path|file Look for php.ini file in this directory

The | means OR, so logic would dictate you can point
directly to the file with the -c option.


On Thu, 2003-06-05 at 10:35, Monte Ohrt wrote:
 Hi Cal,
 
 I may be missing something, but I don't see how this page answers either
 of my questions. ini_set() is for setting configuration options.
 
 Monte
 
 On Thu, 2003-06-05 at 09:23, Cal Evans wrote:
  http://www.php.net/manual/en/function.ini-set.php
  
  * Cal Evans
  * http://www.christianperformer.com
  * Stay plugged into your audience
  * The measure of a programmer is not the number of lines of code he writes
  but the number of lines he does not have to write.
  *
  
  - Original Message -
  From: Monte Ohrt [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Sent: Thursday, June 05, 2003 9:22 AM
  Subject: [PHP] PHP CLI question
  
  
   Hi,
  
   A couple of questions:
  
   1) Is there a way to make the CLI version of PHP ignore certain settings
   in the php.ini file? For instance, I don't want the ioncube accelerator
   invoked when using PHP from the command line. My current work around is
   to use two separate init files, php.ini and php-cli.ini ... and this
   brings me to my second question:
  
   2) Is there a way to specify a different name for the php.ini file,
   apart from hacking php_ini.c ? It seems I can only change the _path_ to
   the file, but not the filename itself.
  
   TIA
   Monte
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP CLI question

2003-06-06 Thread Monte Ohrt
Hi Adam,

I know it can be altered with a command-line switch, but it is the
default that I want to change. I don't want to have to remember to set
the -c flag everytime, or go back and change all my existing scripts.

Monte

On Thu, 2003-06-05 at 09:53, Adam Voigt wrote:
 From a ./php -h:
 
  -c path|file Look for php.ini file in this directory
 
 The | means OR, so logic would dictate you can point
 directly to the file with the -c option.
 
 
 On Thu, 2003-06-05 at 10:35, Monte Ohrt wrote:
  Hi Cal,
  
  I may be missing something, but I don't see how this page answers either
  of my questions. ini_set() is for setting configuration options.
  
  Monte
  
  On Thu, 2003-06-05 at 09:23, Cal Evans wrote:
   http://www.php.net/manual/en/function.ini-set.php
   
   * Cal Evans
   * http://www.christianperformer.com
   * Stay plugged into your audience
   * The measure of a programmer is not the number of lines of code he writes
   but the number of lines he does not have to write.
   *
   
   - Original Message -
   From: Monte Ohrt [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Cc: [EMAIL PROTECTED]
   Sent: Thursday, June 05, 2003 9:22 AM
   Subject: [PHP] PHP CLI question
   
   
Hi,
   
A couple of questions:
   
1) Is there a way to make the CLI version of PHP ignore certain settings
in the php.ini file? For instance, I don't want the ioncube accelerator
invoked when using PHP from the command line. My current work around is
to use two separate init files, php.ini and php-cli.ini ... and this
brings me to my second question:
   
2) Is there a way to specify a different name for the php.ini file,
apart from hacking php_ini.c ? It seems I can only change the _path_ to
the file, but not the filename itself.
   
TIA
Monte
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
   
-- 
Monte Ohrt [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP CLI question

2003-06-06 Thread Mark
Wrap it in a shell script or batch file. 

Something like:

REM ---Start cli.bat---
./cli/php.exe -c cli-php.ini location %1 %2 %3 %4 %5 %6 %7 %8 %9
@exit
REM ---End cli.bat---


--- Monte Ohrt [EMAIL PROTECTED] wrote:
 Hi Adam,
 
 I know it can be altered with a command-line switch, but it is the
 default that I want to change. I don't want to have to remember to
 set
 the -c flag everytime, or go back and change all my existing
 scripts.
 
 Monte
 
 On Thu, 2003-06-05 at 09:53, Adam Voigt wrote:
  From a ./php -h:
  
   -c path|file Look for php.ini file in this directory
  
  The | means OR, so logic would dictate you can point
  directly to the file with the -c option.
  
  
  On Thu, 2003-06-05 at 10:35, Monte Ohrt wrote:
   Hi Cal,
   
   I may be missing something, but I don't see how this page
 answers either
   of my questions. ini_set() is for setting configuration
 options.
   
   Monte
   
   On Thu, 2003-06-05 at 09:23, Cal Evans wrote:
http://www.php.net/manual/en/function.ini-set.php

* Cal Evans
* http://www.christianperformer.com
* Stay plugged into your audience
* The measure of a programmer is not the number of lines of
 code he writes
but the number of lines he does not have to write.
*

- Original Message -
From: Monte Ohrt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 9:22 AM
Subject: [PHP] PHP CLI question


 Hi,

 A couple of questions:

 1) Is there a way to make the CLI version of PHP ignore
 certain settings
 in the php.ini file? For instance, I don't want the ioncube
 accelerator
 invoked when using PHP from the command line. My current
 work around is
 to use two separate init files, php.ini and php-cli.ini ...
 and this
 brings me to my second question:

 2) Is there a way to specify a different name for the
 php.ini file,
 apart from hacking php_ini.c ? It seems I can only change
 the _path_ to
 the file, but not the filename itself.

 TIA
 Monte



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


 -- 
 Monte Ohrt [EMAIL PROTECTED]
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP CLI question

2003-06-06 Thread Monte Ohrt
ok, so there are plenty of ways to work around it ;-) I guess my
original question should be answered as such? No, you cannot specify a
different configuration file name other than php.ini, you must either
hack the C code or supply a workaround at runtime.

Monte

On Thu, 2003-06-05 at 15:07, Mark wrote:
 Wrap it in a shell script or batch file. 
 
 Something like:
 
 REM ---Start cli.bat---
 ./cli/php.exe -c cli-php.ini location %1 %2 %3 %4 %5 %6 %7 %8 %9
 @exit
 REM ---End cli.bat---
 
 
 --- Monte Ohrt [EMAIL PROTECTED] wrote:
  Hi Adam,
  
  I know it can be altered with a command-line switch, but it is the
  default that I want to change. I don't want to have to remember to
  set
  the -c flag everytime, or go back and change all my existing
  scripts.
  
  Monte
  
  On Thu, 2003-06-05 at 09:53, Adam Voigt wrote:
   From a ./php -h:
   
-c path|file Look for php.ini file in this directory
   
   The | means OR, so logic would dictate you can point
   directly to the file with the -c option.
   
   
   On Thu, 2003-06-05 at 10:35, Monte Ohrt wrote:
Hi Cal,

I may be missing something, but I don't see how this page
  answers either
of my questions. ini_set() is for setting configuration
  options.

Monte

On Thu, 2003-06-05 at 09:23, Cal Evans wrote:
 http://www.php.net/manual/en/function.ini-set.php
 
 * Cal Evans
 * http://www.christianperformer.com
 * Stay plugged into your audience
 * The measure of a programmer is not the number of lines of
  code he writes
 but the number of lines he does not have to write.
 *
 
 - Original Message -
 From: Monte Ohrt [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, June 05, 2003 9:22 AM
 Subject: [PHP] PHP CLI question
 
 
  Hi,
 
  A couple of questions:
 
  1) Is there a way to make the CLI version of PHP ignore
  certain settings
  in the php.ini file? For instance, I don't want the ioncube
  accelerator
  invoked when using PHP from the command line. My current
  work around is
  to use two separate init files, php.ini and php-cli.ini ...
  and this
  brings me to my second question:
 
  2) Is there a way to specify a different name for the
  php.ini file,
  apart from hacking php_ini.c ? It seems I can only change
  the _path_ to
  the file, but not the filename itself.
 
  TIA
  Monte
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  -- 
  Monte Ohrt [EMAIL PROTECTED]
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
 =
 Mark Weinstock
 [EMAIL PROTECTED]
 ***
 You can't demand something as a right unless you are willing to fight to death to 
 defend everyone else's right to the same thing.
 ***
 
 __
 Do you Yahoo!?
 Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
 http://calendar.yahoo.com
-- 
Monte Ohrt [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP CLI question

2003-06-06 Thread Marek Kilimajer
Or as Jason noted at compile time.

Monte Ohrt wrote:
ok, so there are plenty of ways to work around it ;-) I guess my
original question should be answered as such? No, you cannot specify a
different configuration file name other than php.ini, you must either
hack the C code or supply a workaround at runtime.
Monte

On Thu, 2003-06-05 at 15:07, Mark wrote:

Wrap it in a shell script or batch file. 

Something like:

REM ---Start cli.bat---
./cli/php.exe -c cli-php.ini location %1 %2 %3 %4 %5 %6 %7 %8 %9
@exit
REM ---End cli.bat---
--- Monte Ohrt [EMAIL PROTECTED] wrote:

Hi Adam,

I know it can be altered with a command-line switch, but it is the
default that I want to change. I don't want to have to remember to
set
the -c flag everytime, or go back and change all my existing
scripts.
Monte

On Thu, 2003-06-05 at 09:53, Adam Voigt wrote:

From a ./php -h:
-c path|file Look for php.ini file in this directory

The | means OR, so logic would dictate you can point
directly to the file with the -c option.
On Thu, 2003-06-05 at 10:35, Monte Ohrt wrote:

Hi Cal,

I may be missing something, but I don't see how this page
answers either

of my questions. ini_set() is for setting configuration
options.

Monte

On Thu, 2003-06-05 at 09:23, Cal Evans wrote:

http://www.php.net/manual/en/function.ini-set.php

* Cal Evans
* http://www.christianperformer.com
* Stay plugged into your audience
* The measure of a programmer is not the number of lines of
code he writes

but the number of lines he does not have to write.
*
- Original Message -
From: Monte Ohrt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 9:22 AM
Subject: [PHP] PHP CLI question


Hi,

A couple of questions:

1) Is there a way to make the CLI version of PHP ignore
certain settings

in the php.ini file? For instance, I don't want the ioncube
accelerator

invoked when using PHP from the command line. My current
work around is

to use two separate init files, php.ini and php-cli.ini ...
and this

brings me to my second question:

2) Is there a way to specify a different name for the
php.ini file,

apart from hacking php_ini.c ? It seems I can only change
the _path_ to

the file, but not the filename itself.

TIA
Monte


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
Monte Ohrt [EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***
__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php