Results 1 to 8 of 8
  1. #1

    disable_functions PROBLEM

    Hi
    I moved to a new didecated server, after moving some secripts don't work any more like : php upload center that change the photo name and write the site name under the photo. when I try to upload any image the page reload without any result nor errors!

    when I took a look to the php info I found many fanctions are disable.
    Now I don't know which function is the one which couse this problem.

    disable_functions:
    Code:
    dl,exec,shell_exec,system,passthru,popen,pclose,proc_open,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,escapeshellcmd,escapeshellarg,dl,exec,shell_exec,system,passthru,popen,pclose,proc_open,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,escapeshellcmd,escapeshellarg
    my php Version 4.4.4

    thank you in advance
    Last edited by afthl; 01-25-2007 at 06:45 PM.

  2. #2
    Join Date
    Dec 2005
    Location
    Internet
    Posts
    1,337
    That depends on the functions you are calling in the code.

    For eg, PhotoGallary software is calling exec function and if we disable it, the upload function won't work properly.

    Check yourself by enabling the "exec" function, restart the apache service and see the results.

  3. #3
    Join Date
    Nov 2002
    Location
    WebHostingTalk
    Posts
    8,878
    * Moved to Technical and Security Issues....

    Sirius
    I support the Human Rights Campaign!
    Moving to the Tampa, Florida area? Check out life in the suburbs in Trinity, Florida.

  4. #4
    thank you linuxcares i'll try

    and thank you sirius for the moving
    PHP Code:
    <?
    if($image)
    {
        
        
    $ift =  substr($image_name, -3);
        if((
    $ift=="jpg") or ($ift=="gif") or ($ift=="png"))
        {

            if(
    copy($image,$image_name)){
                
                
    aaimage($image_name,$websitename,$tow,$ift,$textcolor);
                
                
    $imageurl ="http://{$Site_Url}/{$ImgFolder}/$tow.jpg";
               
                print 
    str_replace("imageurl",$imageurlimplode (''file ("url.html")));
            }else{
                print
    "CAN NOT COPY THE IMAGE";
            }
        }
        elseif ((
    $file_size $limited_size))
    $result "MAXIMAM SIZE $limited_size ÈÇíÊ";
    }else{
        if(
    $aa){
            
    $aa "$aa.jpg";
            if(
    file_exists($aa)){
                
    readfile($aa);
            }else{
                
    readfile("notfound.jpg");
            }
        }else{
            
            include(
    "upload.html");
        }
    }

    function 
    mkcolor($image,$color){
     
    $color str_replace("#","",$color);
     
    $red   hexdec(substr($color,0,2));
     
    $green hexdec(substr($color,2,2));
     
    $blue  hexdec(substr($color,4,2));
     
    $out   ImageColorAllocate($image$red$green$blue);
     return(
    $out);
    }
    function 
    aaimage($imagefilename,$websitename,$imagesavefile,$imagefilename_type,$textcolor="#FFFFFF")
    {
        
        if(
    $imagefilename_type=="jpg"){$im imageCreateFromjpeg($imagefilename);}
        if(
    $imagefilename_type=="jpeg"){$im imageCreateFromjpeg($imagefilename);}
        if(
    $imagefilename_type=="gif"){$im imageCreateFromGIF($imagefilename);}
        if(
    $imagefilename_type=="png"){$im imageCreateFromPNG($imagefilename);}
       
        
    $im2imagecreatetruecolor(imageSX($im),imageSY($im)+22);

        
    $text_color mkcolor($im2,$textcolor);

        
    $start_text = (imageSX($im2)/2)-9*(strlen($websitename)/2);

        
    ImageString ($im25$start_text, (imageSY($im)+3), $websitename$text_color);

        
    imageCopyMerge($im2$im,0,0,0,0,(imageSX($im)),(imageSY($im)),100);

        include (
    "./config_up.php");
        
    imagejpeg ($im2,"$ImgFolder/$imagesavefile.jpg",100);

        
    imagedestroy($im2);
     
        
    unlink($imagefilename);
    }
    ?>

  5. #5
    Quote Originally Posted by linuxcares
    That depends on the functions you are calling in the code.

    For eg, PhotoGallary software is calling exec function and if we disable it, the upload function won't work properly.

    Check yourself by enabling the "exec" function, restart the apache service and see the results.
    I tried nothing happened

  6. #6
    any help....?

  7. #7
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,750
    There are a lot of disabled functions in your php.ini. Is the script working with disabled_functions line commented?
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  8. #8
    Join Date
    Dec 2005
    Location
    Internet
    Posts
    1,337
    Quote Originally Posted by david510
    There are a lot of disabled functions in your php.ini. Is the script working with disabled_functions line commented?
    Yes, do it temporarily and check the apache logs to see if there is any errors.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •