Has an magento store which is getting busy into his business day by day and start throwing some performance related errors like this this one.
Yes this is Too many database connections problem when your store start getting attention of your visitors this could be obvious problem because you don't have took any developer care about the future of you store, so here is some tips about getting up and running your store smoothly.
This error comes when you try to connect to your mysql server and all available connections are in use by some other visitors.the number of connections is controlled by max_connections system variable this is set to 151 by default for MYSQL 5.5 and you can increase its values by following this simple steps :
1) Open your mysql configuration file located at /etc/my.cnf
2) Locate this variable max_connections
3) Set your desire number of available connection number for avoiding future error
max_connections = 250
4) Restart you mysql server and this will surely off your headache.
Thanks
If you found this post helpful and enjoyable please comment and share. :-)
Thursday, April 18, 2013
Wednesday, April 17, 2013
Solution for just host hosting error : an error occurred while processing this directive
Phew!! one day i was working with justhost joomla installation and after making the site live i have seen following error on the site .
[an error occurred while processing this directive]
So here is i am sharing the solution for this issue : Basically this file permission issue which could be solve by just changing all folders permission to 755 and files permission to 644.
Screen for changing all files permissions to 644 :
[an error occurred while processing this directive]
So here is i am sharing the solution for this issue : Basically this file permission issue which could be solve by just changing all folders permission to 755 and files permission to 644.
Screen for changing all files permissions to 644 :
Tuesday, April 16, 2013
Magento : Importing large databases using mysql CLI on localhost
In one of my project i need to set up my client project on local computer with a very large database aroun ~1.6 GB in size and this gave me headache of importing via phpmyadmin GUI, so here is a quick way of importing large databases using Command promt, just follow the given steps :
1) Open the CMD(DOS) and open your mysql folder from wamp folder on my pc this is
C:\> cd C:\wamp\bin\mysql\mysql5.5.0\bin
2) After this write this command for firing up the mysql
C:\> cd C:\wamp\bin\mysql\mysql5.5.0\bin>mysql.exe -use youdbname -u username -p password
this line will connect with your given database
3) I prefered to copy the sql under the same folder where mysql.exe resides, and then run this
mysql> source yourlargesql.sql;
This will surely import your large sql file.
Thanks and happy coding.
1) Open the CMD(DOS) and open your mysql folder from wamp folder on my pc this is
C:\> cd C:\wamp\bin\mysql\mysql5.5.0\bin
2) After this write this command for firing up the mysql
C:\> cd C:\wamp\bin\mysql\mysql5.5.0\bin>mysql.exe -use youdbname -u username -p password
this line will connect with your given database
3) I prefered to copy the sql under the same folder where mysql.exe resides, and then run this
mysql> source yourlargesql.sql;
This will surely import your large sql file.
Thanks and happy coding.
Monday, April 15, 2013
Magento : Solution for The PDO extension is required for this adapter but the extension is not loaded
Add this lines to your php.ini placed at the root of you installation
extension=pdo.so
extension=pdo_mysql.so
extension=php_pdo_mysql.dll
This should solve your problem
Thanks
extension=pdo.so
extension=pdo_mysql.so
extension=php_pdo_mysql.dll
This should solve your problem
Thanks
How to prevent spam without using captcha
Using captcha's on your website form to prevent spam there a plenty of reasons of not using CAPTCHA'S
Here is some examples of simple methods to prevent spam without using captcha :
1) Using css :
We can declare some additional fields and hide them using css and upon form submission check those fields on server side if some robot script try to fill out the fields they will also populate those hidden fields.
Example :
Your HTML would be
[html]
<label>Leave this blank: <input class="hidethis" type="text" name="leaveblank" /></label>
<label>Do not change this: <input class="hidethis" type="text" name="dontchange" value="http://" /></label>
[/html]
Your css
[css]
.hidethis{ display:none; }
[/css]
Your server side php
[php]
if ($_POST['leaveblank'] != '' or $_POST['dontchange'] != 'http://') {
// display message that the form submission was rejected
}
else {
// accept form submission
}
[/php]
2) Use php to change input field names periodically : We can use the date() function to change field names, use the daily date parameter.
[php]
$date = date('d');
$html = "<input type='text' name='abc$date'>\n";
if ( !isset($_POST["abc$date"] ) {
// do not accept the request
}
[/php]
- It creates a barrier to users by with giving a frustrating images or text
- Need extra effort to work upon, because they are annoying and disturb your visitor attention
- CAPTCHAs Can Consume A Lot Of Hosting Resources : CAPTCHAs requires additional CPU memory as they generate random text based images which may slow down a shared server.
- CAPTCHAs Can Be Broken : CAPTCHAs can be bypassed and broken, attackers can have outsourced human workers who can easily deCAPTCHA your security. Another, much more rare way that CAPTCHAs can be broken, is through computer algorithms that are capable of cracking even the most sophisticated CAPTCHA systems.
Here is some examples of simple methods to prevent spam without using captcha :
1) Using css :
We can declare some additional fields and hide them using css and upon form submission check those fields on server side if some robot script try to fill out the fields they will also populate those hidden fields.
Example :
Your HTML would be
[html]
<label>Leave this blank: <input class="hidethis" type="text" name="leaveblank" /></label>
<label>Do not change this: <input class="hidethis" type="text" name="dontchange" value="http://" /></label>
[/html]
Your css
[css]
.hidethis{ display:none; }
[/css]
Your server side php
[php]
if ($_POST['leaveblank'] != '' or $_POST['dontchange'] != 'http://') {
// display message that the form submission was rejected
}
else {
// accept form submission
}
[/php]
2) Use php to change input field names periodically : We can use the date() function to change field names, use the daily date parameter.
[php]
$date = date('d');
$html = "<input type='text' name='abc$date'>\n";
if ( !isset($_POST["abc$date"] ) {
// do not accept the request
}
[/php]
Tuesday, April 9, 2013
Magento : Updating a customer password from phpmyadmin
Here is simple password reset trick for those who don't know their customer password or some developer trying to access some customer account in magneto so here we go,
1) You should have the customer Id from the magento admin or from some where else for query with tables
2) Open phpmyadmin and load the table <b>customer_entity_varchar</b>

3) In the customer_entity_varchar seacrh for customer id

4) Edit the row which has attribute_id 12, this row contains the MD5 password hash
5) Enter your password which you will generate from Magento Password Hash

6) Save the row and that's it try login with new password this should work.
Happy coding :-)
1) You should have the customer Id from the magento admin or from some where else for query with tables
2) Open phpmyadmin and load the table <b>customer_entity_varchar</b>
3) In the customer_entity_varchar seacrh for customer id
4) Edit the row which has attribute_id 12, this row contains the MD5 password hash
5) Enter your password which you will generate from Magento Password Hash
6) Save the row and that's it try login with new password this should work.
Happy coding :-)
Magento : Solution for bogus URL is not showing Not found page
Here is quick admin setting for those who are battling with a problem that when you enter a bogus or unidentified URL for your site the 404 not found page is not coming up,
Just login to your admin panel and follow these steps
'System -> Configuration -> Web -> Default Pages -> CMS No Route Page'
Here is quick screen shot :

Just login to your admin panel and follow these steps
'System -> Configuration -> Web -> Default Pages -> CMS No Route Page'
Here is quick screen shot :
Subscribe to:
Comments (Atom)