Knowledge Base Article

osCommerce error "Fatal error: Cannot re-assign $this"

The error is caused because your OS Commerce is based on PHP4 rather than PHP5. To resolve the error message, please follow the instructions below:


1. Go to your cPanel. Refer to SiteGround cPanel access guide.


2. Click on the File Manager icon.


3. Click on the folder icon next to public_html folder name.


4. Click on the folder icon next to the folder in which your osCommerce is installed


5. Find ../catalog/admin/includes/classes/upload.php file and click on it


6. In the upper right corner you will see several management options for upload.php file. Click on Edit File


7. Open the file and find the line (about 30 lines down) that say's:

 

// self destruct
$this = null;

 

And edit it to say this:

 

// self destruct
// $this = null;
unset($this);

 


This should solve your problem.


_______________

Find expert osCommerce hosting services at SiteGround.com: osCom-optimized servers, expert in support team, free installation of osCommerce, free osCommerce tutorial, and more.


Rating

Please indicate if this article was helpful for you.

rating :  3.5 from 5
views :  1586
votes :  26

Valid XHTML 1.0 Strict Valid CSS!