PHP Warning Issue

Support/Development for PHP
User avatar
JnascECSI
Forum Regular
Forum Regular
Posts: 306
Joined: Mon Apr 14, 2008 8:29 am
Location: Rhode Island

PHP Warning Issue

Unread post by JnascECSI »

We have a system for our corporation, the tracks leads and other business related junk. Anyways in the last week we've been having trouble with our system failing to send emails on new user accounts that are created. After doing some checking and now trying to narrow down what the actual cause is i'm stumped or just missing the obviouse.

This is the error i'm getting below on any account creation and not being a PHP guru i'm lost because it was working last week when we updated php and mysql now seems to be junked. Any help would be great.

[Mon Feb 15 09:17:11 2010] [error] [client xx.xx.74.2] PHP Warning: fopen(/var/www/vhosts/xxxxxxxxx.com/httpdocs/config/../temp/maillog.txt) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied in /var/www/vhosts/xxxxxxxxx.com/httpdocs/lib/mail.inc.php on line 120, referer: https://www.xxxxxxxxx.com/user.php
[Mon Feb 15 09:17:11 2010] [error] [client xx.xx.74.2] PHP Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/vhosts/xxxxxxxxx.com/httpdocs/lib/mail.inc.php on line 122, referer: https://www.xxxxxxxxx.com/user.php
[Mon Feb 15 09:17:11 2010] [error] [client xx.xx.74.2] PHP Warning: fclose(): supplied argument is not a valid stream resource in /var/www/vhosts/xxxxxxxxx.com/httpdocs/lib/mail.inc.php on line 123, referer: https://www.xxxxxxxxx.com/user.php
[Mon Feb 15 09:17:11 2010] [error] [client xx.xx.74.2] PHP Warning: fopen(/var/www/vhosts/xxxxxxxxx.com/httpdocs/config/../temp/maillog.txt) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied in /var/www/vhosts/xxxxxxxxx.com/httpdocs/lib/mail.inc.php on line 120, referer: https://www.xxxxxxxxx.com/user.php
[Mon Feb 15 09:17:11 2010] [error] [client xx.xx.74.2] PHP Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/vhosts/xxxxxxxxx.com/httpdocs/lib/mail.inc.php on line 122, referer: https://www.xxxxxxxxx.com/user.php
[Mon Feb 15 09:17:11 2010] [error] [client xx.xx.74.2] PHP Warning: fclose(): supplied argument is not a valid stream resource in /var/www/vhosts/xxxxxxxxx.com/httpdocs/lib/mail.inc.php on line 123, referer: https://www.xxxxxxxxx.comom/user.php
[Mon Feb 15 09:17:11 2010] [error] [client xx.xx.74.2] PHP Warning: fopen(/var/www/vhosts/xxxxxxxxx.com/httpdocs/config/../temp/maillog.txt) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Permission denied in /var/www/vhosts/xxxxxxxxx.com/httpdocs/lib/mail.inc.php on line 120, referer: https://www.xxxxxxxxx.com/user.php
[Mon Feb 15 09:17:11 2010] [error] [client xx.xx.74.2] PHP Warning: fwrite(): supplied argument is not a valid stream resource in /var/www/vhosts/xxxxxxxxx.com/httpdocs/lib/mail.inc.php on line 122, referer: https://www.xxxxxxxxx.com/user.php
[Mon Feb 15 09:17:11 2010] [error] [client xx.xx.74.2] PHP Warning: fclose(): supplied argument is not a valid stream resource in /var/www/vhosts/xxxxxxxxx.com/httpdocs/lib/mail.inc.php on line 123, referer: https://www.xxxxxxxxx.com/user.php



This is the code in the mail.inc.php file that the error is complaining about. Everything seems ok to me but as usual i'm probably wrong.
118 if(!$to) return;
119 $fname=DOCUMENT_ROOT . '/temp/maillog.txt';
120 $f=fopen($fname,"a+");
121 $s=date("Y-m-d H:i:s")."\t To:$to\n\tsubj:$subj\n\theaders:$headers\n\tbody:$body\n\n";
122 fwrite($f,$s);
123 fclose($f);
James Nascimento
Chief Information Officer
East Commerce Solutions, Inc.
22 Morris Lane
East Providence, RI 02914
Ph. 800-527-5395 x263
Fax. 888-999-5891
User avatar
JnascECSI
Forum Regular
Forum Regular
Posts: 306
Joined: Mon Apr 14, 2008 8:29 am
Location: Rhode Island

Re: PHP Warning Issue

Unread post by JnascECSI »

Ok,
Well narrowed it down to qmail some what i think. noticed on a couple other domains that scipted emails were having problems sending also and then started seeing this error with some domains using pop/smtp with outlook " Result: delayed, Status: 4.3.2 451 qq temporary problem (#4.3.0) " . Once i rebooted the server php scripted emails and pop/smtp emails started working with no errors.

Trying to narrow down what the domains have in common which i think is the nightly backups. Anyone ever see this happen or something similar?
James Nascimento
Chief Information Officer
East Commerce Solutions, Inc.
22 Morris Lane
East Providence, RI 02914
Ph. 800-527-5395 x263
Fax. 888-999-5891
Post Reply