Setting the MageBridge URLs in Magento - Yireo

Handling file uploads in MageBridge

Magento adds the ability to let customers upload their own files when adding a specific Magento product to their cart. MageBridge is able to bridge this functionality to Joomla!, but it is important to make sure your hosting environment meets up to the requirements. This tutorial guides you through all of the steps.

Earth-Upload-iconMagento settings

There are numerous settings that determine the behaviour of file uploads in Magento and MageBridge. However, we recommend you first test things in Magento stand-alone before testing things in Joomla!. If it doesn't work in Magento, it also does not work in MageBridge.

Make sure the Magento folder /media/custom_options exists and is writable by the webserver. Make sure the PHP upload_tmp_dir is writable. Also make sure the PHP post_max_size is higher than or equal to the PHP upload_max_filesize - setting them both to 50Mb would solve most problems. Note that some Apache settings like LimitRequestBody might conflict as well, which is something your hosting provider should deal with. Make sure that large files can be uploaded also from low-bandwidth clients by configuring the PHP settings max_execution_time and max_input_time.

PHP-settings for Magento

  • file_uploads = On
  • upload_tmp_dir = (a writable folder)
  • post_max_size = 32M (filesize)
  • upload_max_filesize = 32M (filesize)
  • memory_limit = 256M (Magento minimum)
  • max_input_time = 600 (seconds)
  • max_execution_time = 600 (seconds)

Joomla! settings

Every file that is uploaded, is actually uploaded to Joomla! first and then transferred within the bridge request to Magento. Because of this proxy-behaviour of MageBridge, you need to make sure the upload-settings on the Joomla! side are equal to the Magento side. This is especially true when Magento and Joomla! are located on different webservers.

Make sure the Joomla! tmp-folder is readable and writable by the webserver - if it is not, this is reported by the MageBridge System Check. Make sure to check the same PHP settings as mentioned for Magento earlier. Ideally the PHP settings for Magento are the same as the PHP settings for Joomla!. Note that the maximum filesize in the Joomla! Global Configuration is not used by MageBridge.

Also make sure your Joomla! template includes a message-box, that provides feedback to your visitors. Some templates are not shipping with this tag, while it should be mandatory for every template:

<jdoc:include type="message" />

PHP-settings for Joomla!

  • file_uploads = On
  • upload_tmp_dir = (a writable folder)
  • post_max_size = 32M (filesize)
  • upload_max_filesize = 32M (filesize)
  • memory_limit = 64M (filesize plus Joomla! requirement)
  • max_input_time = 600 (seconds)
  • max_execution_time = 600 (seconds)

CURL problems

The bridge between Joomla! and Magento is built using the CURL library. Sometimes CURL libraries are out of date or upgraded incorrectly, which may result in weird behaviour in the bridge. If you encounter endless loops when contacting Magento, or when files are not uploaded correctly, you may try to modify the MageBridge option CURL POST as array (within the Joomla! MageBridge component under the tab Other settings).

Created on Thursday, 23 December 2010
Modified on Thursday, 13 January 2011

About Yireo

Yireo tries to help webdevelopers build successful Joomla! and Magento sites.

More about Yireo