Thursday, May 16, 2013

dpkg: unrecoverable fatal error, aborting: Cannot allocate memory

dpkg: unrecoverable fatal error, aborting: fork failed: Cannot allocate memory

It means you do not have enough memory to execute the operation.

The fix is for memory error, if you are getting following error
E: Sub-process /usr/bin/dpkg returned an error code (1)
You should check this post.

Since it is a memory error, try to configure dpkg first.
$ sudo dpkg --configure -a
But if you are still getting the error.

Check the free and used physical memory in megabytes by following command.
$ free -m
It displays the total amount of free and used physical memory and swap space in the system, as well as the buffers and cache consumed by the kernel.


Flush file system buffers by executing :
$ sync
Now try again.

If you are still facing the same problem, follow this.
To free page cache:
$ echo 1 > /proc/sys/vm/drop_caches

To free dentries and i-nodes :
$ echo 2 > /proc/sys/vm/drop_caches

To free page cache, dentries and i-nodes :
$ echo 3 > /proc/sys/vm/drop_caches
Now try again.

Still the error is not fixed, you should check the RAM and SWAP space for your system / server. Assigning a bigger RAM / SWAP will solve the error.

Wednesday, May 15, 2013

Mysql error : start: Job failed to start

start: Job failed to start Error while starting mysql 

If you are not able to start mysql because of this error, try following solutions.

Solutions :

1) There should not be incorrect bind-address in my.cnf. If you have not uncommented it intentionally to enable binding, the line should be commented. If you are not sure about the address, comment the line and restart mysql.

2) Run following command and try to start mysql.
$ sudo dpkg-reconfigure mysql-server-5.5

3) Remove logfiles and try to start mysql.
$ sudo rm -rf /var/lib/mysql/ib_logfile*

4) If mysqld_safe is running with mysql, kill mysqld_safe
$ sudo killall -9 mysqld_safe

5) If any of these solutions are not working for you, try final solution.
    Remove and re-install mysql again.
Debian based :
$ sudo apt-get --purge remove mysql-server mysql-common mysql-client $ sudo apt-get install mysql-server mysql-common mysql-client
Yum Based :
$ sudo yum --purge remove mysql-server mysql-common mysql-client $ sudo yum install mysql-server mysql-common mysql-client

phpmyadmin : Cannot start session without errors

phpmyadmin error : cannot start session without errors please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.




Open file php.ini.
apache2 (Debian, Ubuntu) : /etc/php5/apache2/php.ini 
httpd (RHEL, CentOS) : /etc/php.ini

Uncomment following line there.
If it is CentOS or RHEL :
session.save_path = "/var/lib/php/session" 
If it is debian or ubuntu :
session.save_path = "/tmp"

Restart Apache.