Jump to content
xisto Community

lnljamat

Members
  • Content Count

    4
  • Joined

  • Last visited

Posts posted by lnljamat


  1. When you create a file or directory through FTP or through a control panel like cPanel, the owner (or perhaps group) of the files or directories are the same as the owner running the FTP server and the control panel, so they are both able to modify the files freely. When a user runs a script remotely that does similar tasks, the owner of the script being executed is different than that of the FTP server or control panel. Under an operating system such as Linux, unless other users are given permission to modify these files, then only the same owner as those files can do anything with them.

    I tried to change the permissions from the cpanel web based ftp program, and it doesnt allow me to change the permissions, so i cant delete any folders or files.
    Is there anyway to create permission when i create files and folders from php?

  2. Hi!
    The error message clearly indicates that it is a problem with the permissions on the directory. If you use an FTP client to set permissions on your files and directories, you might want to try going to the directory where you want to create the folder and assign permissions using the CHMOD command or the equivalent of a graphical tool.

    If you do not have an FTP interface, the file manager web interface that your hosting provider presents you with for uploading files should have some way of setting permissions.

    If all else fails, you ought to contact your hosting provider - their support staff should be experienced in dealing with such problems on a day-to-day basis as it is fairly common.


    Thank you Very much!!!

    that was the problem, i needed to change the permissions and then was able to upload!!
    thanks again-

    now im facing another problem- when i try to delete files from ftp it says that permission is not granted, so i have to make a php script unlink() to delete files from the server- could u please explain why that happens? i thought when i log in with ftp i am the super user, and through php script that should be the normal user?

    Thanks again

  3. I have not tested your code but ../../ is redundant. ../ goes to your root directory (public_html) by default. You're calling it twice.

     

    And I'm not sure if you should combine POST with your variable assignment. Again, I have not tested out.

     

    What I do know is

     

    $section_name = $_POST['section_name']; $folderpath = "../content/$section_name"; mkdir($foltherpath);
    Should work because I use it that way in my script.

    Thanks for ur reply

     

    however, the directory where im executing this function is at an even lower level, and doesn't "../" take u up one level?

    anyways i get this error:

    Warning: mkdir() [function.mkdir]: Permission denied in /home/lnljamat/public_html/admin/pagemanagement/sectionedit2.php on line 86

    and when i try to do it with ur code i get an error that no such file or directory exists

     

    Thanks


  4. Hi,

    Ive got a freehosting site at qupis.com,
    and ive made a php site on my computer (running apache with php -installed using xampp)
    in this site the user has the option to create directories and files
    it was working fine on my local computer, but now that ive put it online on qupis, the mkdir() funciton doesnt work, i.e. it doesnt create a directory.
    this is the actual code :

    $folderpath = "../../content/"."$_POST[section_name]";mkdir($folderpath);
    do u need to have some parameters with mkdir? or is it switched off in phpinfo(), so that u cant make a directory directly from the server?
    any help on this would be greatly appreciated!!
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.