Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to create a script installer on a VPS with Cpanel api and WHM access (btw: hostgator), which will do the following: When user registers on my site - with my custom installer script), the script will create a CPanel account with WHM API. After that I'll need to copy a bunch of files to user's new directory from my main directory. for example:

  • my script which should do the copy operation is in /home/[main reseller account]/public_html/register.php
  • source files for copy operation are here /home/[main reseller account]/public_html/script_base
  • I need to copy that into /home/[newly created user account]/public_html/

The problem is I have no permission to access /home/[newly created user account]/public_html/ from my script which is in the folder /home/[main reseller account]/public_html/script_base

I could use FTP and upload files to user's public_html one by one, by I would really want to avoid that if possible.

Any idea is appreciated, and thanks in advance for your help!

share|improve this question

migrated from Feb 3 '11 at 18:20

This question came from our site for professional and enthusiast programmers.

C-Panel/WHM does support a 'skeleton' directory.. But this question is off topic for SO. – Tim Post Feb 3 '11 at 18:19

What is causing this permission issue? php open_basedir? In that case you can try setting in Apache:

php_admin_value open_basedir none

And that way you can access any folder using PHP.

You could also change (temporarily) the permissions of the new_user_account folder using chmod or chown from php.

share|improve this answer
Thanks for the reply... and sorry: It's not a VPS it's a reseller account, and I don't think I have permission to change anything that would allow me to access any folder from PHP because there is like 1000 another account on the server which is not mine. – bboldi Feb 4 '11 at 8:27
Ok, no success with this. I have just used ftp protocol with the newly created cpanel user to upload one zip file and an installer which unzips it on the server... thanks for your comments though! – bboldi Feb 10 '11 at 8:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.