I lately moved this site to a different host and today am going through some damaged code..

I've an uploading script that's now coming back this:

move_submitted_file() unsuccessful to spread out stream: Permission refused in *..

I have set the upload directory to 777 which labored fine, but my script is required to have top level permissions..

(Because the script itself sets permission to sites, does plenty of copying etc)

It is possible to means by apache I'm able to set the PHP script to who owns all of the folders on my small server?

Thanks

Also When searching in phpInfo()

Under apache2handler

User/Group  nobody(99)/99 

Is related?

I would not go down that path, just provide permissions towards the defined upload_tmp_dir, or define upload_tmp_dir to become a directory you can get. If it's that directory you experience. When the target may be the problem, and you've 777'ed it, something fishy is happening.

Have you got ssh use of your brand-new host? The main reason I request is the fact that it's most likely not better to make use of the username/group as nobody, since many other services would make use of this too. I'd change it out to something similar to apache

After that you can update httpd.conf, including both of these lines (reloading the config after):

User apache
Group apache

Then, run chown apache:apache -R dir_name to create apache purchased it.

well, When you're attempting to set the permission like "0777", you have to be running on same authority.

I mean ,. For instance, your script informs to alter a folder/file permission to 0777, however the folder or file already includes a permission which is '0755' so you aren't authorised to create that change. because the user only have 5 authority.

Either, you have to login to FTP and alter the folder permission to 0777 and you have full treatments for it or you need to stick to using 0755 or similar.