Jump to content

eki33

New Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by eki33

  1. Thanks for your replies, Not catched by my function : PHP Warning: Division by zero... PHP Notice: Undefined index... PHP Parse error: syntax error, unexpected...
  2. Hi, I'm confused with PHP errorhandling. I wrote this in order to record erros into a session array variable (an display it later to debug...) : error_reporting(-1); // reporte tous les types d'erreurs set_error_handler("handleError"); session_start(); function handleError($errno, $errstr,$error_file,$error_line) { if (!isset($_SESSION['errorLogCounter'])) $_SESSION['errorLogCounter'] = 1; else $_SESSION['errorLogCounter']++; $errorDate = date("Y-m-d H:i:s (T)"); $newstring = "<b>Error Number $_SESSION[errorLogCounter]</b><br/>Date : $errorDate<br/> Error type : $errno <br/> Description : $errstr <br/> Fichier : $error_file <br/> ligne : $error_line <br/> --------------- <br/><br/>"; $_SESSION['errorlog'][$_SESSION['errorLogCounter']] = $newstring; } but it only record error and no NOTICE (owever notices are well recorder in php_error.log), why ?
  3. Hello, I stored a fsockopen function in a separate "called.php" file, in order to run it as another thread when it needs. The called script should return results to the "master.php" script. I'm able to run the script to get the socket working, and I'm able to get results from the called script. I tried for hours but I can't do the twice both My master.php script (with socket working): <?php $command = "(/mnt/opt/www/called.php $_SERVER[REMOTE_ADDR] &) > /dev/null"; $result = exec($command); echo ("result = $result\r\n"); ?> and my called.php script #!/mnt/opt/usr/bin/php-cli -q <?php $device = $_SERVER['argv'][1]; $port = "8080"; $fp = fsockopen($device, $port, $errno, $errstr, 5); fwrite($fp, "test"); fclose($fp); echo ("normal end of the called.php script"); ?> In the master script, if I use $command = "(/mnt/opt/www/called.php $_SERVER[REMOTE_ADDR] &) > /dev/null"; the socket works, but I have nothing in $result (note also that I don't anderstand why the ( ... &) are needed!?) and if I use $command = "/mnt/opt/www/called.php $_SERVER[REMOTE_ADDR]"; I have the correct text "normal end of the called.php script" in $result but the socket connection is not performed (no errors in php logs) Could you help me to find a way to let's work the two features correctly together? Thank you.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.