Gallahazzar Posted September 7, 2005 Posted September 7, 2005 Gooday, i hope you can help me out here :) Installed OsCommerce and the catalog part and store works nicely. The admin part do not however. When i try to enter i get this message Fatal error: Cannot re-assign $this in ***********/"admin"/includes/classes/upload.php on line 31 Here is a small part of the file with line 31 pointed out... <?php /* $Id: upload.php,v 1.2 2003/06/20 00:18:30 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ class upload { var $file, $filename, $destination, $permissions, $extensions, $tmp_filename, $message_location; function upload($file = '', $destination = '', $permissions = '777', $extensions = '') { $this->set_file($file); $this->set_destination($destination); $this->set_permissions($permissions); $this->set_extensions($extensions); $this->set_output_messages('direct'); if (tep_not_null($this->file) && tep_not_null($this->destination)) { $this->set_output_messages('session'); if ( ($this->parse() == true) && ($this->save() == true) ) { return true; } else { // self destruct $this = null; <------------LINE 31 return false; } } } Anyone? :)
vanschaik12 Posted September 7, 2005 Posted September 7, 2005 I've got the same problem and can't get it fixt. If someone knows how :-)
♥Vger Posted September 7, 2005 Posted September 7, 2005 You only needed to do a search for $this on the forum and you'd have found hundreds, if not thousands, of replies. But here it goes again: php5 compatibility problem admin/includes/classes/upload.php on line 31, edit $this = null; to this: unset($this); Vger
Gallahazzar Posted September 7, 2005 Author Posted September 7, 2005 Thanks for the information. :D I actually did searched for that but didnt find anything that was the same... oh well :)
whitehawk43 Posted September 20, 2005 Posted September 20, 2005 :thumbsup: hey that was a easy fix it worked thanks for the info all u got to do it open the file in your editor and go to line 31 make the change :D piece fo cake
Guest Posted September 26, 2005 Posted September 26, 2005 Hey vyger, YOu're the man!!! Thanks man! YOu really help me a lot with your savvy!
Guest Posted November 4, 2005 Posted November 4, 2005 I have also had a problem with upload.php despite any changes to $this. I am running IIS 6.0; MySQL 4.1; & PHP 5. So far everything is working great except when I add a new product in categories.php under admin. As soon as I hit preview the page loads blank. So I took a look at categories.php see that under the case 'new_product_preview' it was making a new instance of the upload class and stopped there (line 314 in categories.php). Any ideas? I thought perhaps it was the chmod() function but not so sure now. I did change line 31 from $this=null to unset($this) - no luck. -Bobbo
Fores Posted November 13, 2005 Posted November 13, 2005 Thank you for your precious advice. It works and I solve my problem. Fores
xXDesertRoseXx Posted December 7, 2005 Posted December 7, 2005 I had same prob after install, (I have wamp server) on pc at home and this is gonna seem strange but I changed $this to $that --- just for the hell of it... lol - and to my HUGE surprise it worked !!! My hosting co helped me with the install of osc 2.2ms2 and everything was fine except for the 1064 error i was getting which is also fine now :) Rose The strong survive BUT the best succeed !! 1064 - You have an error in your SQL syntax
indeho Posted March 18, 2006 Posted March 18, 2006 I've got the same problem and can't get it fixt.If someone knows how :-) :lol: HE rik had je ook aan mij kunnen vragen Dennis :thumbsup:
dandelion Posted May 5, 2006 Posted May 5, 2006 I don't know why I get a blank admin - The upload file was corrected for previous sites and I checked the line and it's fine. php5 compatibility problem admin/includes/classes/upload.php on line 31, edit $this = null; to this: unset($this); I have // self destruct unset($this); return false; } Do you know of any other reasons that I could be getting a blank admin?
shellqc Posted June 3, 2006 Posted June 3, 2006 You only needed to do a search for $this on the forum and you'd have found hundreds, if not thousands, of replies. But here it goes again: php5 compatibility problem admin/includes/classes/upload.php on line 31, edit $this = null; to this: unset($this); Vger I've checked this document for that line 31. I can't find it. It's not even in the original install files when I went back and looked. Am I missing something? I'm not sure what version PHP I have, this is what it says when I log into it phpMyAdmin - 2.8.0.4. Could this be my issue? Is there something else you know of to try? For some reason I still get a blank page when I try to hit www.mydomain.com/catalog/admin Any suggestions?
jermie Posted June 12, 2006 Posted June 12, 2006 I am having somewhat of a similar problem. I fixed line 31 with the advice i found on the forum but now when I try to upload an image from my website I get this error : (Fatal error: Cannot re-assign $this in /home/makeyour/public_html/osCommerce/catalog/includes/classes/upload.php on line 33) I believe line 33 is the return false part: This problem occured to me while I was uploading products from the admin panel. Any Ideas would be great. if ( ($this->parse() == true) && ($this->save() == true) ) { return true; } else { // self destruct //$this = null; return false; } } } Thank you for your time. Jeremy
pracing Posted October 27, 2006 Posted October 27, 2006 I've checked this document for that line 31. I can't find it. It's not even in the original install files when I went back and looked. Am I missing something? I'm not sure what version PHP I have, this is what it says when I log into it phpMyAdmin - 2.8.0.4. Could this be my issue? Is there something else you know of to try? For some reason I still get a blank page when I try to hit www.mydomain.com/catalog/admin Any suggestions? +1 Same problem here...
toddimus Posted January 24, 2007 Posted January 24, 2007 +1Same problem here... i have a blank catalog and a blank website but i can access the admin. i can't find that "$this=null;" anywhere. *edit* nevermind. got the 2.2 version but still having the problems...
tdoherty Posted July 27, 2007 Posted July 27, 2007 OK, so I followed the instructions posted here to solve the line 31 problem but now I have.... Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/models/rtodd/admin/includes/classes/upload.php:1) in /usr/www/users/models/rtodd/admin/includes/functions/general.php on line 18 I also searched the forums and cannot find a fix....anyone else run into this? Thanks
majika Posted October 26, 2007 Posted October 26, 2007 unset $this; Worx for me, can now view, and administratre my shop... This is definitly one for the code snippet collection, Thanks :)
caryne444 Posted November 7, 2007 Posted November 7, 2007 I edited the "unset $this;" but am still getting the same error: "Fatal error: Cannot re-assign $this in /home/....admin/includes/classes/upload.php on line 31" Anything else I need to do to be able to access my Admin Panel?
Guest Posted November 7, 2007 Posted November 7, 2007 Hey vyger, YOu're the man!!! Thanks man! YOu really help me a lot with your savvy! That is an insult.
pmacneill Posted November 26, 2007 Posted November 26, 2007 You only needed to do a search for $this on the forum and you'd have found hundreds, if not thousands, of replies. But here it goes again: php5 compatibility problem admin/includes/classes/upload.php on line 31, edit $this = null; to this: unset($this); Vger Thanks - was wondering what had changed since my hosting company moved me to a new server..... Worked a treat.
tyro Posted November 26, 2007 Posted November 26, 2007 You only needed to do a search for $this on the forum and you'd have found hundreds, if not thousands, of replies. But here it goes again: php5 compatibility problem admin/includes/classes/upload.php on line 31, edit $this = null; to this: unset($this); Vger Really?...
draclif Posted December 20, 2007 Posted December 20, 2007 any suggestions on what I should do when I do not have an upload.php file in the admin/includes/classes directory?
germ Posted December 20, 2007 Posted December 20, 2007 If I'm not mistaken, when you get an error regarding this file, the complete path to the file is output into your browser window. Just follow it. If you can't find it, either your PHP code tells lies, or you're just not looking in the right place.... :blush: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
virtu Posted January 15, 2008 Posted January 15, 2008 My administrator also upgraded both mysql and PHP to versions 5. I've done everything in the official manual and this trick to upload.php but i still the following error while uploading images Error Error: File upload not saved. at the top of the screen when I click preview on new product. I did change the new server path in config.php.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.