php moving files and permissions

mofolo

New Member
Hey there,

I just upgraded from shared to KH VPS..

Now my website's code seems to be broken in some place (which I have come to expect).

The most puzzling is this error:

Warning: move_uploaded_file(/home/myreposp/public_html/debfiles/1/simplyleopard_theme[0].deb) : failed to open stream: Permission denied in /home/myreposp/public_html/account/addpackage.php on line 85

Warning: move_uploaded_file() []: Unable to move '/tmp/phpNj2KNA' to '/home/myreposp/public_html/debfiles/1/simplyleopard_theme[0].deb' in /home/myreposp/public_html/account/addpackage.php on line 85
It seems like a permission problem.

I understand that I can change the permissions to allow 'other' write permissions, but I'd like to know if there is a way to make the website think that the php scripts are run under 'owner'?

Thanks.
 

Dan

Moderator
Hello Mofolo,

Sounds to me like you need to enable suPHP.

In WHM go to Service Configuration | Apache Configuration | PHP and SuExec Configuration

Then make sure the default PHP version is set to 5 and for the PHP handler select suPHP and set Apache suEXEC to On.

Save the new configuration and you should be good to go!
 

Dan

Moderator
When you upload the file do you upload it as root and then try to run it as a user? Be sure to chown it to the user whose account you put it into :)
 

exoexo

New Member
Hello Mofolo,

Sounds to me like you need to enable suPHP.

In WHM go to Service Configuration | Apache Configuration | PHP and SuExec Configuration

Then make sure the default PHP version is set to 5 and for the PHP handler select suPHP and set Apache suEXEC to On.

Save the new configuration and you should be good to go!
Thanks a lot! I was just wondering how to make all my websites save files and started chmod 777 folders, but there are 100s folders to chmod. And you saved me ;) Now looks like scripts again can save files as they did before at stupid shared lol
 
Top