Results 1 to 9 of 9

Thread: Fatal error: Cannot re-assign auto-global variable _FILES

  1. #1

    Default Fatal error: Cannot re-assign auto-global variable _FILES

    Hello.

    I updated my server to latest apache, php, mysql, used imagemagick and needed installed too GD Library for my wordpress installation and when I enter my site I get this :

    Fatal error: Cannot re-assign auto-global variable _FILES in /home/user/public_html/includes/core.func.php on line 22

    How to fix this please ?

    line 22 is : function uploadFiles($_FILES)
    Last edited by cuveyx; 04-24-2013 at 09:18 AM.

  2. #2

    Default

    bump. anyone ?

  3. #3
    Join Date
    May 2005
    Location
    China & France
    Posts
    6,492

    Default

    Please replace $_FILES by $myfiles only for the following textarea in your file:

    PHP Code:
    function uploadFiles($_FILES)
    {
    global 
    $db,$input,$uploadtime,$user;

    if(!empty(
    $_FILES))
    {
         
    $num=0;
         
    $uploadtime=time();
         
    $applet $input[applet];
         foreach(
    $_FILES as $tmpfile)
         {
             if(
    $user->allowed_max_files<=$num) break;
             
    //uploading the file...
             
    $insertid=uploading($tmpfile,$applet);
             if(
    $insertid==0) break;
             if(
    $insertid==-1) continue;

             
    //uploaded...
             
    $num++;
             
    $size=$size+$tmpfile[size];
         }
         
    /**
         *upload is finished,do some updates on user's stats and redirect...
         */
         
    uploadStats($num,$size,$insertid,$applet);

    }


  4. #4

    Default

    I replaced as you said in the lines recommended _FILES with myfiles

    same error, but saying now line 53, where there are also another _FILES , 3 in total. replaced them.

    now i get errors in header

    Warning: Creating default object from empty value in /home/user/public_html/includes/user.class.php on line 162
    Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/includes/user.class.php:162) in /home/user/public_html/includes/function.php on line 1509
    ...

    added 2 php.ini in root and /includes with display_errors = off

    no errors shown, site shows the thumbs in others site but is not functional anymore... when trying to upload images i get

    /public_html/servernumber/includes/core.func.php on line 22 ... again.

    - what other files need to edit from_FILES to myfiles ? seems like would work if i knew them... or not ?
    - how to get rid of warning anymore so i can remove the php.ini's ?
    - how to upload images ?

    I tried before replacing $_FILES with $_files and was the same thing like $myfiles.

    I noticed that there are 2 $_FILES in upload.php file, changed that once, same errors... is this due to upgrading PHP ? I can't and don't want to revert back my PHP on server. is old, a bit of upgrading and fixing this script would be the thing to do, can I get another fix, please ?
    Last edited by cuveyx; 04-30-2013 at 05:51 PM.

  5. #5
    Join Date
    May 2005
    Location
    China & France
    Posts
    6,492

    Default

    Quote Originally Posted by cuveyx View Post
    I replaced as you said in the lines recommended _FILES with myfiles

    same error, but saying now line 53, where there are also another _FILES , 3 in total. replaced them.

    now i get errors in header

    Warning: Creating default object from empty value in /home/user/public_html/includes/user.class.php on line 162
    Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/includes/user.class.php:162) in /home/user/public_html/includes/function.php on line 1509
    ...

    added 2 php.ini in root and /includes with display_errors = off

    no errors shown, site shows the thumbs in others site but is not functional anymore... when trying to upload images i get

    /public_html/servernumber/includes/core.func.php on line 22 ... again.

    - what other files need to edit from_FILES to myfiles ? seems like would work if i knew them... or not ?
    - how to get rid of warning anymore so i can remove the php.ini's ?
    - how to upload images ?

    I tried before replacing $_FILES with $_files and was the same thing like $myfiles.

    I noticed that there are 2 $_FILES in upload.php file, changed that once, same errors... is this due to upgrading PHP ? I can't and don't want to revert back my PHP on server. is old, a bit of upgrading and fixing this script would be the thing to do, can I get another fix, please ?
    Please send me ftp access to fix the issues.

  6. #6

    Default

    PM sent with details, thank you for help

  7. #7
    Join Date
    May 2005
    Location
    China & France
    Posts
    6,492

    Default

    Fixed the issues on main server and s4 server. For other servers, please copy includes/core.func.php, user.class.php on s4 server and replace the corresponding files on other servers.

    Note that you made custom changes on your server files. In general, we are not responsible to fix the issues caused by custom addons.

  8. #8

    Default

    Thank you. Great support

  9. #9

    Default

    I am having this same issue now. www.Picturez.com

Posting Permissions

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