Category: Magento

  • Magento 1.9 Exception printing is disabled and can’t connect to MySQL server errors

    Magento 1.9 Exception printing is disabled and can’t connect to MySQL server errors

    After moving my Magento 1.9 store to a new host I got the error below and couldn’t fit it:

    Exception printing is disabled by default for security reasons.

    I tried a method mentioned at HostGator (not my host) which required me to navigate to the magento/lib/Zend/Cache/Backend/File.php and change a bit of code.  Unfortunately, that did not work for me.

    I also tried deleting the cache from var/cache but that didn’t work.

    I had enabled the errors list to be shown on the page by going to the errors folder from root installation and changing the local.xml.sample file to just local.xml.

    From there I got the error:

    magento SQLSTATE[HY000] [2003] Can’t connect to MySQL server on x.x.x.x

    Basically a connection error with my MySQL database.  I went to the softaculous installation and changed the details there from the old host IP address to localhost assuming that would change it but it didn’t work.

    Solution

    I couldn’t find the config file where the database details were stored until I visited this site.  The link is to a post that describes a different but related issue, the main thing is the file locations.

    I had to change the file local.xml located in app/etc/local.xml which I had never done before.  Inside the file there was data related the connection to the database.  I simply downloaded, changed the host to localhost and left the username, password and everything else the same.

    <default_setup>
    <connection>
    <host><![CDATA[localhost]]></host>
    <username><![CDATA[db_user]]></username>
    <password><![CDATA[db_pass]]></password>
    <dbname><![CDATA[db_name]]></dbname>
    <initStatements><![CDATA[SET NAMES utf8]]></initStatements>
    <model><![CDATA[mysql4]]></model>
    <type><![CDATA[pdo_mysql]]></type>
    <pdoType><![CDATA[]]></pdoType>
    <active>1</active>
    </connection>
    </default_setup>

    Uploaded the file and it was working again.

  • Magento SQL error SQLSTATE[HY000]

    SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction

    I have been receiving this error for a few days and couldn’t figure out what the problem was.  It wouldn’t let me update products and save to SQL.

    I found this site which gave the following instructions:

    Login to cpanel and phpMyAdmin, click on SQL for the command line interface (CLI):

    If you login to MySQL from CLI and run the command
    SHOW PROCESSLIST;
    You can see as an example
    6794372 the command is sleep and time is 3800. This is preventing other operations
    These processes should be killed 1 by 1 using the command.
    KILL 6794372;
    Once you have killed all the sleeping connections, things should start working as normal again
    Once I killed the sleep line I could save my inventory again.

     

  • Magento Paypal IPN error

    I was receiving messages from Paypal regarding incorrect IPN setup,

    This link has a workaround

    I still seemed to be getting my orders anyway and the orders showed correctly as processing in Magento.

  • Critical Patch SUPEE-5344 for Magento 1.9.1.0 CE installing without SSH access

    I was stressing about my new store install and installing the critical patch, I found this excellent guide and download to patch via FTP.  I first tested my site at shoplift.byte.nl and I got the dreaded red warning that my site was vulnerable.  I followed the instructions below and made a backup first.

    Applying Magento patches via FTP/sFTP or FileManager / File Upload

    To apply patches in this way we simply replace changed files. This way can not be used blindly if you or your developers have changed any core Magento files (which is a big no-no, by the way). Such changes should be re-applied to patched files, or you loose these changes.
    Patch SUPEE-1533 (Magento 1.7.x.x-1.9.1.0) applied to the following files:
    • app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php
    • app/code/core/Mage/Adminhtml/controllers/DashboardController.php
    Patched version of files for Magento 1.7.0.0-1.9.1.0 (including 1.7.0.2, 1.8.1.0 and 1.9.1.0 versions) packed into single ZIP archive: SUPEE-1533.zip. Simply unpack it and replace patched files on your store by uploading app folder into your Magento root directory.
    Patch SUPEE-5344 (Magento 1.8.x.x-1.9.1.0) applied to the following files:
    • app/code/core/Mage/Admin/Model/Observer.php
    • app/code/core/Mage/Core/Controller/Request/Http.php
    • app/code/core/Mage/Oauth/controllers/Adminhtml/Oauth/AuthorizeController.php
    • app/code/core/Mage/XmlConnect/Model/Observer.php
    • lib/Varien/Db/Adapter/Pdo/Mysql.php
    Patched version of these files for Magento 1.8.x.x-1.9.1.0 packed into single ZIP archive: SUPEE-5344.zip. Simply unpack it and replace patched files on your store by uploading app/ and lib/ folders into your Magento root.

    Took only a few minutes, when done, login to store and clear cache then check shoplift.byte.nl  again.  I got the green safe message, phew!

    Unfortunatel,y Magento don’t make it easy for us poor souls with not enough money to switch to the enterprise version and the unhelpful users in the forum don’t offer much help.

  • Magento 1.9.1 Editing the estimated shipping box text

    I wasn’t sure where the template was to edit the shipping box, this answer gave me the info

    Try enable magento path hints which should show the block/template that is displaying this info.
    To turn on template path hints in Magento:
    • log into the magento back-end admin.
    • Go to System -> Configuration in the main menu.
    • Go to Developer on the bottom left under ADVANCED.
    • Switch to the store view on the top left to your current website or store view.

     

  • Magento 1.9.1 customer e-mail templates

    To update the customer e-mail templates follow this guide to create new templates from the originals if desired.  Don’t forget to assign the new template to e-mail, in my case Settings>Config>Sales>Sales E-mails click the drop down and select the new template.

  • Magento 1.9.1 Categories and Sub Categories not displaying all products

    I had an issue with the main category and sub category not displaying products when the main category is clicked on, I only got a page with 0 products in category. The solution found here was simple but unbeknown to me:

    Go to Admin -> Catalog -> Manage Categories -> “Select Category” -> Display Settings -> Is Anchor = “Yes”
    Then:
    Admin -> System -> Index Management -> “Select All” -> “Reindex data” -> “Submit”

    Click on the main category Paper for example, this should show all products when clicked on and allow filtering into sub categories where the products are located i.e. Inkjet Paper, Laser Paper.

  • Magento 1.9.1 disallow access to dirs

    I wanted to disallow access to image dir from a browser, rather than put in a black index.html page I found this solution here

    In the main .htaccess file add the following code, save and upload.

    Options -Indexes

Pin It on Pinterest