[PHP] bug in mkdir?

2010-06-10 Thread Mike Wright

Hi all,

Using 5.2.9

I'm trying to create a directory but it is being created with incorrect 
permissions.  I'm following the online manual.


This is the command being used:

mkdir('/srv/www/domain/data/R1276190214358/thumbs', 0770, true);

This is what is created:

drwxr-x--- 2 apache apache 4096 2010-06-10 10:33 R1276190214358

Isn't that supposed to be 0770 instead of 0750?  Either the manual is 
wrong, the command is broken, or I'm screwing it up (most likely).


Thanks for any help,
Mike Wright

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



Re: [PHP] bug in mkdir? [SOLVED]

2010-06-10 Thread Mike Wright

Ashley Sheridan wrote:

On Thu, 2010-06-10 at 11:32 -0700, Mike Wright wrote:


Hi all,

Using 5.2.9

I'm trying to create a directory but it is being created with incorrect 
permissions.  I'm following the online manual.


This is the command being used:

 mkdir('/srv/www/domain/data/R1276190214358/thumbs', 0770, true);

This is what is created:

 drwxr-x--- 2 apache apache 4096 2010-06-10 10:33 R1276190214358

Isn't that supposed to be 0770 instead of 0750?  Either the manual is 
wrong, the command is broken, or I'm screwing it up (most likely).


Thanks for any help,
Mike Wright





Hi, Ash.  Thanks for the help.


Did the R1276190214358 directory already exist?


No.

 If so, it will retain

the permissions it had, and only the thumbs sub-directory within it will
have the new permissions.

Also, is this on a shared hosting server? It could be that a security
restriction in-place is not allowing the permissions to be configured as
the directory is written, and you may have to manually update them with
the chmod() function.


It's under my control.

Solution: run umask(000) first.  (of the 3 choices above it turned out 
to be #3 ;(



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



[PHP] mail command failing

2010-06-29 Thread Mike Wright

Hi all,

I'm very puzzled by this.  I've been using the php mail command for 
years but now I can't get it to work and can't figure out how to 
diagnose the problem.


The code below was copied from the manual (addresses changed, etc); 
php.ini has safe_mode off; binary is at /usr/sbin/sendmail.


\r\n"; //optional headerfields

$echo = mail($recipient, $subject, $body, $header) ? 'success':'fail';
echo "$echo";

I can access the mail server with "/usr/bin/mailx" and by telnet 
"localhost 25".  I can also send mail using php by using 'exec (" echo 
$body | mailx -s $subject $recipient")'.


php-5.2.29 on fedora10 with apache 2.2.14.  Can this be selinux related?

Any ideas or troubleshooting tips?

Thanks,
Mike Wright

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



Re: [PHP] mail command failing

2010-06-29 Thread Mike Wright

Ashley Sheridan wrote:

On Tue, 2010-06-29 at 10:00 -0700, Mike Wright wrote:


Hi all,

I'm very puzzled by this.  I've been using the php mail command for 
years but now I can't get it to work and can't figure out how to 
diagnose the problem.



php-5.2.29 on fedora10 with apache 2.2.14.  Can this be selinux related?



The first ini_set variable you're setting I believe will only work for a
Windows server.

Aside from that, yes SELinux does prevent the mail command from sending
mail by default. I'm using Fedora 11, so I assume it will be similar;
there are config tools for setting SELinux policies, or you could even
turn it off (not advised on a live server). As a test, try turning it
off temporarily just to see if it is the culprit, then you can determine
what policy changes need to be made.



Thanks, Ash, but no cigar.  Selinux is set disabled.  Absolutely baffled 
and confounded that there doesn't seem to be a way to diagnose the problem.


Mike

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



Re: [PHP] [SOLVED]mail command failing

2010-06-29 Thread Mike Wright

Mike Wright wrote:

Hi all,

I'm very puzzled by this.  I've been using the php mail command for 
years but now I can't get it to work and can't figure out how to 
diagnose the problem.


I can access the mail server with "/usr/bin/mailx" and by telnet 
"localhost 25".  I can also send mail using php by using 'exec (" echo 
$body | mailx -s $subject $recipient")'.


php-5.2.29 on fedora10 with apache 2.2.14.  Can this be selinux related?


I'm using Zend Server Community Edition.  Apparently it is launched 
pointing to a different php.ini (/usr/local/zend/etc/php.ini) and the 
libphp5.so is compiled WITHOUT a sendmail path.


Even though I used "ini_set('sendmail_path', '/usr/sbin/sendmail')" in 
the program it apparently had no effect.


Only after setting the path in Zend Server CE's php.ini would the mail 
command work.


Zend claims it is not a bug stating, "even though the traditional path 
is /usr/sbin/sendmail one cannot always be certain that is true for all 
distributions".


10 days on this and miles behind schedule...

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