Create a Folder If It Doesn’t Already Exist

Some hosting companies may not have some files when you install wordpress automatically. You must change the folder settings to correct this situation. In the following code, if there is a folder, we give this folder permission as 777. With this code, you can change any folder permissions you want. Note: That 0777 is already the default mode for directories and may still be modified by the current umask.


if (!file_exists('path/to/directory')) {
    mkdir('path/to/directory', 0777, true);


  • zvodret iluret

    Hi there just wanted to give you a quick heads up. The text in your article seem to be running off the screen in Opera. I’m not sure if this is a format issue or something to do with web browser compatibility but I figured I’d post to let you know. The design look great though! Hope you get the issue resolved soon. Cheers

  • Zamudio

    I have been exploring for a bit for any high quality articles or blog posts on this sort of area . Exploring in Yahoo I at last stumbled upon this website. Reading this information So i am happy to convey that I have an incredibly good uncanny feeling I discovered just what I needed. I most certainly will make certain to don’t forget this website and give it a glance on a constant basis.


Leave a Reply

Your email address will not be published. Required fields are marked *