SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    doubt in mkdir() making in server

    Hello friends for me in the local host the mkdir is working perfectly its making the folders and uploading my images

    but in the server its giving error like below please help me to solve it so what i can complete my project pls any one....


    Warning: mkdir() [function.mkdir]: Unable to access /var/www/vhosts/silver.com/httpdocs/jeeva/images/given/20-05-2010 in /var/www/vhosts/silver.com/httpdocs/jeeva/imageview.php on line 153
    Cannot create upload directory.

    please reply a solution as soon as possible....

  2. #2
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I doubt that there is permission issue. It seems the folder in which you are going to create a folder does not have enough permission. Show us the code.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  3. #3
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $Directory = "/var/www/vhosts/silver.com/httpdocs/jeeva/images/".$_COOKIE['ID_my_site']."/".date("d-m-Y");
    if(!file_exists($Directory))
    {
    mkdir("/var/www/vhosts/silver.com/httpdocs/jeeva/images/".$_COOKIE['ID_my_site']."/".date("d-m-Y"),0777) or die('Cannot create upload directory.');
    }

    hello friend this is my code and no folders are creating up for me in the server....why i dont know..

    give me a solution..............

  4. #4
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is the folder for named with $_COOKIE['ID_my_site'] already created or you want to create it too? So if you want to create a folder inside that then you need to give permission for that.

    Edit:
    See the chmod function in manual:
    http://php.net/manual/en/function.chmod.php
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  5. #5
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hello friend here i need to create 3 folders like image,$_COOKIE['ID_my_site'],date("d-m-Y") so what should i do

    and how to apply seperate chomd for each folder..

  6. #6
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hello friend i given chmod code as below the also no use its not creating...

    $path=chmod("images",0777);
    $path1=chmod($_COOKIE['ID_my_site'],0777);
    $path2=chmod(date("d-m-Y"),0777);
    $Directory = $path."/".$path1."/".$path2;

    and giving the following errors

    Warning: chmod() [function.chmod]: Operation not permitted in /var/www/vhosts/alboom.com/httpdocs/newspaper/imageview.php on line 150

    Warning: chmod() [function.chmod]: Unable to access given in /var/www/vhosts/alboom.com/httpdocs/newspaper/imageview.php on line 151

    Warning: chmod() [function.chmod]: stat failed for given in /var/www/vhosts/alboom.com/httpdocs/newspaper/imageview.php on line 151

    Warning: chmod() [function.chmod]: Unable to access 20-05-2010 in /var/www/vhosts/alboom.com/httpdocs/newspaper/imageview.php on line 152

    Warning: chmod() [function.chmod]: stat failed for 20-05-2010 in /var/www/vhosts/alboom.com/httpdocs/newspaper/imageview.php on line 152

    Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/) is not within the allowed path(s): (/var/www/vhosts/alboom.com/httpdocs:/tmp) in /var/www/vhosts/alboom.com/httpdocs/newspaper/imageview.php on line 154

    Warning: mkdir() [function.mkdir]: SAFE MODE Restriction in effect. The script whose uid is 10020 is not allowed to access // owned by uid 0 in /var/www/vhosts/alboom.com/httpdocs/newspaper/imageview.php on line 156
    Cannot create upload directory.

  7. #7
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey man, try to google or even in this forum before you ask everything here. Your server/webhost has disabled the function chmod so you cannot run this function in your script. So contact your server host to enable that function (remove the chmod function from disabled_functions).
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  8. #8
    SitePoint Zealot
    Join Date
    Jul 2009
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hello friend i am getting an error as follows i dont know wht to do while google also not getting a solution if you can pls its working fine in localhost....

    Warning: mkdir() [function.mkdir]: Permission denied

  9. #9
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Comon dude, I already pointed you that you have permission problem and you have to give the permission to that folder. If you have already created folder then you give permission from FTP software manually. But if you create them from PHP script then you have to give permission from script itself and you have to use chmod() function in PHP. But as per your previous error message for this, the function has been disabled by your server, so ask your webhost to enable it.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5


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
  •