Re: [PHP] what's wrong with this php system

2011-08-07 Thread Sharl.Jimh.Tsin
在 2011-08-08一的 14:30 +0800,smith jack写道:
> I have installed a php system on my pc, it works well, except the head
> of the page is a bit strange, there is some warning information, and
> occupies lot of space,
> what's wrong,  the error information is as follows:
> Warning: Parameter 1 to Notice::onPrint() expected to be a reference,
> value given in E:\site\admin.php on line 481
> 
it is not matter of PHP,it is your php project's problem.

or you can disable the error print in php.ini file.

-- 
Best regards,
Sharl.Jimh.Tsin (From China **Obviously Taiwan INCLUDED**)

Using Gmail? Please read this important notice:
http://www.fsf.org/campaigns/jstrap/gmail?10073.


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



[PHP] what's wrong with this php system

2011-08-07 Thread smith jack
I have installed a php system on my pc, it works well, except the head
of the page is a bit strange, there is some warning information, and
occupies lot of space,
what's wrong,  the error information is as follows:
Warning: Parameter 1 to Notice::onPrint() expected to be a reference,
value given in E:\site\admin.php on line 481

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



Re: [PHP] system() Question

2009-01-01 Thread Nathan Nobbe
On Thu, Jan 1, 2009 at 12:01 AM, Daniel Brown  wrote:

> On Thu, Jan 1, 2009 at 01:57, Jim Lucas  wrote:
> >
> > Getting in some practice for new little one?  :)
>
> Damn kids ;-P
>
> > Happy New Year to all, and to all a safe night!
>
> To you as well, Mr. Lucas!  And now that I am done with work (for
> the most part), this is my official adieu to 2008.  Thanks for the
> memories.
>

merry new year to all you folks out there, wherever you hail from!

-nathan


Re: [PHP] system() Question

2008-12-31 Thread Daniel Brown
On Thu, Jan 1, 2009 at 01:57, Jim Lucas  wrote:
>
> Getting in some practice for new little one?  :)

Damn kids ;-P

> Happy New Year to all, and to all a safe night!

To you as well, Mr. Lucas!  And now that I am done with work (for
the most part), this is my official adieu to 2008.  Thanks for the
memories.

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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



Re: [PHP] system() Question

2008-12-31 Thread Jim Lucas

Daniel Brown wrote:

On Wed, Dec 31, 2008 at 21:29, Nathan Nobbe  wrote:

On Wed, Dec 31, 2008 at 7:03 PM, Micah Gersten  wrote:

I think I was confused here about your response.  After re-reading a few
times, I see that you were enhancing Dan's response by explaining what
call-time pass by reference is, not saying that the function is used
that way.
My apologies.

no worries


So help me God, if you two don't stop fighting, I'm going to turn
this car around


(;-P)



Getting in some practice for new little one?  :)

Happy New Year to all, and to all a safe night!

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
by William Shakespeare


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



Re: [PHP] system() Question

2008-12-31 Thread Daniel Brown
On Wed, Dec 31, 2008 at 21:29, Nathan Nobbe  wrote:
> On Wed, Dec 31, 2008 at 7:03 PM, Micah Gersten  wrote:
>>
>> I think I was confused here about your response.  After re-reading a few
>> times, I see that you were enhancing Dan's response by explaining what
>> call-time pass by reference is, not saying that the function is used
>> that way.
>> My apologies.
>
> no worries

So help me God, if you two don't stop fighting, I'm going to turn
this car around


(;-P)

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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



Re: [PHP] system() Question

2008-12-31 Thread Nathan Nobbe
On Wed, Dec 31, 2008 at 7:03 PM, Micah Gersten  wrote:

> Nathan Nobbe wrote:
> >
> >
> > On Sun, Dec 28, 2008 at 8:40 PM, Micah Gersten  > > wrote:
> >
> > Nathan Nobbe wrote:
> > > good point dan, and just to add further clarification, thats b/c
> the
> > > function specifies $return_var is passed by reference in the formal
> > > parameter.  when you include the & along w/ an actual parameter
> > (during
> > > function invocation) thats referred to as
> > call-time-pass-by-reference in
> > > php, and its typically frowned upon.  in fact, i think its being
> > removed
> > > from a future version of php.
> > >
> > > -nathan
> > >
> > >
> > You don't call system using the ampersand.  The reference is
> > declared in
> > the function definition.  There's no reason for this to be frowned
> > upon.
> >
> >
> > well i dont think they deprecated it for shits-&-giggles.
> >
> > http://us.php.net/manual/en/language.references.pass.php
> >
> > its disabled by default in php.ini; wonder why.. ;)
> >
> >
> >   What you are referring to is the old PHP4 style of explicit
> > pass-by-reference in function usage which is frowned upon.
> >
> >
> > no im referring to call-time-pass by reference, which works just as
> > well in php5; as long as you enable it in php.ini (or one of the other
> > various ways).
> >
> > and also, for clarification, marking parameters as pass-by-reference
> > works during method definition in php4 as well, of course.
> >
> > -nathan
> >
> I think I was confused here about your response.  After re-reading a few
> times, I see that you were enhancing Dan's response by explaining what
> call-time pass by reference is, not saying that the function is used
> that way.
> My apologies.
>

no worries

-nathan


Re: [PHP] system() Question

2008-12-31 Thread Micah Gersten
Nathan Nobbe wrote:
>
>
> On Sun, Dec 28, 2008 at 8:40 PM, Micah Gersten  > wrote:
>
> Nathan Nobbe wrote:
> > good point dan, and just to add further clarification, thats b/c the
> > function specifies $return_var is passed by reference in the formal
> > parameter.  when you include the & along w/ an actual parameter
> (during
> > function invocation) thats referred to as
> call-time-pass-by-reference in
> > php, and its typically frowned upon.  in fact, i think its being
> removed
> > from a future version of php.
> >
> > -nathan
> >
> >
> You don't call system using the ampersand.  The reference is
> declared in
> the function definition.  There's no reason for this to be frowned
> upon.
>
>
> well i dont think they deprecated it for shits-&-giggles.
>
> http://us.php.net/manual/en/language.references.pass.php
>
> its disabled by default in php.ini; wonder why.. ;)
>  
>
>   What you are referring to is the old PHP4 style of explicit
> pass-by-reference in function usage which is frowned upon.
>
>
> no im referring to call-time-pass by reference, which works just as
> well in php5; as long as you enable it in php.ini (or one of the other
> various ways).
>
> and also, for clarification, marking parameters as pass-by-reference
> works during method definition in php4 as well, of course.
>
> -nathan
>
I think I was confused here about your response.  After re-reading a few
times, I see that you were enhancing Dan's response by explaining what
call-time pass by reference is, not saying that the function is used
that way.
My apologies.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



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



Re: [PHP] system() Question

2008-12-28 Thread Nathan Nobbe
On Sun, Dec 28, 2008 at 8:40 PM, Micah Gersten  wrote:

> Nathan Nobbe wrote:
> > good point dan, and just to add further clarification, thats b/c the
> > function specifies $return_var is passed by reference in the formal
> > parameter.  when you include the & along w/ an actual parameter (during
> > function invocation) thats referred to as call-time-pass-by-reference in
> > php, and its typically frowned upon.  in fact, i think its being removed
> > from a future version of php.
> >
> > -nathan
> >
> >
> You don't call system using the ampersand.  The reference is declared in
> the function definition.  There's no reason for this to be frowned
> upon.


well i dont think they deprecated it for shits-&-giggles.

http://us.php.net/manual/en/language.references.pass.php

its disabled by default in php.ini; wonder why.. ;)


>   What you are referring to is the old PHP4 style of explicit
> pass-by-reference in function usage which is frowned upon.


no im referring to call-time-pass by reference, which works just as well in
php5; as long as you enable it in php.ini (or one of the other various
ways).

and also, for clarification, marking parameters as pass-by-reference works
during method definition in php4 as well, of course.

-nathan


Re: [PHP] system() Question

2008-12-28 Thread Micah Gersten
Nathan Nobbe wrote:
> good point dan, and just to add further clarification, thats b/c the
> function specifies $return_var is passed by reference in the formal
> parameter.  when you include the & along w/ an actual parameter (during
> function invocation) thats referred to as call-time-pass-by-reference in
> php, and its typically frowned upon.  in fact, i think its being removed
> from a future version of php.
>
> -nathan
>
>   
You don't call system using the ampersand.  The reference is declared in
the function definition.  There's no reason for this to be frowned
upon.   What you are referring to is the old PHP4 style of explicit
pass-by-reference in function usage which is frowned upon.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com


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



Re: [PHP] system() Question

2008-12-28 Thread Nathan Nobbe
On Sun, Dec 28, 2008 at 6:49 PM, Daniel Brown  wrote:

> On Sun, Dec 28, 2008 at 18:10, Rick Pasotto  wrote:
> >
> > You overlooked the ampersand in front of $retval. The syntax for
> > 'system' is:
> >
> > string system  ( string $command  [, int &$return_var  ] )
> >
> > You have to pass a pointer to the variable, not the variable itself.
>
> Actually, that's not entirely correct while the documentation
> shows it as a reference variable, it's not actually required to be a
> pointer.


good point dan, and just to add further clarification, thats b/c the
function specifies $return_var is passed by reference in the formal
parameter.  when you include the & along w/ an actual parameter (during
function invocation) thats referred to as call-time-pass-by-reference in
php, and its typically frowned upon.  in fact, i think its being removed
from a future version of php.

-nathan


Re: [PHP] system() Question

2008-12-28 Thread Daniel Brown
On Sun, Dec 28, 2008 at 18:10, Rick Pasotto  wrote:
>
> You overlooked the ampersand in front of $retval. The syntax for
> 'system' is:
>
> string system  ( string $command  [, int &$return_var  ] )
>
> You have to pass a pointer to the variable, not the variable itself.

Actually, that's not entirely correct while the documentation
shows it as a reference variable, it's not actually required to be a
pointer.  And in either case, the OP had the error code returned
(127), and $retval would have nothing to do with causing the error.

What I would recommend trying is:

&1',$ret);
print_r($ret);
?>

On a side note, I'm curious as to what 'gpsbabel' does.  I've
worked a bit with Keyhole markups and GIS overlays, etc.  Neat stuff.

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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



Re: [PHP] system() Question

2008-12-28 Thread Rick Pasotto
On Sun, Dec 28, 2008 at 12:40 PM, Ryan O'Sullivan  wrote:

> Hello all,
>
> I am using system to convert some files using a binary in linux.  My code
> looks like this:
> $response = system('gpsbabel -p "" -r -t -i gpx -f "test.gpx" -o kml -F 
> "test2.kml"', $retval);
> echo "Response: ", $response, "Return Value: ", $retval;
>
> The $retval is returning code 127 - Any ideas on why this?

You overlooked the ampersand in front of $retval. The syntax for
'system' is:

string system  ( string $command  [, int &$return_var  ] )

You have to pass a pointer to the variable, not the variable itself.

-- 
"Paper has a genius for multiplication that cannot be equaled anywhere
 else in nature." -- Hugh Keenleyside
Rick Pasottor...@niof.nethttp://www.niof.net

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



Re: [PHP] system() Question

2008-12-28 Thread Nathan Nobbe
On Sun, Dec 28, 2008 at 12:40 PM, Ryan O'Sullivan  wrote:

> Hello all,
>
> I am using system to convert some files using a binary in linux.  My code
> looks like this:
> $response = system('gpsbabel -p "" -r -t -i gpx -f "test.gpx" -o kml -F
> "test2.kml"', $retval);
> echo "Response: ", $response, "Return Value: ", $retval;
>
> The $retval is returning code 127 - Any ideas on why 
> this?


you might try shell_exec() instead to see if you can get any more mileage.
the return value of shell_exec() is the output of the executed command.

-nathan


[PHP] system() Question

2008-12-28 Thread Ryan O'Sullivan
Hello all,

I am using system to convert some files using a binary in linux.  My code 
looks like this:
 $response = system('gpsbabel -p "" -r -t -i gpx -f "test.gpx" -o kml -F 
"test2.kml"', $retval);
 echo "Response: ", $response, "Return Value: ", $retval;

The $retval is returning code 127 - Any ideas on why this?

Thanks! 



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



Re: [PHP] System errno in PHP

2008-02-25 Thread Daniel Brown
On Sun, Feb 24, 2008 at 10:22 AM, Michal Maras <[EMAIL PROTECTED]> wrote:
> Hi
>
>   Thank you for answer, but I do not understand.
>   How can I use this class Errno after unsuccessful fopen?
>   I want to get the number, for example 13 if there is not enough permissions
>  to open file.
>  It is not problem for me that script will be no portable, it is
>  only for AIX.

fopen() doesn't return that information.  fsockopen() does, but not fopen().

RTFM: http://php.net/manual/en/function.fopen.php

-- 


Daniel P. Brown
Senior Unix Geek


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



Re: [PHP] System errno in PHP

2008-02-24 Thread Michal Maras
Hi

 Thank you for answer, but I do not understand.
 How can I use this class Errno after unsuccessful fopen?
 I want to get the number, for example 13 if there is not enough permissions
to open file.
It is not problem for me that script will be no portable, it is
only for AIX.

By

On 22/02/2008, Ravi Menon <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I also ran into the same issue with file and socket apis, and for now, I
> just
> hack it like ( for linux 2.6 systems ):
>
> class Errno
> {
> const EINTR=  4;
> const EIO  =  5;
> const EINVAL   =  22;
> const ENODATA  =  61;
> const EBADMSG  =  74;
> const EOPNOTSUPP   =  95;
> const ECONNRESET   =  104;
> const ENOTCONN =  107;
> const ETIMEDOUT=  110;
> const EALREADY =  114;
> const EINPROGRESS  =  115;
>
> // useful static methods that use posix_strerror()
> // and socket_strerror() to return strings for logging purposes...
> .
> .
>
> }
>
> Clearly this is not portable, but I am betting that usually on the
> same kernel releases, they
> don't usually change these numbers around.
>
> Having PHP expose these useful constants in a portable manner would be
> a big plus.
>
> Thanks,
> Ravi
>
>
> On Thu, Feb 21, 2008 at 9:04 AM, Richard Lynch <[EMAIL PROTECTED]> wrote:
> > On Wed, February 20, 2008 2:56 am, Michal Maras wrote:
> >  > I have read http://php.net/fopen from top to bottom, but I could not
> >  > find
> >  > how to get  system error number.
> >  > With set_error_handler I can get string for example
> >  >
> >  > fopen(hmc_configuration.cfg)
> >  > [function.fopen<
> http://ds63450.mspr.detemobil.de/%7Emmaras/HMC/function.fopen>]:
> >  > failed to open stream: Permission denied
> >  >
> >  > but I need integer number not string, because string error messages
> >  > depends
> >  > on locale setting.
> >  >  Of course, I can test some conditions before fopen, but it is not
> >  > enough
> >  > for me.
> >
> >  Put in a Feature Request to expose the error number from the OS, I
> >  guess...
> >
> >  http://bugs.php.net/
> >
> >  It *seems* like it ought to be reasonable enough to this naive user.
> >
> >
> >  --
> >  Some people have a "gift" link here.
> >  Know what I want?
> >  I want you to buy a CD from some indie artist.
> >  http://cdbaby.com/from/lynch
> >  Yeah, I get a buck. So?
> >
> >  --
> >
> >
> > PHP General Mailing List (http://www.php.net/)
> >  To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>


Re: [PHP] System errno in PHP

2008-02-22 Thread Ravi Menon
Hi,

I also ran into the same issue with file and socket apis, and for now, I just
hack it like ( for linux 2.6 systems ):

class Errno
{
  const EINTR=  4;
  const EIO  =  5;
  const EINVAL   =  22;
  const ENODATA  =  61;
  const EBADMSG  =  74;
  const EOPNOTSUPP   =  95;
  const ECONNRESET   =  104;
  const ENOTCONN =  107;
  const ETIMEDOUT=  110;
  const EALREADY =  114;
  const EINPROGRESS  =  115;

  // useful static methods that use posix_strerror()
  // and socket_strerror() to return strings for logging purposes...
  .
  .

}

Clearly this is not portable, but I am betting that usually on the
same kernel releases, they
don't usually change these numbers around.

Having PHP expose these useful constants in a portable manner would be
a big plus.

Thanks,
Ravi


On Thu, Feb 21, 2008 at 9:04 AM, Richard Lynch <[EMAIL PROTECTED]> wrote:
> On Wed, February 20, 2008 2:56 am, Michal Maras wrote:
>  > I have read http://php.net/fopen from top to bottom, but I could not
>  > find
>  > how to get  system error number.
>  > With set_error_handler I can get string for example
>  >
>  > fopen(hmc_configuration.cfg)
>  > 
> [function.fopen]:
>  > failed to open stream: Permission denied
>  >
>  > but I need integer number not string, because string error messages
>  > depends
>  > on locale setting.
>  >  Of course, I can test some conditions before fopen, but it is not
>  > enough
>  > for me.
>
>  Put in a Feature Request to expose the error number from the OS, I
>  guess...
>
>  http://bugs.php.net/
>
>  It *seems* like it ought to be reasonable enough to this naive user.
>
>
>  --
>  Some people have a "gift" link here.
>  Know what I want?
>  I want you to buy a CD from some indie artist.
>  http://cdbaby.com/from/lynch
>  Yeah, I get a buck. So?
>
>  --
>
>
> 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] System errno in PHP

2008-02-21 Thread Richard Lynch
On Wed, February 20, 2008 2:56 am, Michal Maras wrote:
> I have read http://php.net/fopen from top to bottom, but I could not
> find
> how to get  system error number.
> With set_error_handler I can get string for example
>
> fopen(hmc_configuration.cfg)
> [function.fopen]:
> failed to open stream: Permission denied
>
> but I need integer number not string, because string error messages
> depends
> on locale setting.
>  Of course, I can test some conditions before fopen, but it is not
> enough
> for me.

Put in a Feature Request to expose the error number from the OS, I
guess...

http://bugs.php.net/

It *seems* like it ought to be reasonable enough to this naive user.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] System errno in PHP

2008-02-20 Thread Michal Maras
Hi

Hmm.. I know I can check such sings as if file exists or has right
permission before fopen.
 But it does not mean that file will still exists with right permission a
moment later when
fopen will be issued.
 And I can't check everything. I can't image how to check whether file is
locked, or if it is on read only filesystems or
if limit of opened fil was  reached ...
 Similar problem can be with fseek, fread,...

By

On 20/02/2008, Stut <[EMAIL PROTECTED]> wrote:
>
> Michal Maras wrote:
> > I have read http://php.net/fopen from top to bottom, but I could not
> find
> > how to get  system error number.
> > With set_error_handler I can get string for example
> >
> > fopen(hmc_configuration.cfg)
> > [function.fopen<
> http://ds63450.mspr.detemobil.de/%7Emmaras/HMC/function.fopen>]:
> > failed to open stream: Permission denied
> >
> > but I need integer number not string, because string error messages
> depends
> > on locale setting.
> >  Of course, I can test some conditions before fopen, but it is not
> enough
> > for me.
>
> What exactly are you trying to do? Why do you need the specific reason
> why it failed? It's pretty-much always a case of file not found or
> insufficient permissions, both of which you can check for before going
> near fopen.
>
> -Stut
>
> --
> http://stut.net/
>


Re: [PHP] System errno in PHP

2008-02-20 Thread Stut

Michal Maras wrote:

I have read http://php.net/fopen from top to bottom, but I could not find
how to get  system error number.
With set_error_handler I can get string for example

fopen(hmc_configuration.cfg)
[function.fopen]:
failed to open stream: Permission denied

but I need integer number not string, because string error messages depends
on locale setting.
 Of course, I can test some conditions before fopen, but it is not enough
for me.


What exactly are you trying to do? Why do you need the specific reason 
why it failed? It's pretty-much always a case of file not found or 
insufficient permissions, both of which you can check for before going 
near fopen.


-Stut

--
http://stut.net/

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



Re: [PHP] System errno in PHP

2008-02-20 Thread Michal Maras
Hello Nick

I have read http://php.net/fopen from top to bottom, but I could not find
how to get  system error number.
With set_error_handler I can get string for example

fopen(hmc_configuration.cfg)
[function.fopen]:
failed to open stream: Permission denied

but I need integer number not string, because string error messages depends
on locale setting.
 Of course, I can test some conditions before fopen, but it is not enough
for me.

By

On 19/02/2008, Nick Stinemates <[EMAIL PROTECTED]> wrote:
>
> Michal Maras wrote:
> > I am now using filesystem functions fopen, fread, fclose, ...
> >
> > On 19/02/2008, Stut <[EMAIL PROTECTED]> wrote:
> >
> >> Michal Maras wrote:
> >>
> >>>  Coud somebody tell me if it is possible to get integer value of
> >>>
> >> variable
> >>
> >>> which name in C is errno end in perl $!.
> >>>  I am PHP beginner so I am sorry if question is 'stupid'.
> >>>
> >> What function are you calling where you expect to get a system error?
> >> Check the manual page for that function - it will tell you how to
> detect
> >> errors.
> >>
> >> -Stut
> >>
> >> --
> >> http://stut.net/
> >>
> >>
> >
> >
> http://php.net/fopen
>
> --
> ==
> Nick Stinemates ([EMAIL PROTECTED])
> http://nick.stinemates.org
>
> AIM: Nick Stinemates
> MSN: [EMAIL PROTECTED]
> Yahoo: [EMAIL PROTECTED]
> ==
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] System errno in PHP

2008-02-19 Thread Richard Lynch
PHP catches all thsoe and prints nifty error message.

I presume the error number is in the guts somewhere, and could be
exposed easily enough if you worked at it...

But I don't think there is any kind of variable today with it in there.

php_errmsg used to have the error message in it, but that depends on
php.ini setting, and seems to be passe these days...

On Tue, February 19, 2008 7:36 am, Michal Maras wrote:
> I am now using filesystem functions fopen, fread, fclose, ...
>
> On 19/02/2008, Stut <[EMAIL PROTECTED]> wrote:
>>
>> Michal Maras wrote:
>> >  Coud somebody tell me if it is possible to get integer value of
>> variable
>> > which name in C is errno end in perl $!.
>> >  I am PHP beginner so I am sorry if question is 'stupid'.
>>
>> What function are you calling where you expect to get a system
>> error?
>> Check the manual page for that function - it will tell you how to
>> detect
>> errors.
>>
>> -Stut
>>
>> --
>> http://stut.net/
>>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] System errno in PHP

2008-02-19 Thread Richard Lynch
On Tue, February 19, 2008 7:13 am, Michal Maras wrote:
>  Coud somebody tell me if it is possible to get integer value of
> variable
> which name in C is errno end in perl $!.
>  I am PHP beginner so I am sorry if question is 'stupid'.

If you use exec() you can get that as a returned value for the third arg.

If you just mean out of the existing environment, almost for sure it's
there in something kinda obvious like $errno or somesuch...

vardump($_ENV) will probably show it.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] System errno in PHP

2008-02-19 Thread Nick Stinemates
Michal Maras wrote:
> I am now using filesystem functions fopen, fread, fclose, ...
>
> On 19/02/2008, Stut <[EMAIL PROTECTED]> wrote:
>   
>> Michal Maras wrote:
>> 
>>>  Coud somebody tell me if it is possible to get integer value of
>>>   
>> variable
>> 
>>> which name in C is errno end in perl $!.
>>>  I am PHP beginner so I am sorry if question is 'stupid'.
>>>   
>> What function are you calling where you expect to get a system error?
>> Check the manual page for that function - it will tell you how to detect
>> errors.
>>
>> -Stut
>>
>> --
>> http://stut.net/
>>
>> 
>
>   
http://php.net/fopen

-- 
==
Nick Stinemates ([EMAIL PROTECTED])
http://nick.stinemates.org

AIM: Nick Stinemates
MSN: [EMAIL PROTECTED]
Yahoo: [EMAIL PROTECTED]
==

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



Re: [PHP] System errno in PHP

2008-02-19 Thread Michal Maras
I am now using filesystem functions fopen, fread, fclose, ...

On 19/02/2008, Stut <[EMAIL PROTECTED]> wrote:
>
> Michal Maras wrote:
> >  Coud somebody tell me if it is possible to get integer value of
> variable
> > which name in C is errno end in perl $!.
> >  I am PHP beginner so I am sorry if question is 'stupid'.
>
> What function are you calling where you expect to get a system error?
> Check the manual page for that function - it will tell you how to detect
> errors.
>
> -Stut
>
> --
> http://stut.net/
>


Re: [PHP] System errno in PHP

2008-02-19 Thread Michal Maras
Hi

 I am asking about errno for Filesystems functions like
fopen, fread, fclose, ...

On 19/02/2008, Stut <[EMAIL PROTECTED]> wrote:
>
> Michal Maras wrote:
> >  Coud somebody tell me if it is possible to get integer value of
> variable
> > which name in C is errno end in perl $!.
> >  I am PHP beginner so I am sorry if question is 'stupid'.
>
> What function are you calling where you expect to get a system error?
> Check the manual page for that function - it will tell you how to detect
> errors.
>
> -Stut
>
> --
> http://stut.net/
>


Re: [PHP] System errno in PHP

2008-02-19 Thread Stut

Michal Maras wrote:

 Coud somebody tell me if it is possible to get integer value of variable
which name in C is errno end in perl $!.
 I am PHP beginner so I am sorry if question is 'stupid'.


What function are you calling where you expect to get a system error? 
Check the manual page for that function - it will tell you how to detect 
errors.


-Stut

--
http://stut.net/

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



[PHP] System errno in PHP

2008-02-19 Thread Michal Maras
Hello everybody

 Coud somebody tell me if it is possible to get integer value of variable
which name in C is errno end in perl $!.
 I am PHP beginner so I am sorry if question is 'stupid'.

By


Re: [PHP] system command runs application, but application doesn't work correctly

2008-01-16 Thread Daniel Brown
On Jan 16, 2008 7:56 PM, Apple <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm trying to run mencoder command line utility to encode videos.
>
> When I use these two command in terminal (through SSH), everything works fine.
> But when I run them from PHP script with system command, it doesn't work.
[snip]

Try replacing system() with die() and letting it print out the
information full command string.  That may give you an idea of a
variable that's either incorrect or undefined.  If you copy and paste
it and run the command from the command line and it works, then it may
be permissions issues.

One part of the snipped content that I noticed kept repeating is
the following (and actually ending with this line):
'VDecoder init failed :( Read DOCS/HTML/en/codecs.html'

Did you follow the advice and read that document?

Beyond that, it's a question that should probably instead be asked
on a mencoder mailing list, since PHP's system() function is working
correctly, but apparently isn't getting the information it needs to
pass stuff back-and-forth with the system.

-- 


Daniel P. Brown
Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since
Nineteen-Seventy-[mumble].

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



[PHP] system command runs application, but application doesn't work correctly

2008-01-16 Thread Apple7777
Hello,

I'm trying to run mencoder command line utility to encode videos.

When I use these two command in terminal (through SSH), everything works fine.
But when I run them from PHP script with system command, it doesn't work.

The commands are:

First pass:

system("/usr/local/bin/mencoder -vf scale=448:-3,expand=448:336 -sws 9 -of lavf
-ovc lavc -lavcopts
vcodec=flv:vbitrate=250:trell:v4mv:mv0:mbd=2:cbp:aic:cmp=3:subcmp=3:vpass=1
-frames 800 -ofps 24000/1001 -oac mp3lame -lameopts abr:br=64:mode=0 -channels 1
-srate 22050 -of lavf -lavfopts format=flv -o ".$outputFile."
/home/re/ff/logo7.avi ".$inputFile);


Second pass:

system("/usr/local/bin/mencoder -vf scale=448:-3,expand=448:336 -sws 9 -of lavf
-ovc lavc -lavcopts
vcodec=flv:vbitrate=250:trell:v4mv:mv0:mbd=2:cbp:aic:cmp=3:subcmp=3:vpass=1
-frames 800 -ofps 24000/1001 -oac mp3lame -lameopts abr:br=64:mode=0 -channels 1
-srate 22050 -of lavf -lavfopts format=flv -o ".$outputFile."
/home/re/ff/logo7.avi ".$inputFile);
 


And the output is:


MEncoder dev-SVN-r25703-4.1.2 (C) 2000-2008 MPlayer Team CPU: Intel(R)
Celeron(R) D CPU 3.20GHz (Family: 15, Model: 6, Stepping: 5) CPUflags: Type: 15
MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1 Compiled for x86 CPU with
extensions: MMX MMX2 SSE SSE2 success: format: 0 data: 0x0 - 0x206e57e AVI file
format detected. [aviheader] Video stream found, -vid 0 [aviheader] Audio stream
found, -aid 1 VIDEO: [] 448x336 24bpp 23.976 fps 86617.4 kbps (10573.4 kbyte/s)
[V] filefmt:3 fourcc:0x0 size:448x336 fps:23.98 ftime:=0.0417
==
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 AUDIO: 44100 Hz, 2 ch,
s16le, 320.0 kbit/22.68% (ratio: 4->176400) Selected audio codec: [mp3] afm:
mp3lib (mp3lib MPEG layer-2, layer-3)
== OK,
exit Opening video filter: [expand osd=1] Expand: -1 x -1, -1 ; -1, osd: 1,
aspect: 0.00, round: 1 Opening video filter: [expand w=448 h=336] Expand:
448 x 336, -1 ; -1, osd: 0, aspect: 0.00, round: 1 Opening video filter:
[scale w=448 h=-3]
==
Opening video decoder: [raw] RAW Uncompressed Video VDec: vo config request -
448 x 336 (preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening
video decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening video
decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening video
decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening video
decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDecoder init failed :( Opening video
decoder: [raw] RAW Uncompressed Video VDec: vo config request - 448 x 336
(preferred colorspace: BGR 24-bit) VDec: using BGR 24-bit as output csp (no 0)
Opening video filter: [flip] Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality
encoding selected (non-realtime)! VDecoder init failed :( Opening video decoder:
[raw] RAW Uncompressed Video VDec: vo config request - 448 x 336 (preferred
colorspace: BGR 24-bit) VDec: using BGR 24-bit as output csp (no 0) Opening
video filter: [flip] Movie-Aspect is undefined - no prescaling applied.
videocodec: libavcodec (448x336 fourcc=31564c46 [FLV1]) [VE_LAVC] High quality
encoding selected (non-realtime)! VDecoder init failed :( Opening video decoder:
[raw] RAW Uncompressed Video VDec: vo config request - 448 x 336 (preferred
colorspace: BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
BGR 24-bit) VDecoder init failed :( Opening video decoder: [raw] RAW
Uncompressed Video VDec: vo config request - 448 x 336 (preferred colorspace:
Packed YUY2) VDec: using Packed YUY2 a

RE: [PHP] system command

2007-10-27 Thread Instruct ICC

>> Maybe something to do with the last line (but I get several lines)
>> Return Values
>>
>> Returns the last line of the command output on success, and FALSE on failure.
>>
>>
>
> I have within a web page:
>  $a=system('/usr/bin/lynx -dump http://api.hostip.info/country.php?ip='.$aa);
> ?>
>  .
>
> later I pickup the variable $a again ...
>
> The problem for me is that the line $a=system('/usr/bin/lynx -dump
> http://api.hostip.info/country.php?ip='.$aa); prints (before ) the
> result ($a). I need the variable within the program, but do not want to
> display it. It seems that 'system' includes an 'echo'

I always go back to the manual:
http://php.net/system
Maybe that built-in echo is related to this:
"The system() call also tries to automatically flush the web server's output 
buffer after each line of output if PHP is running as a server module."

Check out the other "Program Execution Functions" functions http://php.net/exec 
particularly http://php.net/manual/en/function.exec.php

_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] system command

2007-10-26 Thread Ronald Wiplinger

Instruct ICC wrote:

Use double quotes to get the value of $a or else you get the literal string 
"$a".

$aa=system("lynx -dump http://api.hostip.info/country.php?ip=$a",$location);
or
$aa=system('lynx -dump http://api.hostip.info/country.php?ip='.$a,$location);


  

Thanks! 1st solution did not work for me, but the second one did.

I still have a problem with it. It prints the info to the page. Can I
suppress this somehow?



man lynx
?

I don't use lynx and I don't know what you mean by "info to the page".
I tried
lynx -dump http://www.google.com
to try to see what you mean.

Maybe something to do with the last line (but I get several lines)
Return Values

Returns the last line of the command output on success, and FALSE on failure.

  


I have within a web page:
http://api.hostip.info/country.php?ip='.$aa);
?>
 .

later I pickup the variable $a again ...

The problem for me is that the line $a=system('/usr/bin/lynx -dump 
http://api.hostip.info/country.php?ip='.$aa);  prints (before ) the 
result ($a). I need the variable within the program, but do not want to 
display it. It seems that 'system' includes an 'echo'


bye

Ronald

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



RE: [PHP] system command

2007-10-26 Thread Instruct ICC

>> Use double quotes to get the value of $a or else you get the literal string 
>> "$a".
>>
>> $aa=system("lynx -dump http://api.hostip.info/country.php?ip=$a",$location);
>> or
>> $aa=system('lynx -dump http://api.hostip.info/country.php?ip='.$a,$location);
>>
>>
> Thanks! 1st solution did not work for me, but the second one did.
>
> I still have a problem with it. It prints the info to the page. Can I
> suppress this somehow?

man lynx
?

I don't use lynx and I don't know what you mean by "info to the page".
I tried
lynx -dump http://www.google.com
to try to see what you mean.

Maybe something to do with the last line (but I get several lines)
Return Values

Returns the last line of the command output on success, and FALSE on failure.

Sorry.

_
Climb to the top of the charts!  Play Star Shuffle:  the word scramble 
challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_oct
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] system command

2007-10-25 Thread Ronald Wiplinger

Instruct ICC wrote:


  

Date: Thu, 25 Oct 2007 09:43:14 +0800
From: [EMAIL PROTECTED]
To: php-general@lists.php.net
Subject: [PHP] system command

I tried:

$a=$_SERVER["REMOTE_ADDR"];
echo "REMOTE_ADDR=$a";
if($a="192.168.250.108") {
$a="61.64.101.101";
}


$aa=system('lynx -dump http://api.hostip.info/country.php?ip=$a',$location);
echo "a=$aaa=$aalocation=$location";

$aa=system('lynx -dump 
http://api.hostip.info/country.php?ip=61.64.101.101',$location);

echo "a=$aaa=$aalocation=$location";


I get:

REMOTE_ADDR=192.168.250.108
XX

a=61.64.101.101
aa=XX
location=0
TW

a=61.64.101.101
aa=TW
location=0


as you can see, if I put the IP address in, I get the right answer (TW).

What am I doing wrong?

bye

Ronald


Use double quotes to get the value of $a or else you get the literal string 
"$a".

$aa=system("lynx -dump http://api.hostip.info/country.php?ip=$a",$location);
or
$aa=system('lynx -dump http://api.hostip.info/country.php?ip='.$a,$location);

  

Thanks! 1st solution did not work for me, but the second one did.

I still have a problem with it. It prints the info to the page. Can I 
suppress this somehow?


bye

Ronald

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



RE: [PHP] system command

2007-10-24 Thread Instruct ICC



> Date: Thu, 25 Oct 2007 09:43:14 +0800
> From: [EMAIL PROTECTED]
> To: php-general@lists.php.net
> Subject: [PHP] system command
> 
> I tried:
> 
> $a=$_SERVER["REMOTE_ADDR"];
> echo "REMOTE_ADDR=$a";
> if($a="192.168.250.108") {
> $a="61.64.101.101";
> }
> 
> 
> $aa=system('lynx -dump http://api.hostip.info/country.php?ip=$a',$location);
> echo "a=$aaa=$aalocation=$location";
> 
> $aa=system('lynx -dump 
> http://api.hostip.info/country.php?ip=61.64.101.101',$location);
> echo "a=$aaa=$aalocation=$location";
> 
> 
> I get:
> 
> REMOTE_ADDR=192.168.250.108
> XX
> 
> a=61.64.101.101
> aa=XX
> location=0
> TW
> 
> a=61.64.101.101
> aa=TW
> location=0
> 
> 
> as you can see, if I put the IP address in, I get the right answer (TW).
> 
> What am I doing wrong?
> 
> bye
> 
> Ronald
Use double quotes to get the value of $a or else you get the literal string 
"$a".

$aa=system("lynx -dump http://api.hostip.info/country.php?ip=$a",$location);
or
$aa=system('lynx -dump http://api.hostip.info/country.php?ip='.$a,$location);


_
Peek-a-boo FREE Tricks & Treats for You!
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us

[PHP] system command

2007-10-24 Thread Ronald Wiplinger

I tried:

$a=$_SERVER["REMOTE_ADDR"];
echo "REMOTE_ADDR=$a";
if($a="192.168.250.108") {
   $a="61.64.101.101";
}


$aa=system('lynx -dump http://api.hostip.info/country.php?ip=$a',$location);
echo "a=$aaa=$aalocation=$location";

$aa=system('lynx -dump 
http://api.hostip.info/country.php?ip=61.64.101.101',$location);

echo "a=$aaa=$aalocation=$location";


I get:

REMOTE_ADDR=192.168.250.108
XX

a=61.64.101.101
aa=XX
location=0
TW

a=61.64.101.101
aa=TW
location=0


as you can see, if I put the IP address in, I get the right answer (TW).

What am I doing wrong?

bye

Ronald

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



Re: [PHP] system() call in PHP5 on win2003

2007-07-10 Thread Tijnema

On 7/10/07, Xiaogang <[EMAIL PROTECTED]> wrote:

We used to use php 4 on our web server on win2000, and use the system()
to call some DOS programs. That how we call it:

$cmd = "c:\\Inetpub\\wwwroot\\test.exe";
$last_line = system($cmd, $retval);
print ("\nretval =\"". $retval. "\"\n");

It was working perfectly for years.

However, recently we moved to a win2003 server, and install the php
5.2.3, and now the system() no longer works as expected:

   1. It no longer work in the web, the only result returned
  to the web browser is "retval =-1";

   2. It still works if tested in DOS commandline (use the
  command such as "php test.php");

   3. Even change the $cmd to "type test.txt" or "dir", the
  result is the same: works in DOS prompt window, but
  not web browser (received only "retval =-1").

I have checked the permissions on all those files/folders, even tried
giving read/execute permission to "everyone", still no help.

In our configuation, the safe mode is off.

Any clue? Thanks in advance.

Xiaogang



Are you sure PHP does actually read the config file?
Check if safe_mode is really off using phpinfo(); like this:


Tijnema
--
Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info

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



[PHP] system() call in PHP5 on win2003

2007-07-09 Thread Xiaogang
We used to use php 4 on our web server on win2000, and use the system() 
to call some DOS programs. That how we call it:


$cmd = "c:\\Inetpub\\wwwroot\\test.exe";
$last_line = system($cmd, $retval);
print ("\nretval =\"". $retval. "\"\n");

It was working perfectly for years.

However, recently we moved to a win2003 server, and install the php 
5.2.3, and now the system() no longer works as expected:


   1. It no longer work in the web, the only result returned
  to the web browser is "retval =-1";

   2. It still works if tested in DOS commandline (use the
  command such as "php test.php");

   3. Even change the $cmd to "type test.txt" or "dir", the
  result is the same: works in DOS prompt window, but
  not web browser (received only "retval =-1").

I have checked the permissions on all those files/folders, even tried 
giving read/execute permission to "everyone", still no help.


In our configuation, the safe mode is off.

Any clue? Thanks in advance.

Xiaogang

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



Re: [PHP] System wide variable

2007-05-25 Thread Darren Whitlen

Richard Lynch wrote:

On Wed, May 23, 2007 4:27 am, Darren Whitlen wrote:

John Comerford wrote:
Not thought about the memory engine actually. Will give that a try and
see how it turns out.


Let us know.


Finaly managed to get it going (uses AJAX which im not to great at..), 
and the database memory engine seems to be holding up fine.
When it was reading/writing frm the file, after a short while I would 
start getting "file is in use" errors which using mysql now solves.




I'd have GUESSED that MySQL would have just cached something that
small and oft-used in RAM anyway, so a MySQL memory engine table
wouldn't perform any better than the MySQL half of things.

Better than the File System, probably, though that also may be getting
cached...


Think I'll leave the session_id idea then, if it locks it down
per-script, the performance will pretty much die.


It won't be any better than your own file-system calls, but you could do:



And it probably won't be any worse than the locking you presumably
already have in your code...

WHy is it sometimes MySQL and sometims file system?



I'm changing the yShout script (http://yurivish.com/yshout/) so that it 
reads from a database, rather than the tx file it originaly used.

And my bad, it checks the database every 3 seconds, not .5 :)

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



Re: [PHP] System wide variable

2007-05-24 Thread Richard Lynch
On Wed, May 23, 2007 4:27 am, Darren Whitlen wrote:
> John Comerford wrote:
> Not thought about the memory engine actually. Will give that a try and
> see how it turns out.

Let us know.

I'd have GUESSED that MySQL would have just cached something that
small and oft-used in RAM anyway, so a MySQL memory engine table
wouldn't perform any better than the MySQL half of things.

Better than the File System, probably, though that also may be getting
cached...

> Think I'll leave the session_id idea then, if it locks it down
> per-script, the performance will pretty much die.

It won't be any better than your own file-system calls, but you could do:



And it probably won't be any worse than the locking you presumably
already have in your code...

WHy is it sometimes MySQL and sometims file system?

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] System log in problems

2007-05-24 Thread Richard Lynch
On Thu, May 24, 2007 6:04 pm, Stut wrote:
> Richard Lynch wrote:
>> There are probably a dozen things more that could be going wrong...
>> You'll have to dig deeper into what's happening to find out.
>
> I've just gotta ask which part of the following made you think IE...
>
>  > Operating system is Ubuntu 7.04 released in April 2007
>  >   also using Firefox Version 2.0.03
>  > Mozilla/5.0 (x11; U; Linusi686; en-US;rv:1.8.13) Gecko/200611201
>  > Firefox/ 2.0.0.3 (Ubuntu-feisty)
>
> Or were you just in the mood to continue your rant against MS
> products?

My fault -- I mis-read the post to think he was describing the
"working" User Agent and that the problem child was IE.

I can't imagine why I'd think IE was the broken one...

:-)

Most likely, the user has refused cookies, though it could be a
Firefox bug, of course.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] System wide variable

2007-05-24 Thread Richard Lynch


On Wed, May 23, 2007 4:08 am, Darren Whitlen wrote:
> Stut wrote:
>> Darren Whitlen wrote:
>>> I have a PHP script that reads and updates either a small file or a
>>> mysql database. This script is called from several places every .5
>>> seconds.
>>>
>>> I would like to move this file to a variable for extra speed as the
>>> file  is causing a few problems being accessed so many times.
>>> Is it possible to have a writeable variable that has the scope of
>>> EVERY script that is run through the parser?
>>
>> Not really. Your options are basically 1) use the database instead
>> of
>> the file, or 2) try memcached (Google for it).
>>
>> -Stut
>
> Hmmm caching really isnt an option here as the data is always
> changing.
> Just a wild idea here.. would it cause major overhead if a script was
> to
> start a session, update some session vars, then switch to a common
> session_id that each script can access? Then use that session to store
> to my info.
> Would that cause any obvious problems?

The $_SESSION is coupled to the user/browser sending the ID back n
forth...

If you can hack things that run this script, I guess you could do
that, but all that does is use the file system that's already not
working, so I doubt it will help much.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] System wide variable

2007-05-24 Thread Richard Lynch
On Wed, May 23, 2007 3:52 am, Darren Whitlen wrote:
> Hi,
> I have a PHP script that reads and updates either a small file or a
> mysql database. This script is called from several places every .5
> seconds.

Errr.  Okay.

Seems kind of frequent to me...

What/why is going on here?

You may get a MUCH better solution if you post the Big Picture.

> I would like to move this file to a variable for extra speed as the
> file
>   is causing a few problems being accessed so many times.
> Is it possible to have a writeable variable that has the scope of
> EVERY
> script that is run through the parser?

Well, you have Sys V shared memory and shmget shared memory and...

http://php.net/shmop
http://php.net/sem
.
.
.



-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] System log in problems

2007-05-24 Thread Stut

Richard Lynch wrote:

There are several/many things it COULD be...

First Guess:

header("Location: logged_in_page.php");

Some versions of IE will figure out what you meant with the above
WRONG code, but will NOT carry the Cookie for your session along with
it, so you're bounced back as if you never had a Cookie, even though
you did.

Use a full URI like you're supposed to for Location: and all is well.

The problem user may also have refused Cookies which are probably
being used for your session login to ID the user, and then they can
never login.

I also have long suspected that some versions of IE in some common
settings of their goofy "security" levels will not work unless your
server kicks out those ill-designed p3p headers, but have never taken
the time to prove/test/disprove this hypothesis.

Asking the user to switch to Firefox is just s much more
satisfying in the long run than trying to cater to IE broken-ness...
:-)

YMMV

There are probably a dozen things more that could be going wrong... 
You'll have to dig deeper into what's happening to find out.


I've just gotta ask which part of the following made you think IE...

> Operating system is Ubuntu 7.04 released in April 2007
>   also using Firefox Version 2.0.03
> Mozilla/5.0 (x11; U; Linusi686; en-US;rv:1.8.13) Gecko/200611201
> Firefox/ 2.0.0.3 (Ubuntu-feisty)

Or were you just in the mood to continue your rant against MS products?

And I must congratulate you on the suggestion that the user switches 
from Firefox to Firefox. Inspired advice there! :D


-Stut

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



Re: [PHP] System log in problems

2007-05-24 Thread Richard Lynch
On Thu, May 24, 2007 4:51 pm, Rich Peterson wrote:
> Let me start by saying I am not 100% sure this
> is the correct board to post this to. I hope it is
> because as i have watched this list it contains
> some very helpful people.
>
> I have search for an answer to this and cannot
> seem to find it.  We have a subscription based
> site that is developed mainly with php and mysql.
> We have one person who each time he attempts
> to log in it just rolls back to the login page. With
> almost 2000 users this is the only time we have
> come across this problem. He is not running your
> average system at his home the details are.
>
> Operating system is Ubuntu 7.04 released in April 2007
>   also using Firefox Version 2.0.03
> Mozilla/5.0 (x11; U; Linusi686; en-US;rv:1.8.13) Gecko/200611201
> Firefox/ 2.0.0.3 (Ubuntu-feisty)
>
>
> I can login using firefox and ie no problem but am running a
> more common windows system. Is there something on our
> end that could be causing this problem for him?

There are several/many things it COULD be...

First Guess:

header("Location: logged_in_page.php");

Some versions of IE will figure out what you meant with the above
WRONG code, but will NOT carry the Cookie for your session along with
it, so you're bounced back as if you never had a Cookie, even though
you did.

Use a full URI like you're supposed to for Location: and all is well.

The problem user may also have refused Cookies which are probably
being used for your session login to ID the user, and then they can
never login.

I also have long suspected that some versions of IE in some common
settings of their goofy "security" levels will not work unless your
server kicks out those ill-designed p3p headers, but have never taken
the time to prove/test/disprove this hypothesis.

Asking the user to switch to Firefox is just s much more
satisfying in the long run than trying to cater to IE broken-ness...
:-)

YMMV

There are probably a dozen things more that could be going wrong... 
You'll have to dig deeper into what's happening to find out.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] System log in problems

2007-05-24 Thread Stut

Rich Peterson wrote:

Hi All

Let me start by saying I am not 100% sure this
is the correct board to post this to. I hope it is
because as i have watched this list it contains
some very helpful people.

I have search for an answer to this and cannot
seem to find it.  We have a subscription based
site that is developed mainly with php and mysql.
We have one person who each time he attempts
to log in it just rolls back to the login page. With
almost 2000 users this is the only time we have
come across this problem. He is not running your
average system at his home the details are.

Operating system is Ubuntu 7.04 released in April 2007
 also using Firefox Version 2.0.03
Mozilla/5.0 (x11; U; Linusi686; en-US;rv:1.8.13) Gecko/200611201
Firefox/ 2.0.0.3 (Ubuntu-feisty)


I can login using firefox and ie no problem but am running a
more common windows system. Is there something on our
end that could be causing this problem for him?


How does the login work? Is it cookie based? Does this user have cookies 
enabled? Does it do daft things like check the user agent? Have you 
looked for the piece of code that would take the user back to the login 
page and debugged it to see why that's happening?


Etc.

-Stut

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



[PHP] System log in problems

2007-05-24 Thread Rich Peterson

Hi All

Let me start by saying I am not 100% sure this
is the correct board to post this to. I hope it is
because as i have watched this list it contains
some very helpful people.

I have search for an answer to this and cannot
seem to find it.  We have a subscription based
site that is developed mainly with php and mysql.
We have one person who each time he attempts
to log in it just rolls back to the login page. With
almost 2000 users this is the only time we have
come across this problem. He is not running your
average system at his home the details are.

Operating system is Ubuntu 7.04 released in April 2007
 also using Firefox Version 2.0.03
Mozilla/5.0 (x11; U; Linusi686; en-US;rv:1.8.13) Gecko/200611201
Firefox/ 2.0.0.3 (Ubuntu-feisty)


I can login using firefox and ie no problem but am running a
more common windows system. Is there something on our
end that could be causing this problem for him?

Thanks in advance
Rich

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



Re: [PHP] System wide variable

2007-05-23 Thread Jochem Maas
Darren Whitlen wrote:
> Hi,
> I have a PHP script that reads and updates either a small file or a
> mysql database. This script is called from several places every .5 seconds.

assuming your using a real OS 

whilst your figuring out an even better way to do it you might consider sticking
the small file in question in /dev/shm (again assuming that your OS has tmpfs)
so that your file is actually stored in RAM rather than on disk.

a cron job every so often can ensure you have a reasonably up2date copy of the
file lying around in case you need it.

> 
> I would like to move this file to a variable for extra speed as the file
>  is causing a few problems being accessed so many times.
> Is it possible to have a writeable variable that has the scope of EVERY
> script that is run through the parser?
> 
> Thanks,
> Darren
> 

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



Re: [PHP] System wide variable

2007-05-23 Thread Sancar Saran
On Wednesday 23 May 2007 11:52:27 Darren Whitlen wrote:
> Hi,
> I have a PHP script that reads and updates either a small file or a
> mysql database. This script is called from several places every .5 seconds.
>
> I would like to move this file to a variable for extra speed as the file
>   is causing a few problems being accessed so many times.
> Is it possible to have a writeable variable that has the scope of EVERY
> script that is run through the parser?
>
> Thanks,
> Darren

Hi,

You should use memcached.

Regards

Sancar

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



Re: [PHP] System wide variable

2007-05-23 Thread Darren Whitlen

John Comerford wrote:

How about a table using the mysql memory engine ?

Darren Whitlen wrote:

Hi,
I have a PHP script that reads and updates either a small file or a 
mysql database. This script is called from several places every .5 
seconds.


I would like to move this file to a variable for extra speed as the 
file  is causing a few problems being accessed so many times.
Is it possible to have a writeable variable that has the scope of 
EVERY script that is run through the parser?


Thanks,
Darren


 From - Wed


Not thought about the memory engine actually. Will give that a try and 
see how it turns out.
Think I'll leave the session_id idea then, if it locks it down 
per-script, the performance will pretty much die.


Thanks!

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



Re: [PHP] System wide variable

2007-05-23 Thread Stut

Darren Whitlen wrote:

Stut wrote:

Darren Whitlen wrote:
I have a PHP script that reads and updates either a small file or a 
mysql database. This script is called from several places every .5 
seconds.


I would like to move this file to a variable for extra speed as the 
file  is causing a few problems being accessed so many times.
Is it possible to have a writeable variable that has the scope of 
EVERY script that is run through the parser?


Not really. Your options are basically 1) use the database instead of 
the file, or 2) try memcached (Google for it).


-Stut


Hmmm caching really isnt an option here as the data is always changing.
Just a wild idea here.. would it cause major overhead if a script was to 
start a session, update some session vars, then switch to a common 
session_id that each script can access? Then use that session to store 
to my info.

Would that cause any obvious problems?


Yes, it would. Depending on the session implementation you are using, 
PHP locks the session data for the duration of the request. So doing as 
you suggest would mean the server could only process one request at a time.


The best option is to use a database, as this is the sort of thing they 
are designed to do.


Also note that I was suggesting memcached not for it's caching 
abilities, but the fact that it provides controlled access to shared 
data. On reflection it's probably a bad idea because if it's always 
changing then performance will suck.


-Stut

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



Re: [PHP] System wide variable

2007-05-23 Thread John Comerford

How about a table using the mysql memory engine ?

Darren Whitlen wrote:

Hi,
I have a PHP script that reads and updates either a small file or a 
mysql database. This script is called from several places every .5 
seconds.


I would like to move this file to a variable for extra speed as the 
file  is causing a few problems being accessed so many times.
Is it possible to have a writeable variable that has the scope of 
EVERY script that is run through the parser?


Thanks,
Darren



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



Re: [PHP] System wide variable

2007-05-23 Thread Darren Whitlen

Stut wrote:

Darren Whitlen wrote:
I have a PHP script that reads and updates either a small file or a 
mysql database. This script is called from several places every .5 
seconds.


I would like to move this file to a variable for extra speed as the 
file  is causing a few problems being accessed so many times.
Is it possible to have a writeable variable that has the scope of 
EVERY script that is run through the parser?


Not really. Your options are basically 1) use the database instead of 
the file, or 2) try memcached (Google for it).


-Stut


Hmmm caching really isnt an option here as the data is always changing.
Just a wild idea here.. would it cause major overhead if a script was to 
start a session, update some session vars, then switch to a common 
session_id that each script can access? Then use that session to store 
to my info.

Would that cause any obvious problems?

Darren

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



Re: [PHP] System wide variable

2007-05-23 Thread Stut

Darren Whitlen wrote:
I have a PHP script that reads and updates either a small file or a 
mysql database. This script is called from several places every .5 seconds.


I would like to move this file to a variable for extra speed as the file 
 is causing a few problems being accessed so many times.
Is it possible to have a writeable variable that has the scope of EVERY 
script that is run through the parser?


Not really. Your options are basically 1) use the database instead of 
the file, or 2) try memcached (Google for it).


-Stut

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



[PHP] System wide variable

2007-05-23 Thread Darren Whitlen

Hi,
I have a PHP script that reads and updates either a small file or a 
mysql database. This script is called from several places every .5 seconds.


I would like to move this file to a variable for extra speed as the file 
 is causing a few problems being accessed so many times.
Is it possible to have a writeable variable that has the scope of EVERY 
script that is run through the parser?


Thanks,
Darren

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



[PHP] system, exec, shell_exec, passthru [RESOLVED]

2006-08-15 Thread p . willis
Hello,

This problem has now been resolved.
The problem as described below was NOT caused by
PHP. The problem was actually a file permissions/ownership problem.

A.) The apache webserver runs as a user with specific
priviledges. On this particular server the webserver runs as user
'apache'.

B.) The file that CGI/PHP 'myprog' was attempting to open for input
was owned by a different user. The user 'apache' had no rights to 
the file.

C.) Because the CGI was unable to open the input file, several
following output files failed to be generated. Thus the error in PHP.

The resolution was to place files, to be accessed by the apache webserver
user, in directories and files that are owned by apache:apache, or 
nobody:nogroup.

chown apache:apache /mydirectory
cd mydirectory
chown apache:apache -R *

[or]

chown nobody:nogroup /mydirectory
cd mydirectory
chown nobody:nogroup -R *

I hope this helps people with similar problems in the future.

All the best,

Peter


>Hello,
>
>I am trying the run an external application with
>command line arguments using PHP under linux.
>
>ie:
>
>$command="myprog $arg1 $arg2 > textfile.txt";
>system("echo \"$command\" > test.txt");
>system($command);
>
>$handle=fopen("textfile.txt","r");
>if($handle!=NULL)
>{
>   while(!feof($handle))
>   {
>   ...
>   }
>   fclose($handle);
>}
>
>
>I test my input arguments for the 'system' call by dumping
>the command into a text file. I can then test the command in 
>the console. The commands work fine when run from the console.
>
>The commands don't work when run through the system command.
>I have tried system, exec, passthru, and shell_exec to no avail.
>
>Am I missing some permissions thing in my php.ini file?
>
>Thanks for any insight,
>
>Peter
>

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



Re: [PHP] system, exec, shell_exec, passthru

2006-08-14 Thread Richard Lynch
Use exec() instead of system() and pass in args for output and error
number and then you'll get an error number telling you what went
wrong.

You'll have to look up the error number in a shell with 'perror' (man
perror) unless you dig my modest extension to do it from PHP:
http://l-i-e.com/perror

On Mon, August 14, 2006 10:23 am, [EMAIL PROTECTED] wrote:
> Hello,
>
> I am trying the run an external application with
> command line arguments using PHP under linux.
>
> ie:
>
> $command="myprog $arg1 $arg2 > textfile.txt";
> system("echo \"$command\" > test.txt");
> system($command);
>
> $handle=fopen("textfile.txt","r");
> if($handle!=NULL)
> {
>   while(!feof($handle))
>   {
>   ...
>   }
>   fclose($handle);
> }
>
>
> I test my input arguments for the 'system' call by dumping
> the command into a text file. I can then test the command in
> the console. The commands work fine when run from the console.
>
> The commands don't work when run through the system command.
> I have tried system, exec, passthru, and shell_exec to no avail.
>
> Am I missing some permissions thing in my php.ini file?
>
> Thanks for any insight,
>
> Peter
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

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



[PHP] system, exec, shell_exec, passthru

2006-08-14 Thread p . willis
Hello,

I am trying the run an external application with
command line arguments using PHP under linux.

ie:

$command="myprog $arg1 $arg2 > textfile.txt";
system("echo \"$command\" > test.txt");
system($command);

$handle=fopen("textfile.txt","r");
if($handle!=NULL)
{
while(!feof($handle))
{
...
}
fclose($handle);
}


I test my input arguments for the 'system' call by dumping
the command into a text file. I can then test the command in 
the console. The commands work fine when run from the console.

The commands don't work when run through the system command.
I have tried system, exec, passthru, and shell_exec to no avail.

Am I missing some permissions thing in my php.ini file?

Thanks for any insight,

Peter

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



Re: [PHP] System Administrator replies

2006-03-02 Thread Stut

John Nichel wrote:



Not that we need a list admin to take care of this or anything.




Good job you closed that tag, these can be a nightmare!

-Stut

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



Re: [PHP] System Administrator replies

2006-03-02 Thread John Nichel

tedd wrote:

Hi gang:

Is anyone else getting these:

"System Administrator" <[EMAIL PROTECTED]>

 Undeliverable: 


Every time I send something to this list, my email get's posted, but 
then I also receive an email from the "System Administrator" telling me 
that my email did not reach:


did not reach the following recipient(s):
[EMAIL PROTECTED] on Thu Mar 02 09:55:08 2006

  The e-mail account does not exist at the organization this message
 was sent to.  Check the e-mail address, or contact the recipient
 directly to find out the correct address.
  

---

What's with this?

I'm I doing something wrong?



It's a bounce from an email address subscribed to the list.  Filter it out.


Not that we need a list admin to take care of this or anything.


--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



[PHP] System Administrator replies

2006-03-02 Thread tedd

Hi gang:

Is anyone else getting these:

"System Administrator" <[EMAIL PROTECTED]>

 Undeliverable: 


Every time I send something to this list, my email get's posted, but 
then I also receive an email from the "System Administrator" telling 
me that my email did not reach:


did not reach the following recipient(s):
[EMAIL PROTECTED] on Thu Mar 02 09:55:08 2006

  The e-mail account does not exist at the organization this message
 was sent to.  Check the e-mail address, or contact the recipient
 directly to find out the correct address.
  

---

What's with this?

I'm I doing something wrong?

Thanks.

tedd

--

http://sperling.com

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



Re: [PHP] system( bell ); ?

2006-02-06 Thread Angelo Zanetti
maybe a javascript button that somehow does the dos command or calls 
another program (exe) that will do the command to open the 
till...anywayz this is getting OT!



Oli Howson wrote:


each of the terminals could then use a web based POS interface but 
there was only a

single cash drawer.



It would also be possible to have each 'till' running a copy of apache 
server, and communicating with a central database server. I can't for 
the life of me think of any way the client could open the drawer otherwise.




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



Re: [PHP] system('bell'); ?

2006-02-06 Thread Oli Howson


each of the terminals could then use a web based POS interface but 
there was only a

single cash drawer.


It would also be possible to have each 'till' running a copy of apache 
server, and communicating with a central database server. I can't for 
the life of me think of any way the client could open the drawer 
otherwise.


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



Re: [PHP] system('bell'); ?

2006-02-04 Thread Kevin Waterson
This one time, at band camp, tedd <[EMAIL PROTECTED]> wrote:

> Interesting! The statement system('bell'); is new to me.
> 
> If I'm writing code on a hosted domain, and using that statement, 
> who's bell am I ringing?

The server bell, not the client.
I used this method because the cash drawer was plugged into the server in a 
shop front.
each of the terminals could then use a web based POS interface but there was 
only a
single cash drawer.

Kevin

-- 
"Democracy is two wolves and a lamb voting on what to have for lunch. 
Liberty is a well-armed lamb contesting the vote."

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



RE: [PHP] system('bell'); ?

2006-02-04 Thread php-mail
Suppose someone had to :)

-Original Message-
From: Dan Harrington [mailto:[EMAIL PROTECTED] 
Sent: 04 February 2006 19:50
To: php-general@lists.php.net
Subject: RE: [PHP] system('bell'); ?


Ask not for whom the bell tolls, it tolls for thee!
 

-Original Message-
From: Gerry Danen [mailto:[EMAIL PROTECTED] 
Sent: Saturday, February 04, 2006 12:00 PM
To: tedd
Cc: php-general@lists.php.net
Subject: Re: [PHP] system('bell'); ?

bell is his C program... :)   Outputs an ascii 7 (bell) at the machine
where it runs. It basically outputs a character to stdout or stderr.

He probably has that machine next to his cash drawer...

Gerry

On 2/4/06, tedd <[EMAIL PROTECTED]> wrote:
> >I simple wrote a small C program that basically sent a bell, 0x07 and 
> >it opened my cash drawer. In php I just did system('bell'); and it 
> >worked fine.
> >
> >Kevin
>
> Hi:
>
> Interesting! The statement system('bell'); is new to me.
>
> If I'm writing code on a hosted domain, and using that statement, 
> who's bell am I ringing?
>
> tedd
>
> --
> --
> --
> http://sperling.com/
>
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
> http://www.php.net/unsub.php
>
>


--
Gerry
http://portal.danen.org/

--
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


__ NOD32 1.1393 (20060203) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com

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



RE: [PHP] system('bell'); ?

2006-02-04 Thread Dan Harrington

Ask not for whom the bell tolls, it tolls for thee!
 

-Original Message-
From: Gerry Danen [mailto:[EMAIL PROTECTED] 
Sent: Saturday, February 04, 2006 12:00 PM
To: tedd
Cc: php-general@lists.php.net
Subject: Re: [PHP] system('bell'); ?

bell is his C program... :)   Outputs an ascii 7 (bell) at the machine
where it runs. It basically outputs a character to stdout or stderr.

He probably has that machine next to his cash drawer...

Gerry

On 2/4/06, tedd <[EMAIL PROTECTED]> wrote:
> >I simple wrote a small C program that basically sent a bell, 0x07 and 
> >it opened my cash drawer. In php I just did system('bell'); and it 
> >worked fine.
> >
> >Kevin
>
> Hi:
>
> Interesting! The statement system('bell'); is new to me.
>
> If I'm writing code on a hosted domain, and using that statement, 
> who's bell am I ringing?
>
> tedd
>
> --
> --
> --
> http://sperling.com/
>
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
> http://www.php.net/unsub.php
>
>


--
Gerry
http://portal.danen.org/

--
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] system('bell'); ?

2006-02-04 Thread Gerry Danen
bell is his C program... :)   Outputs an ascii 7 (bell) at the machine
where it runs. It basically outputs a character to stdout or stderr.

He probably has that machine next to his cash drawer...

Gerry

On 2/4/06, tedd <[EMAIL PROTECTED]> wrote:
> >I simple wrote a small C program that basically sent a bell, 0x07
> >and it opened my cash drawer. In php I just did system('bell'); and
> >it worked fine.
> >
> >Kevin
>
> Hi:
>
> Interesting! The statement system('bell'); is new to me.
>
> If I'm writing code on a hosted domain, and using that statement,
> who's bell am I ringing?
>
> tedd
>
> --
> 
> http://sperling.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Gerry
http://portal.danen.org/

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



[PHP] system('bell'); ?

2006-02-04 Thread tedd

I simple wrote a small C program that basically sent a bell, 0x07
and it opened my cash drawer. In php I just did system('bell'); and
it worked fine.

Kevin


Hi:

Interesting! The statement system('bell'); is new to me.

If I'm writing code on a hosted domain, and using that statement, 
who's bell am I ringing?


tedd

--

http://sperling.com/

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



[PHP] System specific information gathering

2005-07-21 Thread Vidyut Luther

Hello,
 I have a question on how to get Server side system specific  
information via PHP, or just general direction on how to parse some  
of the information found in /proc


For example, I want to be able to display the system uptime.. number  
of users logged in, and load average.


In the shell, I just do uptime, and it gives me all that information

[EMAIL PROTECTED] proc]$ uptime
00:47:42  up 15 days,  7:07,  7 users,  load average: 0.44, 0.41, 0.39

Now i can always do a split on , and then based on that parse out the  
info, or I could cat /proc/uptime and /proc/loadavg


For the number of users I can do w -h | wc -l

I can call all these commands via the system() function, but my  
question is, is there a better way of obtaining such info ?


http://us2.php.net/manual/en/ref.info.php doesn't seem to offer much,  
except for the php_uname() function.


I just want to be able to display system information like uptime, on  
some of my web pages. Any help is appreciated.


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



Re: [PHP] System Call Troubles

2005-05-19 Thread José Luis Palacios Vergara
[EMAIL PROTECTED]

- Original Message - 
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; 
Sent: Thursday, May 19, 2005 12:57 PM
Subject: Re: [PHP] System Call Troubles


> Michael Stearne wrote:
> > I am having the strangest problem using system() or exec() or any
> > variation.  None of them work on the Fedora Core 3 system that was
> > just loaded.  The PHP is Version 4.3.11 with Apache 2.0.52, the default
> > installation for Fedora Core 3.  Everything in PHP works as expected
> > except when trying a system call.  If I run :
> > 
> >  > system("/bin/ls /tmp");
> > ?>
> > 
> > on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
> > results, a listing of the tmp directory.  On the Fedora box I get
> > nothing, a blank page.  There is content in the /tmp directory on the
> > Fedora box.
> 
> These sorts of problems are easy to debug.  Switch to your web server
> user id and issue the same command.  You will most often find you have a
> permission problem, or in the Fedora/Redhat world you will find that
> SELinux is yanking your chain.  You may want to read through:
> 
>   http://fedora.redhat.com/docs/selinux-faq-fc3/
> 
> -Rasmus
> 
> -- 
> 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] System Call Troubles

2005-05-19 Thread Michael Stearne
Thank you!

setsebool httpd_disable_trans true
/etc/init.d/httpd restart

did it.

Michael

On 5/19/05, Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
> Michael Stearne wrote:
> > I am having the strangest problem using system() or exec() or any
> > variation.  None of them work on the Fedora Core 3 system that was
> > just loaded.  The PHP is Version 4.3.11 with Apache 2.0.52, the default
> > installation for Fedora Core 3.  Everything in PHP works as expected
> > except when trying a system call.  If I run :
> >
> >  > system("/bin/ls /tmp");
> > ?>
> >
> > on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
> > results, a listing of the tmp directory.  On the Fedora box I get
> > nothing, a blank page.  There is content in the /tmp directory on the
> > Fedora box.
> 
> These sorts of problems are easy to debug.  Switch to your web server
> user id and issue the same command.  You will most often find you have a
> permission problem, or in the Fedora/Redhat world you will find that
> SELinux is yanking your chain.  You may want to read through:
> 
>   http://fedora.redhat.com/docs/selinux-faq-fc3/
> 
> -Rasmus
> 
>

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



Re: [PHP] System Call Troubles

2005-05-19 Thread Rasmus Lerdorf
Michael Stearne wrote:
> I am having the strangest problem using system() or exec() or any
> variation.  None of them work on the Fedora Core 3 system that was
> just loaded.  The PHP is Version 4.3.11 with Apache 2.0.52, the default
> installation for Fedora Core 3.  Everything in PHP works as expected
> except when trying a system call.  If I run :
> 
>  system("/bin/ls /tmp");
> ?>
> 
> on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
> results, a listing of the tmp directory.  On the Fedora box I get
> nothing, a blank page.  There is content in the /tmp directory on the
> Fedora box.

These sorts of problems are easy to debug.  Switch to your web server
user id and issue the same command.  You will most often find you have a
permission problem, or in the Fedora/Redhat world you will find that
SELinux is yanking your chain.  You may want to read through:

  http://fedora.redhat.com/docs/selinux-faq-fc3/

-Rasmus

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



Re: [PHP] System Call Troubles

2005-05-19 Thread Michael Stearne
Thanks.  Neither have helped.  I have no idea what the deal is.  I
think it might be some restriction set by Fedora or Apache.

Michael


On 5/19/05, Philip Hallstrom <[EMAIL PROTECTED]> wrote:
> > I am having the strangest problem using system() or exec() or any
> > variation.  None of them work on the Fedora Core 3 system that was
> > just loaded.  The PHP is Version 4.3.11 with Apache 2.0.52, the default
> > installation for Fedora Core 3.  Everything in PHP works as expected
> > except when trying a system call.  If I run :
> >
> >  > system("/bin/ls /tmp");
> > ?>
> >
> > on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
> > results, a listing of the tmp directory.  On the Fedora box I get
> > nothing, a blank page.  There is content in the /tmp directory on the
> > Fedora box.
> 
> Compare the output of phpinfo() on each machine.  Investigate any
> differences...
> 
> Also maybe this will help:
> 
> http://us4.php.net/features.safe-mode
> 
> -philip
> 
>

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



Re: [PHP] System Call Troubles

2005-05-19 Thread Philip Hallstrom
I am having the strangest problem using system() or exec() or any
variation.  None of them work on the Fedora Core 3 system that was
just loaded.  The PHP is Version 4.3.11 with Apache 2.0.52, the default
installation for Fedora Core 3.  Everything in PHP works as expected
except when trying a system call.  If I run :

on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
results, a listing of the tmp directory.  On the Fedora box I get
nothing, a blank page.  There is content in the /tmp directory on the
Fedora box.
Compare the output of phpinfo() on each machine.  Investigate any 
differences...

Also maybe this will help:
http://us4.php.net/features.safe-mode
-philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] System Call Troubles

2005-05-19 Thread Michael Stearne
I am having the strangest problem using system() or exec() or any
variation.  None of them work on the Fedora Core 3 system that was
just loaded.  The PHP is Version 4.3.11 with Apache 2.0.52, the default
installation for Fedora Core 3.  Everything in PHP works as expected
except when trying a system call.  If I run :



on my OS X (Apache/1.3.33 (Darwin) PHP/4.3.4) this returns the desired
results, a listing of the tmp directory.  On the Fedora box I get
nothing, a blank page.  There is content in the /tmp directory on the
Fedora box.

Please help!

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



RE: [PHP] System Command and snmp commands

2004-10-26 Thread Mulley, Nikhil

Tring Tring .


Just to ring please help me.
I am giving to out print_r($ret) then it returns 1 at 

exec(' snmpget -v 2c -c public 10.103.16.14  sysUpTime.0',$ret);

--Nikhil



-Original Message-
From: Mulley, Nikhil [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 26, 2004 12:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] System Command and snmp commands


Hi All,
 
I want to use system command to perform snmp queries on a remote machine and the 
problem is that I want to store the output /result in an Array , so that I can later 
use it for parsing purposes.I know I could use exec and passthru statements 
actually,But I am unable to store the result in the array or I am unsure whether the 
result is not getting stored in the array 
 
 
Here is the code 
 
 
  
 
Point me , if any thing wrong in the code
 
Please help me.
 
 
Thanks,
Nikhil.

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



[PHP] System Command and snmp commands

2004-10-26 Thread Mulley, Nikhil
Hi All,
 
I want to use system command to perform snmp queries on a remote machine and the 
problem is that I want to store the output /result in an Array , so that I can later 
use it for parsing purposes.I know I could use exec and passthru statements 
actually,But I am unable to store the result in the array or I am unsure whether the 
result is not getting stored in the array 
 
 
Here is the code 
 
 
  
 
Point me , if any thing wrong in the code
 
Please help me.
 
 
Thanks,
Nikhil.


Re: [PHP] system command

2004-08-24 Thread Daniel Schierbeck
Ron Clark wrote:
Daniel Schierbeck wrote:
Ron Clark wrote:
Capture the output in the $output variable then ob_clean to empty the 
output buffer before printing the the desired message.

ob_get_clean() is preferable:
$output = ob_get_clean(); // Gets the buffered output and cleans 
the buffer

Didn't need the contents of the buffer. All I needed was the last line 
which was contained in $output = system().

Sorry, my bad...
--
Daniel Schierbeck
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] system command

2004-08-24 Thread ron clark
Daniel Schierbeck wrote:
Ron Clark wrote:
Capture the output in the $output variable then ob_clean to empty the 
output buffer before printing the the desired message.

ob_get_clean() is preferable:
$output = ob_get_clean(); // Gets the buffered output and cleans 
the buffer

Didn't need the contents of the buffer. All I needed was the last line 
which was contained in $output = system().

--
Ron Clark
System Administrator/Web Coordinator
Armstrong Atlantic State University
11935 Abercorn Street 
Savannah, Ga 31419
Phone: 912 961 3234
Fax: 912 927 5353

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


Re: [PHP] system command

2004-08-24 Thread Daniel Schierbeck
Ron Clark wrote:
Capture the output in 
the $output variable then ob_clean to empty the output buffer before 
printing the the desired message.
ob_get_clean() is preferable:
$output = ob_get_clean(); // Gets the buffered output and cleans the buffer
--
Daniel Schierbeck
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re:[PHP] system command

2004-08-23 Thread ron clark
John Holmes wrote:
From: "ron clark" <[EMAIL PROTECTED]>
I an trying to add virus scanning to the file upload section of our 
portal using uvscan. The virus scanning is working properly using a 
system call , but I am having problems with formatting the output. I 
need to check the return value and if it is not a 0, I want to create 
a custom message. The problem is, when using system the output of the 
call is flushed to the browser before I can write the custom message 
so I have the uvscan message and then my custom message.

You can use output_buffering to capture the output, or use a different 
method to make the call, i.e. backticks or exec(), which allow you to 
capture the output before it's displayed.

---John Holmes...

Thanks John. Was a simple fix. Turn output buffering on to prevent the 
output of the system command going to the browser. Capture the output in 
the $output variable then ob_clean to empty the output buffer before 
printing the the desired message.

--
Ron Clark
System Administrator/Web Coordinator
Armstrong Atlantic State University
11935 Abercorn Street 
Savannah, Ga 31419
Phone: 912 961 3234
Fax: 912 927 5353

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


Re: [PHP] system command

2004-08-23 Thread Jason Wong
On Tuesday 24 August 2004 03:49, ron clark wrote:
> I an trying to add virus scanning to the file upload section of our
> portal using uvscan. The virus scanning is working properly using a
> system call , but I am having problems with formatting the output. I
> need to check the return value and if it is not a 0, I want to create a
> custom message. The problem is, when using system the output of the call
> is flushed to the browser before I can write the custom message so I
> have the uvscan message and then my custom message.

The system() function has a few siblings, check them out.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Democracy is a process by which the people are free to choose the man who
will get the blame.
-- Laurence J. Peter
*/

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



Re: [PHP] system command

2004-08-23 Thread John Holmes
From: "ron clark" <[EMAIL PROTECTED]>
I an trying to add virus scanning to the file upload section of our portal 
using uvscan. The virus scanning is working properly using a system call , 
but I am having problems with formatting the output. I need to check the 
return value and if it is not a 0, I want to create a custom message. The 
problem is, when using system the output of the call is flushed to the 
browser before I can write the custom message so I have the uvscan message 
and then my custom message.
You can use output_buffering to capture the output, or use a different 
method to make the call, i.e. backticks or exec(), which allow you to 
capture the output before it's displayed.

---John Holmes... 

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


[PHP] system command

2004-08-23 Thread ron clark
I an trying to add virus scanning to the file upload section of our 
portal using uvscan. The virus scanning is working properly using a 
system call , but I am having problems with formatting the output. I 
need to check the return value and if it is not a 0, I want to create a 
custom message. The problem is, when using system the output of the call 
is flushed to the browser before I can write the custom message so I 
have the uvscan message and then my custom message.

This is my code.
   $uvscan_cmd = "/usr/local/bin/uvscan " . 
$_FILES['file']['tmp_name'];
   $output = system("$uvscan_cmd" , $retval);

   if ( $retval != 0) {
   print "A virus was found in your file $output";
  exit;
   }
This results in the following sent to the browser.
/var/tmp/phpBFaaIa Found the W32/[EMAIL PROTECTED] virus !!!
A virus was found in your file.
Found the W32/[EMAIL PROTECTED] virus !!!
How can get rid of the first line and still have data $output? I tried 
adding a 2 > &1 to the system call and tried redirecting the output to 
/dev/null. This got rid of the first line but also resulted in $output 
not having an output.

--
Ron Clark
System Administrator/Web Coordinator
Armstrong Atlantic State University
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] System Tray Icon

2004-08-16 Thread Josh Acecool M
Hmm,
Simply make a RSS feed or something, md5 the last changed date of all files
combined every say 30 mins and put that in the rss file, have the systray
icon program look at that file every 5 mins or so, if the file has changed,
flash..
"John Nichel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Harlequin wrote:
> > Hi all.
> >
> > I just wanted to throw this message in here and get some opinions before
I
> > go off developing something So will post in the correct newsgroup later
> > (when I find which newsgroup I need).
> >
> > Before I post a more thorough thread in the correct area I just wanted
to
> > find out if this was achievable and what tools I'd need.
> >
> > Basically: I would like to drop a system tray icon onto the user's PC
that
> > links them to a website. I'd also like to develop a separate one that
> > flashes when a page is changed.
> >
> > How difficult would this be to do...? Would it mean using VB, could I
use
> > something less expensive perhaps or is it just not possible at all...?
> >
>
> Hfirst time I've ever seen this subject on this mailing list.
> We're charting new OT waters every day.
>
> -- 
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]

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



Re: [PHP] System Tray Icon

2004-08-16 Thread Angelo Zanetti
I think VB or some MS dev tool will do the job.


>>> John Nichel <[EMAIL PROTECTED]> 8/16/2004 3:48:11 PM >>>
Harlequin wrote:
> Hi all.
> 
> I just wanted to throw this message in here and get some opinions before I
> go off developing something So will post in the correct newsgroup later
> (when I find which newsgroup I need).
> 
> Before I post a more thorough thread in the correct area I just wanted to
> find out if this was achievable and what tools I'd need.
> 
> Basically: I would like to drop a system tray icon onto the user's PC that
> links them to a website. I'd also like to develop a separate one that
> flashes when a page is changed.
> 
> How difficult would this be to do...? Would it mean using VB, could I use
> something less expensive perhaps or is it just not possible at all...?
> 

Hfirst time I've ever seen this subject on this mailing list. 
We're charting new OT waters every day.

-- 
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED] 

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



Disclaimer
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is
intended for the attention and use only of the addressee.
Should you have received this e-mail in error, please delete
and destroy it and any attachments thereto immediately.
Under no circumstances will the Cape Technikon or the sender
of this e-mail be liable to any party for any direct, indirect,
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



Re: [PHP] System Tray Icon

2004-08-16 Thread John Nichel
Harlequin wrote:
Hi all.
I just wanted to throw this message in here and get some opinions before I
go off developing something So will post in the correct newsgroup later
(when I find which newsgroup I need).
Before I post a more thorough thread in the correct area I just wanted to
find out if this was achievable and what tools I'd need.
Basically: I would like to drop a system tray icon onto the user's PC that
links them to a website. I'd also like to develop a separate one that
flashes when a page is changed.
How difficult would this be to do...? Would it mean using VB, could I use
something less expensive perhaps or is it just not possible at all...?
Hfirst time I've ever seen this subject on this mailing list. 
We're charting new OT waters every day.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] System Tray Icon OT

2004-08-16 Thread Jay Blanchard
[snip]
I just wanted to throw this message in here and get some opinions before
I
go off developing something So will post in the correct newsgroup later
(when I find which newsgroup I need).

Before I post a more thorough thread in the correct area I just wanted
to
find out if this was achievable and what tools I'd need.

Basically: I would like to drop a system tray icon onto the user's PC
that
links them to a website. I'd also like to develop a separate one that
flashes when a page is changed.

How difficult would this be to do...? Would it mean using VB, could I
use
something less expensive perhaps or is it just not possible at all...?
[/snip]

Please place an OT in the subject line when you are relatively sure that
your post is not PHP. Have you googled?
http://www.google.com/search?hl=en&ie=UTF-8&q=create+System+Tray+icon
You can also search http://msdn.microsoft.com (M$ Developer's Network)

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



[PHP] System Tray Icon

2004-08-16 Thread Harlequin
Hi all.

I just wanted to throw this message in here and get some opinions before I
go off developing something So will post in the correct newsgroup later
(when I find which newsgroup I need).

Before I post a more thorough thread in the correct area I just wanted to
find out if this was achievable and what tools I'd need.

Basically: I would like to drop a system tray icon onto the user's PC that
links them to a website. I'd also like to develop a separate one that
flashes when a page is changed.

How difficult would this be to do...? Would it mean using VB, could I use
something less expensive perhaps or is it just not possible at all...?

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-

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



Re: [PHP] system command?

2004-05-11 Thread Jason Wong
On Monday 10 May 2004 23:00, Jas wrote:

> I didn't sent off list, always to php.general in reply to whatever
> message thread I am in.  In any event, I have tried safe mode = On and
> safe mode = Off with the 4 commands I listed in my last thread and my
> actual code is using an echo = "$tailed";

  echo = "$tailed";

is not good code. Please learn some basic PHP first!

> I even tried to remove the -f and replaced it with a -n 600 (for six
> hundred lines to be output) and it still wont place the $tailed var into
> the textarea.  It will output to the screen but not to the textarea, I
> am just going to scrap it and try it a different way.

Each of the "4 commands I listed in my last thread" has a different 
functionality. As you have noted one of them just outputs directly whatever 
system function is being executed. Read the descriptions of the 'commands' 
carefully and choose the one appropriate for the job.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
We don't know who it was that discovered water, but we're pretty sure
that it wasn't a fish.
-- Marshall McLuhan
*/

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



RE: [PHP] system command?

2004-05-10 Thread Jay Blanchard
[snip]
$tailed";
?>
[/snip]

I forgot to take out the "="

$tailed";
?>

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



RE: [PHP] system command?

2004-05-10 Thread Adam Voigt
lol

On Mon, 2004-05-10 at 11:16, Jay Blanchard wrote:
> [snip]
> I didn't sent off list
> [/snip]
> 
> I am in an relatively crappy mood this day, you may want to NOT refute
> something I have said and in essence call me a liar. You'll get little
> help that way.
> 
> P.S. Stop top posting too.
-- 

Adam Voigt
[EMAIL PROTECTED]

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



RE: [PHP] system command?

2004-05-10 Thread Jay Blanchard
[snip]
I didn't sent off list
[/snip]

I am in an relatively crappy mood this day, you may want to NOT refute
something I have said and in essence call me a liar. You'll get little
help that way.

P.S. Stop top posting too.

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



RE: [PHP] system command?

2004-05-10 Thread Jay Blanchard
[snip]
I didn't sent off list, always to php.general in reply to whatever 
message thread I am in.  In any event, I have tried safe mode = On and 
safe mode = Off with the 4 commands I listed in my last thread and my 
actual code is using an echo = "$tailed";

>>>$tailed = shell_exec('tail -f /path/to/log');
>>//$tailed = exec('tail -f /path/to/log');
>>//$tailed = system('tail -f /path/to/log');
>>print = "$tailed";
>>?>
[/snip]

$tailed";
?>

I can only think that it must be a permissions issue. What happens if
you run the script from the command line?

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



Re: [PHP] system command?

2004-05-10 Thread Jas
I didn't sent off list, always to php.general in reply to whatever 
message thread I am in.  In any event, I have tried safe mode = On and 
safe mode = Off with the 4 commands I listed in my last thread and my 
actual code is using an echo = "$tailed";

I even tried to remove the -f and replaced it with a -n 600 (for six 
hundred lines to be output) and it still wont place the $tailed var into 
the textarea.  It will output to the screen but not to the textarea, I 
am just going to scrap it and try it a different way.

Cheers,
Jas
Jay Blanchard wrote:

[snip]
It is now... but it still doesn't work.  I have tried passthru(), 
exec(), shell_exec() & system() trying to tail -f a log file into a 
textarea box and I get nothing or the output is put in the headers and 
stops the rest of the page from loading.  I am at a loss.

Jay Blanchard wrote:


[snip]
Anyone know what this wouldn't work?  I have tried using a couple of 
functions defined at http://us2.php.net/manual/en/ref.exec.php and
none 

seem to have the desired effect.

$tailed";
?>
[/snip]
Is PHP running in safe mode? 
[/snip]

a. safe mode must be OFF
b. you must remove the "=" from the print statement, should be thrwoing
a syntax erro
c. get rid of the -f as it will not continue to update the text area
d. do not reply off-list unless requested
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] system command?

2004-05-10 Thread Jay Blanchard
[snip]
It is now... but it still doesn't work.  I have tried passthru(), 
exec(), shell_exec() & system() trying to tail -f a log file into a 
textarea box and I get nothing or the output is put in the headers and 
stops the rest of the page from loading.  I am at a loss.

Jay Blanchard wrote:

> [snip]
> Anyone know what this wouldn't work?  I have tried using a couple of 
> functions defined at http://us2.php.net/manual/en/ref.exec.php and
none 
> seem to have the desired effect.
> 
>  $tailed = shell_exec('tail -f /path/to/log');
> //$tailed = exec('tail -f /path/to/log');
> //$tailed = system('tail -f /path/to/log');
> print = "$tailed";
> ?>
> [/snip]
> 
> Is PHP running in safe mode? 
[/snip]

a. safe mode must be OFF
b. you must remove the "=" from the print statement, should be thrwoing
a syntax erro
c. get rid of the -f as it will not continue to update the text area
d. do not reply off-list unless requested

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



Re: [PHP] system command?

2004-05-10 Thread John Nichel
Jas wrote:
Anyone know what this wouldn't work?  I have tried using a couple of 
functions defined at http://us2.php.net/manual/en/ref.exec.php and none 
seem to have the desired effect.

$tailed";
?>
Thanks in advance,
Jas
'tail -f' won't exit.

--
John C. Nichel
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] system command?

2004-05-10 Thread Daniel Purdy
[snip]
> Anyone know what this wouldn't work?  I have tried using a couple of
> functions defined at http://us2.php.net/manual/en/ref.exec.php and
none 
> seem to have the desired effect.
> 
>  $tailed = shell_exec('tail -f /path/to/log');
> //$tailed = exec('tail -f /path/to/log');
> //$tailed = system('tail -f /path/to/log');
> print = "$tailed";
> ?>
[/snip]

Take a look at your print statement, print =
"$tailed";
That should throw a parse error. Try print("" . $tailed .
"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] system command?

2004-05-10 Thread Adam Voigt
I believe when you add the -f flag, the tail command doesn't exit, it
just keeps printing as data is appended to the log, did you try dropping
the -f flag?


On Mon, 2004-05-10 at 10:15, Jas wrote:
> Anyone know what this wouldn't work?  I have tried using a couple of 
> functions defined at http://us2.php.net/manual/en/ref.exec.php and none 
> seem to have the desired effect.
> 
>  $tailed = shell_exec('tail -f /path/to/log');
> //$tailed = exec('tail -f /path/to/log');
> //$tailed = system('tail -f /path/to/log');
> print = "$tailed";
> ?>
> 
> Thanks in advance,
> Jas
-- 

Adam Voigt
[EMAIL PROTECTED]

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



  1   2   >