[Solved] Cannot login to magento2 backend with localhost

I was not been able to login to the magento2 backend even if I provided correct username and password combination. Google took me over to here. But it appears to be for older version of magento. But similar solution worked.

Open app/code/core/Mage/Core/Model/Session/Abstract.php and comment line 139-141. And the issue is solved. I haven’t yet looked at the possible undesirable implications of this change, but locally having this is not big of an issue. I recommend not using this solution in production

[Solved] There has been an error processing your request during magento 2 installation

I was trying to install magento 2 locally after cloning the project from its github’s repository, but I was confronted with this error.

exception printing is disabled by default for security reasons

There has been error processing your request

Even, it was hard to tell for normal user what caused the error. After looking at logs, I came to conclusion that, the var/ and pub/ directories in the root directory need to be php writable. Hence I changed their permission to 777, and it worked!

[Solved] symfony 2 Major problems Major problems have been detected and must be fixed before continuing: Add “phar” to suhosin.executor.include.whitelist in php.ini*.

Well, when I was checking the requirements for symfony 2, I was presented with this Major Problem. I tried adding

suhosin.executor.include.whitelist=”phar”

to the end of php.ini file, but that was not helping. The important thing I was missing was installing php5-suhosin.
So install php5-suhosin by

sudo apt-get install php5-suhosin

And do restart your apache server before checking again.

[HOW-TO] Dump all mysql databases at once

This command comes handy when you want to dump all your databases at once.

mysqldump -u user -ppassword –all-databases > dumpname.sql

PHP errors not displayed even when error_reporting condition is defined in OSX 10.7.4

I had this problem on Mac OSX 10.7.4, the errors were not displayed, fatal errors would have totally rendered blank page with 500 status code. The solution that worked for me was

  1. Open php.ini file located at /private/etc/php.ini
  2. Find the line that has variable display_errors.
  3. In my case, it was display_errors = Off, I set it as On ie. display_errors = On

And it started showing errors! If you are on a production server, having it Off would be the best thing you can do!

Check Internet Availability for HTML5 Offline Application (Application Cache) for iPhone, iPad, Safari, Chrome, Firefox

If you are developing html5 offline application leveraging app-cache and finding it hard to detect the true internet availability, read on.

As you may already know window.navigator.onLine is not reliable. I found this handy script but it didn’t work quite well with safari browser on Mac, iPad and iPhone when I had the fallback for unavailable resources. The workaround that worked quite well is the following php script.

 <?php

header(‘HTTP/1.0 204 No Content’);
exit;

Save this php script with a name like check.php and the use following modification to the javascript function to check internet availability

function isOnline() {
if(window.navigator.onLine){
var s = $.ajax({
type: “HEAD”,
url: ‘check.php’ + “?” + Math.random(),
async: false
}).status;
// Check if 204 status code is returned
return s === 204;
}
return false;
}

This js script returns true network availability . Hope that will be helpful and somebody won’t have to scratch his head for days. :)

[SOLVED] Unable to open PDO connection [wrapped: SQLSTATE[HY000] [2002] No such file or directory]

I am migrating the existing symfony propel project I am working with from Ubuntu Linux to Mac OSX Lion. I have independent install of mysql. And I couldn’t get past this error.

Unable to open PDO connection [wrapped: SQLSTATE[HY000] [2002] No such file or directory]

Following steps solved my problem

On Terminal, execute these commands

  1. sudo mkdir /var/mysql/
  2. sudo ln -s /private/tmp/mysql.sock /var/mysql/mysql.sock

This should solve that error!. Actually it creates a symbolic link to /private/tmp/mysql.sock on /var/mysql/mysql.sock which the symfony/propel looks for.

[HOW-TO] Setup virtualhost for apache on MAC OSX Lion

It took me sometime to figure out setting up virtualhost for apache2 on Mac OSX Lion 10.7.4. I hope the following steps will be helpful.

  1. This is important, Edit httpd.conf located at /private/etc/apache2/httpd.conf. Uncomment the line

    Include /private/etc/apache2/extra/httpd-vhosts.conf

  2. I like to have separate files for each vhost entries. There add the following line at the end of httpd.conf

    Include /etc/apache2/sites/*.conf

  3. Now you can make new entries for any number of virtualhost you would want. Just name a file with extension conf  inside /private/etc/apache2/sites/ directory and those files will be included.

[HOW-TO] Disable Nvidia Discrete Graphics on Asus N53SV with Ubuntu 11.04

This solution worked for me.

1. First install acpi-call-tools

sudo apt-get install acpi-call-tools

2.

 sudo modprobe -v acpi_call

3.

sudo echo “\_SB.PCI0.PEG0.GFX0.DOFF” > /proc/acpi/call

Note : I had to face permission denied when I did sudo as well. This quick fix solved that as well.

sudo chmod 777 /proc/acpi/call

[Solved] Slow Wireless Connection [Wi-fi] on Ubuntu 11.10

I have installed Ubuntu 11.10 on my laptop very recently. I was facing very low Wireless speed. Even accessing the local resources via Wireless link was lousy. The solution that worked for me.

sudo apt-get install wicd

sudo apt-get purge network-manager

And then configure your network with Wicd Network Manager.