Posts

Magento: Cannot add new attribute option values or delete after adding too many values

I've been trying different fixes for the issue mentioned but the fix below is the best. To fix this issue, do the following in php.ini: memory_limit = 256M max_execution_time = 3600 max_input_time = 600 post_max_size = 512M max_input_vars = 100000 suhosin.post.max_vars = 100000 suhosin.request.max_vars = 100000 You may add some lines if they don't exist yet. In CentOS, php.ini can be found in /usr/local/lib/php.ini. In Ubuntu, it's residing in the following : /etc/php5/apache2/php.ini /etc/php5/cgi/php.ini /etc/php5/cli/php.ini After modifying php.ini, please don't forget to restart Apache. That's all!

Ubuntu: Extract tar.bz2

To untar bz2 file, do this tar jxvf firefox-3.5.tar.bz2 If it does not work, you probably need to install bzip2, sudo apt-get install bzip2

Magento : Product CSV import Notice: unserialize(): Error at offset 925 of 1057 bytes in /var/www/magento/app/code/core/Mage/Dataflow/Model/Batch/Abstract.php on line 66

If ever you're getting an error like this when importing products CSV on Magento,  Notice: unserialize(): Error at offset 925 of 1057 bytes in /var/www/magento/app/code/core/Mage/Dataflow/Model/Batch/Abstract.php on line 66 Make sure to fix special characters on the description or short_description column and other columns. For some reason, Magento does not accept those special characters like  ™,  ®,  &,  £, and a lot more. Hope that helps...

Ubuntu: MySQL Export/Import all databases in CLI

To Export all your MySQL databases, do this : mysqldump -u yourusername -p -h localhost --all-databases | gzip > filename.sql.gz To Import all your MySQL databases, do this : mysql -u yourusername -p -h localhost < filename.sql Also you might wonder how I unzipped the gz file. You can do this gunzip filename.sql.gz

Magento: can't login to admin panel, can't add product to cart

Image
If ever you encountered issues like you cannot login to the admin panel or cannot even add product to the cart, I have a better solution for you. Using phpMyAdmin, in your magento database, look for the core_config_data table and click it. Click the "Search" tab.  Then on the "path" column set the operator to LIKE %...% and the Value to cookie and click the "Go" button to search. Screenshot provided for clarity After searching, set the value of web/cookie/cookie_path ,  web/cookie/cookie_domain ,  web/cookie/cookie_httponly , and  web/browser_capabilities/cookies to NULL Just like this on the screenshot. Screenshot provided for clarity Adding product to cart and logging in to the admin panel should work now!

Git: Colorizing

It's much easier to work with Git especially if it's colorized. And you can do that by simply executing these in your Terminal : git config --global core.pager "less -FRSX" git config --global color.ui auto git config --global color.pager true

Ubuntu: MySQL import/export with gunzip

To export your mysql database simply do the following : mysqldump -u user -p database | gzip > database.sql.gz   And to import it : gunzip < database.sql.gz | mysql -u user -p database