[PHP] error when running commands via exec() in CLI-mode

2004-06-04 Thread Alberto Mucignat
I do this:
?php
$cmd = 'rsync -Razv file.php [EMAIL PROTECTED]::zone';
@exec($cms, $log, $ret);
?
when an rsync error occure, if I run this script by a web server I get 
no output (errors go correctly into $log and $ret), while running the 
script in a console environment I get errors in the standard output even 
if I suppress them with @.

anyone knows a workaround? is this a bug?
bye, alberto.
--
Imagination is more important than knowledge
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] read file

2001-11-23 Thread Alberto Mucignat

Il ven, 23 nov 2001, hai scritto:
 hi,
 andrey hristov told me how to read a file and put it into a table (thx)
 but now i see that i need the data in an array.
 can somebody help me please?

just use the first line of Andrey:

$content = file('file_name.txt');

file function reads entire file into an array (from the manual).


bye, alberto.

 
 thx
 
 On Friday 23 November 2001 10:16, Andrey Hristov wrote:
  $content = file('file_name.txt');
  $HTML .='table';
  foreach ($content as $v){
  $HTML .='trtd'.$v.'/td/tr';
  }
  $HTML .='/table';
  echo $HTML;
 
  Regards
  Andrey Hristov
  IcyGEN Corporation
  http://www.icygen.com
  BALANCED SOLUTIONS
 
 
  - Original Message -
  From: PHP Newbie [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Friday, November 23, 2001 11:00 AM
  Subject: [PHP] read file
 
   hi,
   i have a file with ips inside
  
   192.168.1.1
   192.168.1.2
   ...
  
   now i must write that in a html table with php.
   i think that is easy, but i'm a newbie and don't find anything how to do
   it.
  
   please help me
  
   thx
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
-- 
Alberto Mucignat
Direttore Tecnico
Studenti.it - il network degli studenti
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] possible problems working with sessions

2001-11-22 Thread Alberto Mucignat


well, if you're using default session handling provided with php, users
sessions are stored in /tmp directory (also used by default for temporary
caching of uploaded files). assume to have the php.ini file with default
settings:

session.gc_probability = 1
session.gc_maxlifetime = 1440

this means garbage collector lauched 1 times every 100 started sessions.
furthermore, deletable sessions are those ones opened 1440 seconds ago (24
minutes).

well, i've doing some tries asking web server the following by wget command,
(but i suppose you can use also a sockopen or CURL (!) functions...):

HEAD /test_session.php HTTP/1.0

where /test_session.php simply starts a session with session_start()
function. every single request create a session file in the /tmp server
directory. if someone find out how to do many simultanious requests could
create so many files in the /tmp dir (while the garbage clean them only after
24 minutes).

we know that linux filesystem is limited to 64K files per directory. this could
create problems...

obviously there are some kind of solutions...
- play with session.gc_* php settings in order to prevent problems (but i
can't be sure that's a good idea...)
- provide a different session storage than the default one. in this case, you
have only two other solutions: mm and database storage. i prefer to store
sessions in a database, because with mm this could generate worse problems
with memory usage...

but i mean... there are so many php developers that uses php with default
settings (for example: newbies that uses phpnuke or other php content manager
session based)...

about sessions i've found:
http://www.phpwizard.net/resources/tutorials/session_intro.html
seen Tobias around? :-)

bye, alberto.

ps: well, i work with session since not long time, so can be i made a
mistake...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] error_log problems

2001-11-21 Thread Alberto Mucignat


hi all

i've tried to redirect error logging in a different file than the web server error 
file.
in php.ini file:
error_log=/var/log/httpd/php_error_log
but it doesn't work correctly: it doesn't create/write the file php_error_log

while if in the php.ini file i put:
error_log = syslog
it works corretly writing errors on /var/log/messages...

i use Linux Suse 7.2 with apache 1.3.22 and PHP Version 4.0.6

some suggestions?

bye, alberto.

-- 
Alberto Mucignat
Direttore Tecnico
Studenti.it - il network degli studenti
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]