SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    nyc
    Posts
    223
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    hosting servers and PHP permissions nightmare

    Hi all

    This problem is driving me crazy, I hope you can make sense of it:

    My site is currently hosted by 'hosteur.com'.
    I have been trying to use php functions that manipulate files, such as
    chmod() and mkdir()
    I always get the warning message:
    Warning: chmod() permission denied
    Warning: mkdir() permission denied

    I have contacted the host repeatedly and they assured me that these functions work, and that there must be something wrong with my code.
    To prove it, they created a folder in my site, and created a php file in that folder, and that PHP file uses these functions succesfully.

    BUT this folder THEY created is the ONLY folder in which these functions are not denied! Maybe because they created that folder as administrators of the server, and as a result this folder has unique privileges that none of MY folders have??....

    If I use the same PHP script in any other folder, it does not work (permission denied).

    I am pulling my hair, and giving up on contacting hosteur for explanations, cause they don't seem to know what's going on with their own server permissions settings...

    So I am going to change Hosts, but how can I be sure this won't happen again? Hosting plans that support PHP never mention whether some messed-up server configurations will prevent me from succsessfully use mkdir() or chmod()...

    This is such a headacke and a waste of time and money!

    Anybody has had this problem?...

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2005
    Location
    Houston, TX
    Posts
    167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you sure that the files you're trying to modify aren't in a password protected portion of your site? Why don't you post your code?

    Some hosts do disable features for various reasons, mainly security. Especially when dealing with functions like directory modification.

    Tim

  3. #3
    SitePoint Addict
    Join Date
    Jan 2005
    Location
    nyc
    Posts
    223
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my code is standard code:

    chmod($path_to_file, 0666);
    mkdir($path.'/new_folder');

    None of my directories are password protected.

    All my work basically consists in manipulating directories and files using PHP. I cannot venture into getting a hosting account without knowing if they support these features or not. I just did, and it's been a waste of time and money.

    Am I the only one who thinks that chmod() and mkdir() and rmdir() and fopen($file,'w') SHOULD work on a server that claims to support PHP? If I pay for a hosting plan, I should be able to use these functions.

    Am I the only php programmer who is having this problem? Does anybody knows of a host that less than $10 a month and that DOES SUPPORT all these functions for sure?

    I am loosing my hair on this.

  4. #4
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    New York City
    Posts
    117
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you on a Linux server using Apache?

    If so, you have to make sure that the Apache user is included in the same Group that your FTP user is in (assuming PHP is not running as a CGI module). If the Apache user is "apache" and your FTP user is "mysite," then you need to add the "apache" user to the "mysite" Group so it has permissions to modify files in your folders.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •