Closed Thread
Results 1 to 7 of 7

Thread: Internal Server Error

  1. #1
    yondaime.tori88 is offline x10Hosting Member yondaime.tori88 is an unknown quantity at this point
    Join Date
    Oct 2010
    Posts
    7

    Internal Server Error

    I have created an php file to upload .zip or .rar files,at the beginning it says that mkdir() function couldn't access to the folder(public_html/sgfoldup)(permission denied).
    So i have changed the permission on these folders(each on 777) and appears this error:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, no-reply@x10hosting.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    How can i solve it?
    Thanks

  2. #2
    Gouri's Avatar
    Gouri is offline Community Paragon Gouri has a brilliant futureGouri has a brilliant futureGouri has a brilliant future
    Join Date
    Oct 2007
    Location
    India
    Posts
    4,502

    Re: Internal Server Error

    Quote Originally Posted by yondaime.tori88 View Post
    I have created an php file to upload .zip or .rar files,at the beginning it says that mkdir() function couldn't access to the folder(public_html/sgfoldup)(permission denied).
    So i have changed the permission on these folders(each on 777) and appears this error:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, no-reply@x10hosting.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    How can i solve it?
    Thanks
    777 permission is not secure

    Change the permissions to 755 for folders and 644 for files.
    Last edited by Gouri; 02-10-2011 at 09:55 AM.
    If you feel my post is useful then click to give Reputation (bottom left corner of this post)

    X10 Hosting | News and Announcements | Premium Hosting | VPS Hosting | Prime Membership

    Tech Community | Gouri

  3. #3
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,633

    Re: Internal Server Error

    Also, if this script is for people to upload and store files, please note two things:

    1. You are 100% responsible for what is on you account. One piece of warez, adult material, or anything else that violates x10hosting's TOS will get your account locked and deleted. No backups or downloads.

    2. If the purpose of the site is a file warehouse, that violates the TOS too.
    Nothing is always absolutely so.

  4. #4
    yondaime.tori88 is offline x10Hosting Member yondaime.tori88 is an unknown quantity at this point
    Join Date
    Oct 2010
    Posts
    7

    Re: Internal Server Error

    This is my upload.php code:
    PHP Code:
    <?php

    include 'dbc.php';


    $dimensione_massima=10240//dimensione massima consentita per file in byte -> 1024 byte = 1 Kb
    $dimensione_massima_Kb=$dimensione_massima/1024;

    // percorso cartella relativo $cartella_upload="../public/";
    $filtrare=1//filtrare x estensioni ammesse? 1=si 0=no
    $array_estensioni_ammesse=array('.zip','.rar'); //estensioni ammesse

    $savgn $data['savename'];
    $region $data['region'];
    $description $data['description'];
    $username $data['username'];
    $dlc $data['dlc'];
    $trof=$data['trof'];
    $trofei $data['trofei'];
    $cartella_upload="/public_ftp/sgfoldup/".$username;//cartella in cui eseguire l'upload (controllare permessi scrittura)
    $file_path="/public_ftp/sgfoldup/".$username."/".$data['upfile']; 
    $errorecomp=0

    if(
    is_dir($cartella_upload)==false)
     
    Mkdir($cartella_upload0755,true);

    if(
    $savgn=='' || $description=='' || $username==''  || is_int($trofei)==false || $savgn>=255 || $region>=20 || $description>=255 || $username>=16 || $trofei>=100){
       echo(
    'Check Field');
       
    $errorecomp+=1
       }
    else if(
    $errorecomp==){
    if(!isset(
    $_FILES['upfile']) || $_FILES['upfile']['size']==0){
        echo 
    "No file selected";
    }else if(
    $_FILES['upfile']['size']>$dimensione_massima){
        echo 
    "The file is too large $dimensione_massima_Kb Kb";
    }else{
        
    $nome_file=$_FILES['upfile']['name'];
        
    $errore="";
        if(
    $filtrare==1){
            
    $estensione strtolower(substr($nome_filestrrpos($nome_file"."), strlen($nome_file)-strrpos($nome_file".")));
            if(!
    in_array($estensione,$array_estensioni_ammesse)){
                
    $errore.="File not accepted. Permitted extensions: ".implode(", ",$array_estensioni_ammesse)."<br/>";
            }
        }
        if(!
    file_exists($cartella_upload)){
            
    $errore.="The folder doesn't exist</br>";
        }
        
        if(
    $errore==""){
            if(
    move_uploaded_file($_FILES['upfile']['tmp_name'], $cartella_upload.$_FILES['upfile']['name'])){
                
    chmod($cartella_upload.$_FILES['upfile']['name'],0644); //permessi per poterci sovrascrivere/scaricare
                
    echo "Upload successful.";
                
    //aggiunta al database
                
    if($trof=='si'){
                
    $sql_insert "INSERT into `savegame`
                  (`savename`,`username`,`description`,`region`,`pathsave`,`dlc`,`trof`,`trofei`,`date`,`users_ip`)
                VALUES
                ('
    $savgn','$username','$description','$region','$file_path','$dlc','$trof','$trofei',now(),'$user_ip')";}
                else if(
    $trof=='no'){
                
    $sql_insert "INSERT into `savegame`
                  (`savename`,`username`,`description`,`region`,`pathsave`,`dlc`,`trof`,`date`,`users_ip`)
                VALUES
                ('
    $savgn','$username','$description','$region','$file_path','$dlc','$trof',now(),'$user_ip')";
                 
    header('Location: http://farebury.exofire.net/Upload.html');
                }
                }
            }else{
                echo 
    "Unable to upload file";
            }
        }
        if(
    $errore!=''){
            echo 
    $errore;
        }
    }

    ?>
    public_html:700
    public_ftp:755
    this is the error:
    Code:
    Warning:  mkdir() [function.mkdir]: Permission denied in /home/oxoc/public_html/upload.php on line 25
    How can i solve it?

  5. #5
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,633

    Re: Internal Server Error

    PHP Code:
    Mkdir($cartella_upload0755,true
    is what is causing the error.

    Exactly what is the full name and path of the dir you are trying to create?
    Nothing is always absolutely so.

  6. #6
    yondaime.tori88 is offline x10Hosting Member yondaime.tori88 is an unknown quantity at this point
    Join Date
    Oct 2010
    Posts
    7

    Re: Internal Server Error


    "/public_ftp/sgfoldup/"
    .$username


    To organize the upload i want to create a folder with the same name of the uploader($username)

  7. #7
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,633

    Re: Internal Server Error

    Please notice the path to your script in the error message...

    Code:
    /home/oxoc/public_html/upload.php
    Nothing is always absolutely so.

Closed Thread

Similar Threads

  1. Replies: 3
    Last Post: 02-16-2011, 09:42 AM
  2. Replies: 1
    Last Post: 08-15-2010, 08:18 PM
  3. Replies: 7
    Last Post: 07-28-2010, 01:56 AM
  4. Replies: 2
    Last Post: 01-09-2008, 12:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers