[PHP] strange issue with PHP $basename, first character in filename missing (FreeBSD)

2009-10-25 Thread Per olof Ljungmark

Sorry for the long post but this problem have plagued us for a few
months and we suspect that this is a OS-specific issue with
FreeBSD/PHP, AFAICS it has not been reported from the Linux camp. I'm
posting here in the hope that someone on this list might have a clue.

In brief, intermittently, the first character in a file name is lost
using the PHP basename function. Below is an excerpt from a Horde
webmail server's log that shows the error.

More reading can be found on the Horde list here:
http://marc.info/?l=hordem=124653708009981w=2
and here
http://marc.info/?l=hordem=124683029904466w=2


- Problem is present on both FreeBSD 6.4 and 7-STABLE
- We see it on two boxes so it's not limited to a single server
- It has occurred on all PHP versions since this year, approx from the
time of PHP 5.2.8 or 9
- It is intermittent - no real pattern
- It does not matter if we use the Horde cache or not, if we use a cache
via PHP or not, have tried a *lot* of configurations to no avail.


A more detailed log:

Obviously, we are looking for memcache.php but $basename sometimes
returns emcache.php.

--
[21-Oct-2009 07:28:28] after basename d string(8) memcache
string(7) emcache

[21-Oct-2009 07:28:28] backtrace NULL
string(7) emcache
#0  Horde_Cache-factory(memcache, Array ([hostspec] = Array ([0] =
localhost),[port] = Array ([0] = 11211),[weight] = Array
(),[persistent] = ,[compression] = ,[large_items] = 1,[enabled] =
1)) called at [/usr/local/www/horde/lib/Horde/Cache.php:234]
#1  Horde_Cache-singleton(memcache, Array ([hostspec] = Array ([0] =
localhost),[port] = Array ([0] = 11211),[weight] = Array
(),[persistent] = ,[compression] = ,[large_items] = 1,[enabled] =
1)) called at [/usr/local/www/horde/lib/Horde/Perms/sql.php:57]
#2  Perms_sql-Perms_sql(Array ([username] = horde,[password] =
password,[protocol] = unix,[database] = horde,[charset] =
iso-8859-1,[splitread] = ,[ssl] = ,[phptype] = mysqli)) called at
[/usr/local/www/horde/lib/Horde/Perms.php:462]
#3  Perms-factory(sql, Array ([username] = horde,[password] =
password,[protocol] = unix,[database] = horde,[charset] =
iso-8859-1,[splitread] = ,[ssl] = ,[phptype] = mysqli)) called at
[/usr/local/www/horde/lib/Horde/Perms.php:496]
#4  Perms-singleton() called at
[/usr/local/www/horde/lib/Horde/Registry.php:278]
#5  Registry-Registry(0) called at
[/usr/local/www/horde/lib/Horde/Registry.php:139]
#6  Registry::singleton() called at
[/usr/local/www/horde/imp/lib/base.php:49]
#7  require_once(/usr/local/www/horde/imp/lib/base.php) called at
[/usr/local/www/horde/imp/redirect.php:89]
#8  require(/usr/local/www/horde/imp/redirect.php) called at
[/usr/local/www/horde/imp/index.php:26]
NULL

[21-Oct-2009 07:28:28] PHP Warning:
include_once(Horde/Cache/emcache.php) [a
href='function.include-once'function.include-once/a]: failed to open
stream: No such file or directory in
/usr/local/www/horde/lib/Horde/Cache.php on line 194
[21-Oct-2009 07:28:28] PHP Warning:  include_once() [a
href='function.include'function.include/a]: Failed opening
'Horde/Cache/emcache.php' for inclusion
(include_path='/usr/local/www/horde/lib:.:/usr/local/share/pear') in
/usr/local/www/horde/lib/Horde/Cache.php on line 194
[21-Oct-2009 07:28:39] after basename d string(8) memcache
string(7) emcache


Thank you for reading...
--
per

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



Re: [PHP] php mail() function

2009-10-24 Thread Per olof Ljungmark

James Prentice wrote:

It sends the bounced message to /var/mail/www-data and I get this:

--19BE8A70109.1256417846/homemade
Content-Description: Delivery report
Content-Type: message/delivery-status

Reporting-MTA: dns; homemade
X-Postfix-Queue-ID: 19BE8A70109
X-Postfix-Sender: rfc822; www-d...@homemade
Arrival-Date: Sat, 24 Oct 2009 13:57:26 -0700 (PDT)

Final-Recipient: rfc822; x...@shaw.ca
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; shawmail.vc.shawcable.net

--19BE8A70109.1256417846/homemade
Content-Description: Undelivered Message
Content-Type: message/rfc822

Received: by homemade (Postfix, from userid 33)
id 19BE8A70109; Sat, 24 Oct 2009 13:57:26 -0700 (PDT)
To: x...@shaw.ca


Although 5.0.0 actually means something else I'm pretty sure you are 
rejected because of an invalid sender address or domain. Use a sender 
address that is valid with your ISP's mail relay.


Just my $0.02

--
per

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