FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Folder Permissions
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Folder Permissions [message #178966] Tue, 28 August 2012 12:28 Go to next message
BigNate is currently offline  BigNate
Messages: 7
Registered: February 2011
Karma: 0
Junior Member
Hi folks
I have an site I've set up where I create a directory using PHP using mkdir(). That works great and I'm writing files within it using the same script.. The problem I came across this morning is while manually moving files from an old version to the new directory via ftp. I'm getting a permissions error saying Access is denied. I believe it is due to the owner of the folder that I created using mkdir() is different than the one I'm using to copy the files to, but I'm not sure how to fix this. Can I change it while creating the directory in the first place or is it possible to modify it in cpanel for a short time so I can copy my files and then change it back? Any help would be appreciated.

If you have any ideas or need more info, please let me know.
Re: Folder Permissions [message #178968 is a reply to message #178966] Tue, 28 August 2012 13:08 Go to previous messageGo to next message
The Natural Philosoph is currently offline  The Natural Philosoph
Messages: 993
Registered: September 2010
Karma: 0
Senior Member
BigNate wrote:
> Hi folks I have an site I've set up where I create a directory using
> PHP using mkdir(). That works great and I'm writing files within it
> using the same script. The problem I came across this morning is
> while manually moving files from an old version to the new directory
> via ftp. I'm getting a permissions error saying Access is denied. I
> believe it is due to the owner of the folder that I created using
> mkdir()

That will be the web server permissions

> is different than the one I'm using to copy the files to,

Copy files WITH - that will be your FTP login....


> but
> I'm not sure how to fix this. Can I change it while creating the
> directory in the first place

A chmod should work within a php script

chmod("directory name", 0777);

should work.

You only need do it once.




or is it possible to modify it in cpanel
> for a short time so I can copy my files and then change it back? Any
> help would be appreciated.
>

CPANEL? WTF is that?

> If you have any ideas or need more info, please let me know.


--
Ineptocracy

(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
Re: Folder Permissions [message #178969 is a reply to message #178966] Tue, 28 August 2012 13:09 Go to previous messageGo to next message
Scott Johnson is currently offline  Scott Johnson
Messages: 196
Registered: January 2012
Karma: 0
Senior Member
On 8/28/2012 5:28 AM, BigNate wrote:
> Hi folks
> I have an site I've set up where I create a directory using PHP using mkdir(). That works great and I'm writing files within it using the same script. The problem I came across this morning is while manually moving files from an old version to the new directory via ftp. I'm getting a permissions error saying Access is denied. I believe it is due to the owner of the folder that I created using mkdir() is different than the one I'm using to copy the files to, but I'm not sure how to fix this. Can I change it while creating the directory in the first place or is it possible to modify it in cpanel for a short time so I can copy my files and then change it back? Any help would be appreciated.
>
> If you have any ideas or need more info, please let me know.
>

You may be able to use

chmod($dir, '777'); Or whatever permission you need.

It has been while since I have had to use this so you may want to search
on it.

http://www.php.net/manual/en/function.chmod.php
Re: Folder Permissions [message #178970 is a reply to message #178968] Tue, 28 August 2012 13:29 Go to previous message
BigNate is currently offline  BigNate
Messages: 7
Registered: February 2011
Karma: 0
Junior Member
On Tuesday, August 28, 2012 8:08:28 AM UTC-5, The Natural Philosopher wrote:
> BigNate wrote:
>
>> Hi folks I have an site I've set up where I create a directory using
>
>> PHP using mkdir(). That works great and I'm writing files within it
>
>> using the same script. The problem I came across this morning is
>
>> while manually moving files from an old version to the new directory
>
>> via ftp. I'm getting a permissions error saying Access is denied. I
>
>> believe it is due to the owner of the folder that I created using
>
>> mkdir()
>
>
>
> That will be the web server permissions
>
>
>
>> is different than the one I'm using to copy the files to,
>
>
>
> Copy files WITH - that will be your FTP login....
>
>
>
>
>
>> but
>
>> I'm not sure how to fix this. Can I change it while creating the
>
>> directory in the first place
>
>
>
> A chmod should work within a php script
>
>
>
> chmod("directory name", 0777);
>
>
>
> should work.
>
>
>
> You only need do it once.
>
>
>
>
>
>
>
>
>
> or is it possible to modify it in cpanel
>
>> for a short time so I can copy my files and then change it back? Any
>
>> help would be appreciated.
>
>>
>
>
>
> CPANEL? WTF is that?
>
>
>
>> If you have any ideas or need more info, please let me know.
>
>
>
>
>
> --
>
> Ineptocracy
>
>
>
> (in-ep-toc’-ra-cy) – a system of government where the least capable to
>
> lead are elected by the least capable of producing, and where the
>
> members of society least likely to sustain themselves or succeed, are
>
> rewarded with goods and services paid for by the confiscated wealth of a
>
> diminishing number of producers.

Manually changing the perms did the trick, thank you!

cpanel is the gui I use to admin my server: http://cpanel.net/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Sending nothing when function expects variable
Next Topic: Re: XMLHttpRequest: POST with Data
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 10 09:44:38 GMT 2024

Total time taken to generate the page: 0.02358 seconds