Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

Cannot re-assign auto-global variable _POST

Tips and Tricks HQ Support Portal › Forums › WP eMember › Cannot re-assign auto-global variable _POST

' src=

' src=

can not activate the plug in. i am working on doing some dev with xampp and php 5.4.4 and it looks like this is a common error with that version of PHP.

' src=

Hi, None of our products work on non live site (local installation). Mainly because there are too many factors involved that require direct access to URLs and outside server connection. You can’t do that in a local installation. We can’t provide support until you install the plugin on a live server where we can access your site via a URL. This is explained in our terms and conditions.

Anyway, I have taken a wild guess and made a slight change in some code which might fix this issue. I have sent you an email with an update.

That worked thank you! I understand you can not support local dev installs. thank you for taking a stab at this

' src=

I got the same problem I try to install eMember in local with the last version of Easyphp and i got this :

Fatal error: Cannot re-assign auto-global variable _POST in C:Program FilesEasyPHP-12.0wwwMy.afroconscientwp-contentpluginswp-eMemberwp_eMember1.php on line 1209

I know that you are not supposed to help me since it’s a local installation but can you forward me the email you sent to xpunkx ? May be you can share this information for everyone who need to do this so you don’t have to send your solution again, again and again.

Anyway, when your site is important, you know that we have to test our changes before making them live. So what advice can you give to people like me who have bought your product and want to check that everything will be safe (no conflict with other plugins for instance) before putting everything live ?

I have committed the change to the plugin core so if you load a fresh build of the plugin now, you will get the change I made:

https://support.tipsandtricks-hq.com/forums/topic/re-install-or-load-a-fresh-build-of-the-plugins

There is nothing wrong with putting the plugin on a local install for testing but you just need to keep in mind that this plugin is different than other plugins you may have installed. For example, this plugin needs access to the payment gateway which you don’t have in a local install. So all testing related to that functionality will fail.

The best option for testing a plugin that needs to be online is to create a test install of WordPress in one of your domains. For example, you can create a sub-domain called "test.your-domain.com" and then install WordPress there along with other plugins. You can even install WP in a sub-folder on your site and test there too (example, "your-domain.com/test/" .

' src=

I have just sent an email regarding this situation. please disregard. Thanks for the new plug-in. will upload today.

' src=

I am glad you got this working. I took care of the email for you.

Support » Plugin: VR-Frases (collect & share quotes) » Fatal error: Cannot re-assign auto-global variable _GET

Fatal error: Cannot re-assign auto-global variable _GET

' src=

9 years ago

I get this error:

Fatal error: Cannot re-assign auto-global variable _GET in wp-content/plugins/vr-frases/includes/vr-frases-functions.php on line 32

This is actually not a wordpress version problem per se. It seems to be related to PHP, the plugin should not be passing $_GET in as a param into a param named $_GET.

If you modify the following file, it solves this error:

cannot re assign auto global variable _request

PICTURES PRO

Support Forum > Photo Cart

If your Photo Cart is suddenly getting a 500 error or only displaying a blank page then you or your hosting company has updated the PHP (programming language) to PHP 7 which Photo Cart is not compatible with (and will not be compatible with) mainly because of the removal of the my_sql functions which are replaced with my_sqli functions. 

You would need to have the PHP version downgraded to 5.6 in order for Photo Cart to work. If downgrading the PHP doesn't work then you may have to update Photo Cart to the last version of 7. Download Photo Cart 7 upgrade files . Upgrade instructions .

Photo Cart was retired in 2015.  Check out Sytist .

Help- Getting This Error Fatal Error: Cannot Re-assign Auto-global Variable _req

Sign up for email promotions.

Your information is safe with us and won't be shared.

Thank you for signing up!

By continuing to browse or by clicking Accept Cookies, you agree to the storing of cookies on your device necessary to provide you with the services available through our website.

BuyScripts Forums

Home

FIX: Cannot re-assign auto global variable $_FILES

Thread: FIX: Cannot re-assign auto global variable $_FILES

Thread tools.

admin is offline

Open include/functions.php Find PHP Code: function  upload_jpg ( $_FILES ,  $var_name ,  $file_name ,  $img_width  =  128 ,  $dir  =  "upload/" ,  $rename  =  '' ) {     if ( $_FILES [ $var_name ][ 'name' ])     {          $file_url  =  $dir  .  uniqid ( "" ) .  tmp ;          $ext  =  strrchr ( $_FILES [ $var_name ][ 'name' ],  '.' );          move_uploaded_file ( $_FILES [ $var_name ][ 'tmp_name' ],  $file_url );         if ( $_FILES [ $var_name ][ 'error' ] >  0 )         {              $err  =  'Error occurs while uploading file' ;         }         else if ( strtolower ( $ext ) ==  '.jpg' )         {              $img  = @ imagecreatefromjpeg ( $file_url );              $size  = @ getimagesize ( $file_url );              $width  =  $size [ 0 ];              $height  =  $size [ 1 ];             if ( $width  >  $img_width )             {                  $percentage  =  $img_width  /  $width ;                  $width  *=  $percentage ;                  $height  *=  $percentage ;                  $img_r  = @ imagecreatetruecolor ( $width ,  $height );                 @ imagecopyresampled ( $img_r ,  $img ,  0 ,  0 ,  0 ,  0 ,  $width ,  $height ,  $size [ 0 ],  $size [ 1 ]);             }             else             {                  $img_r  =  $img ;             }              $pic_name  =  $dir  .  $file_name ;             @ ImageJpeg ( $img_r ,  $pic_name ,  100 );              //                       rename("$pic_name", "$dir"."$rename");              @ unlink ( $file_url );         }         else         {             @ unlink ( $file_url );              $err  =  'File must be as .jpg format' ;         }     }     return  $err ; }  Replace With PHP Code: function  upload_jpg ( $my_file ,  $var_name ,  $file_name ,  $img_width  =  128 ,  $dir  =  "upload/" ,  $rename  =  '' ) {     if ( $my_file [ $var_name ][ 'name' ])     {          $file_url  =  $dir  .  uniqid ( "" ) .  tmp ;          $ext  =  strrchr ( $my_file [ $var_name ][ 'name' ],  '.' );          move_uploaded_file ( $my_file [ $var_name ][ 'tmp_name' ],  $file_url );         if ( $my_file [ $var_name ][ 'error' ] >  0 )         {              $err  =  'Error occurs while uploading file' ;         }         else if ( strtolower ( $ext ) ==  '.jpg' )         {              $img  = @ imagecreatefromjpeg ( $file_url );              $size  = @ getimagesize ( $file_url );              $width  =  $size [ 0 ];              $height  =  $size [ 1 ];             if ( $width  >  $img_width )             {                  $percentage  =  $img_width  /  $width ;                  $width  *=  $percentage ;                  $height  *=  $percentage ;                  $img_r  = @ imagecreatetruecolor ( $width ,  $height );                 @ imagecopyresampled ( $img_r ,  $img ,  0 ,  0 ,  0 ,  0 ,  $width ,  $height ,  $size [ 0 ],  $size [ 1 ]);             }             else             {                  $img_r  =  $img ;             }              $pic_name  =  $dir  .  $file_name ;             @ ImageJpeg ( $img_r ,  $pic_name ,  100 );              //                       rename("$pic_name", "$dir"."$rename");              @ unlink ( $file_url );         }         else         {             @ unlink ( $file_url );              $err  =  'File must be as .jpg format' ;         }     }     return  $err ; } 
HelpDesk vShare Youtube Clone

Posting Permissions

Forum Rules

cannot re assign auto global variable _request

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

What are your feelings, share this article :, how can we help.

Powered by BetterDocs

Leave a Reply Cancel reply

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

Hit enter to search or ESC to close

cookie

Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Fatal error: Cannot re-assign auto-global variable

Fatal error: Cannot re-assign auto-global variable _FILES in C:\xampp\htdocs\user\utils\CommonUtils.php on line 1395

The code on line 1395 is

xlecoustillier's user avatar

4 Answers 4

you can't use $_FILES for function parameter it's reserved word, use this instead of

and for calling pass the $_FILES like this

You can also directly access the $_FILES without passing it in function parameter inside function.

Yogesh Suthar's user avatar

You're trying to set a variable called $_FILES in local scpe as an argument to the saveAvatar() method; but can't because it's one of the special superglobals.

Change the line to

The $_FILES superglobal will still be available to that method simply because it is a superglobal

Mark Baker's user avatar

I was also facing the same problem. Then I just removed the $_FILES variable from list of variables and my website started working again.

Hafiz Hassan Latif's user avatar

Normally we can't reassign the $_Files, which means we can't pass the auto super global variable as argument -or function. But we have an alternate solutions.

Pass the file as parameter

Call the function with auto global-variable as argument.

Form for upload

Kannadasan K's user avatar

Your Answer

Sign up or log in, post as a guest.

Required, but never shown

By clicking “Post Your Answer”, you agree to our terms of service , privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged php or ask your own question .

Hot Network Questions

cannot re assign auto global variable _request

Your privacy

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy .

IMAGES

  1. Auto assign

    cannot re assign auto global variable _request

  2. $_REQUEST Super global variable with html form in php tutorial

    cannot re assign auto global variable _request

  3. Product Update: Auto-Assign Scheduling

    cannot re assign auto global variable _request

  4. Error CS0815: Cannot assign null to an implicitly-typed variable

    cannot re assign auto global variable _request

  5. Assign User Global Permissions using vSphere Client

    cannot re assign auto global variable _request

  6. Rollouts Documentation

    cannot re assign auto global variable _request

VIDEO

  1. Black Noodles That Can't Be Eaten With Chopsticks!

  2. jMS

  3. Inhibitor 110 Raid, Esterosa carry

  4. Modern Warfare 2 Glitches on Afghan

  5. Holistic farming vs. monocrop farming

  6. Get And Post Methods in PHP |Hindi|

COMMENTS

  1. Cannot re-assign auto-global variable _POST

    Fatal error: Cannot re-assign auto-global variable _POST in C:Program FilesEasyPHP-12.0wwwMy.afroconscientwp-contentpluginswp-eMemberwp_eMember1.php on line 1209

  2. Fatal error: Cannot re-assign auto-global variable _GET

    [This thread is closed.] I get this error: Fatal error: Cannot re-assign auto-global variable _GET ... Fatal error: Cannot re-assign auto-global variable _GET in wp-content/plugins/vr-frases/includes/vr-frases-functions.php on line 32

  3. Cannot re-assign auto-global variable _post

    Problem: Cannot re-assign auto-global variable _post. Answer:You can't use a superglobal as the variable name for a function argument

  4. Cannot re-assign auto-global variable _POST

    I get the following error: Fatal error: Cannot re-assign auto-global variable _POST in C:\Program Files (x86)\Zend\Apache2\htdocs\includes\class-insert.php on line 47 when trying to access my class-insert.php page (or most of my other pages)

  5. Help- getting this error Fatal error: Cannot re-assign auto-global variable _REQ

    I have a gallery and all of a sudden when trying to add/change/delete gallery items I am getting this error "Fatal error: Cannot re-assign auto-global variable _REQUEST in /home1/shannonc/public_html/photocart

  6. FIX: Cannot re-assign auto global variable $_FILES

    function upload_jpg($_FILES, $var_name, $file_name, $img_width = 128, $dir = "upload/", $rename = '')

  7. Fatal error: Cannot re-assign auto-global variable _REQUEST in

    Hi i got after a Update to PHP 5.5.9 a Problem with my PHP Code. What this error is saying is that you are attempting to name a variable in the

  8. Fatal error: Cannot re-assign auto-global variable _FILES

    Fatal error: Cannot re-assign auto-global variable _FILES in /home/myairline/public_html/phpvms/core/common/PilotData.class.php on line 436 Go to that file, /phpvms/core/common/PilotData.class.php and head on over to what line it says has an error

  9. php

    Fatal error: Cannot re-assign auto-global variable _FILES in C:\xampp\htdocs\user\utils\CommonUtils.php on line 1395. Normally we can't reassign the $_Files, which means we can't pass the auto super global variable as argument -or function