PHP mkdir in linux filesystem - ownership and protection problems

A correct directory is being created by my mkdir($path)   function call.
However, the owner is shown as 99 (which means nobody),  and the protection is always 755  (whether or not it defaults in the second parameter).
(the protection is supposed to default to  0777)

what do i tell my system maintainer to get  programmatically created directories to work?
their solution was to run a cron job every 5 minutes to reset the owner to that of the account's username.
(but that doesn't fix protections, which need to be correct in the very next PHP statement where a file is to be created)

PHP 5.2.17   kernel 2.6.32    LAMP system with cPanel

Their reply:
In the DSO the created files will have files will have the user "nobody".
[~]# /usr/local/cpanel/bin/rebuild_phpconf --current Available handlers: suphp dso cgi none DEFAULT PHP: 5
PHP4 SAPI: none
PHP5 SAPI: dso
SUEXEC: enabled
RUID2: not installed


any suggestions for getting owner and protection to be workable?
willsherwoodAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
Well for starters, PHP 5.2 is not just old -- it's obsolete, so you want to upgrade to a current version of PHP as soon as possible.  PHP 5.3 just went into end of life, so your choices are PHP 5.4+ or PHP 5.5+. The former will be supported through 2015.  The latter until at least 2016.

The owner of PHP files is usually PHP, and PHP usually runs as "nobody."  That seems normal.

If you need to change permissions, you can use chmod().  There are other functions in the filesystem commands that might be useful, depending on exactly what you need to do.
http://www.php.net/manual/en/ref.filesystem.php
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
willsherwoodAuthor Commented:
even tho the second parameter of mkdir had no effect,  calling the additional chmod  DID WORK!
many thanks!
0
Ray PaseurCommented:
Thanks for the points.  Seems like every computer system is a little different.   Last night at the DCPHP meeting after-party we were nerding out about case-sensitivity in file systems.  What if your auto-loader is not case sensitive, but your file system is?  You can get the same kind of effect you're seeing here -- you did everything right and it still didn't work!  Sometimes it's just trial and error :-(
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.