Zubrag.com :: Forum

zubrag.com => Questions About Our Scripts => cPanel Scripts => Topic started by: jylyn on January 24, 2007, 12:47:34 AM

Title: Create subdomain with index page - permissions problem
Post by: jylyn on January 24, 2007, 12:47:34 AM
I've just downloaded the subdomain creator and am finding it really useful.

My problem is that I would like to have an index page inside the newly created directory, but my script doesn't have the permissions to write to it.  How do I get around this?
Title: Re: Create subdomain with index page - permissions problem
Post by: zubrag on January 24, 2007, 01:17:57 AM
Does your script have permissions to change permissions on newly created folder? If so you could add following php code after directory created:


// everything for owner, read and execute for others
chmod('/path/to/the/folder/here', 0755);


if that does not work then you could try changing 0755 to 0775 or 0777.

It should allow creating index page after that.
Title: Re: Create subdomain with index page - permissions problem
Post by: jylyn on January 24, 2007, 04:57:30 AM
Thanks, I tried that, but the script didn't have permission to change the permissions either.

I tried to extend your script to change the permissions via cPanel but only succeeded in locking myself out of the fileserver altogether!  I guess that's why you're the one writing the code, not me :-D
Title: Re: Create subdomain with index page - permissions problem
Post by: jylyn on January 24, 2007, 05:14:47 AM
Problem solved.

I just created the folder and contents before creating the subdomain...
Title: Re: Create subdomain with index page - permissions problem
Post by: zubrag on January 24, 2007, 10:12:27 AM
Thanks for sharing!