Bug #76663 [Nab]: fwrite(): send of X bytes failed with errno=32 Broken pipe

From: Date: Wed, 25 Jul 2018 16:25:12 +0000
Subject: Bug #76663 [Nab]: fwrite(): send of X bytes failed with errno=32 Broken pipe
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-216451@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76663&edit=1 ID: 76663 User updated by: standus at post dot cz Reported by: standus at post dot cz Summary: fwrite(): send of X bytes failed with errno=32 Broken pipe Status: Not a bug Type: Bug Package: *General Issues Operating System: CentOS, linux, windows PHP Version: 7.0.31 Block user comment: N Private report: N New Comment: By me when some function is impossible catch it or prevent problem with @ prefix its big problem which broken long running script. I except when fwrite function return false when some uncatchable problem will happen. Previous Comments: ------------------------------------------------------------------------ [2018-07-25 16:22:24] standus at post dot cz Other way is that in documentation for fwrite is return status if this function will fail but its not happen. ------------------------------------------------------------------------ [2018-07-25 15:45:58] requinix@php.net The only place in that code with an fwrite() is where it tries to write to a socket. Sockets break. It happens. ------------------------------------------------------------------------ [2018-07-25 15:38:41] standus at post dot cz Afted that some PHP function has some problem with DNS resolver. ------------------------------------------------------------------------ [2018-07-25 15:38:36] requinix@php.net Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. https://github.com/semplon/php-smtp-email-validation/issues ------------------------------------------------------------------------ [2018-07-25 15:37:01] standus at post dot cz Description: ------------ I have code for testing huge of emails existence. Using functions: getmxrr($domain, $hosts, $mxweights); gethostbyname($host); After 1 or 2 hours cron runnig it will fail with errors: fwrite(): send of 38 bytes failed with errno=32 Broken pipe fwrite(): send of 29 bytes failed with errno=104 Connection reset by peer A am using simple php class which dooing this functionality: https://github.com/semplon/php-smtp-email-validation Test script: --------------- // include SMTP Email Validation Class require_once('smtp_validateEmail.class.php'); // the email to validate $emails = array('user@example.com', 'user2@example.com', ...); //or foreach from DB storage // an optional sender $sender = 'user@yourdomain.com'; // instantiate the class $SMTP_Validator = new SMTP_validateEmail(); // turn on debugging if you want to view the SMTP transaction $SMTP_Validator->debug = true; // do the validation $results = $SMTP_Validator->validate($emails, $sender); // view results foreach($results as $email=>$result) { // send email? if ($result) { //mail($email, 'Confirm Email', 'Please reply to this email to confirm', 'From:'.$sender."\r\n"); // send email } else { echo 'The email address '. $email.' is not valid'; } } Expected result: ---------------- no errors ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=76663&edit=1

« previous php.bugs (#216451) next »