Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    51
    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:
    255
    Likes Received:
    2
    Trophy Points:
    68
    Location:
    Romania
    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 .
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. HappyCoder

    HappyCoder Member

    Joined:
    Apr 27, 2012
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    51
    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 Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,749
    Likes Received:
    1,885
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice