The Community Forums

Interact with an entire community of cPanel & WHM users.
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can't create or delete files and folders with PHP

Discussion in 'General Discussion' started by HappyCoder, Apr 27, 2012.

  1. HappyCoder

    HappyCoder Member

    Joined:
    Apr 27, 2012
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    I've got access to cPanel. All it all just works perfectly, but there is one problem that I can't resolve.
    My problem is that I can't create files or folders with php scripting. Nor can't I delete files or folders. I'm using unlink function in php.
    Right now I am trying to delete a file using php scripting (the file type is xml).
    I have access to other web hosts (they do not run cPanel) and my code works fine.
    When I execute the code on the cPanel, I get no error messages or other indications of the file was not deleted.
    The file to be deleted has rights 0644. It has the same rights as the file has on the other web hosting services, where it works.

    Can anyone tell me what is happening and how I get it resolved?

    Keep me happy,
    HappyCoder :)
     
  2. PlotHost

    PlotHost Well-Known Member

    Joined:
    Apr 29, 2011
    Messages:
    253
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    US
    cPanel Access Level:
    Root Administrator
    Twitter:
    Do you have a file "error_log" in the working directory ? If yes check it for PHP warnings/errors .
     
  3. HappyCoder

    HappyCoder Member

    Joined:
    Apr 27, 2012
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Yes, I use the error_log, but I can not write to files, so it has not detected any errors.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Please consult with your web hosting provider to have them determine which specific PHP function is being blocked. It's likely the script requires file ownership changes if the PHP handler is set to "DSO".

    Thank you
     
Loading...

Share This Page