Friday 26 April 2013

Solution : PHP Warning: mysql_connect(): No such file or directory

If you get PHP Warning: mysql_connect(): No such file or directory and unable to connect mysql through php then change localhost to 127.0.0.1 while connecting to database

example:
$connection = mysql_connect('localhost', 'root', 'password');
to
$connection = mysql_connect('127.0.0.1', 'root', 'password');
Read More

Wednesday 10 April 2013

Solution : The mysqli extension is missing. Please check your PHP configuration

if you get The mysqli extension is missing. Please check your PHP configuration error in phpmyadmin
follow two steps

1. install php-mysql
in redhat , fedora
yum install php-mysql
in ubuntu
apt-get install php-mysql

2. restart apache server
restart mysql
Read More

Tuesday 9 April 2013

Steps to Install Python3 in Linux through Command Line

To Install Python3 in linux through Command line follow below commands

Dependencies for Python3 is gcc and some times zlib-devel so install these first

in redhat ( RHEL ), fedora etc
commands are
root@bt:~# yum install gcc
root@bt:~# yum install zlib-devel

in Ubuntu, Linux Mint etc
commands are

root@bt:~# apt-get install gcc
root@bt:~# apt-get install zlib-devel


Download latest version of Python3 (  bzipped source tarball)  from http://www.python.org/download/ 
Now it is Python-3.3.1.tar.bz2
root@bt:~# wget http://www.python.org/ftp/python/3.3.1/Python-3.3.1.tar.bz2

Extract It
root@bt:~# bzip2 -cd Python-3.3.1.tar.bz2 | tar xvf -

Goto Extracted Folder
root@bt:~# cd Python-3.3.1

Configure Python3

root@bt:~/Python-3.3.1# ./configure --prefix=/opt/python3

Make
root@bt:~/Python-3.3.1# make

Install 
root@bt:~/Python-3.3.1# make install

Add Shortcut
root@bt:~/Python-3.3.1# ln -s /opt/python3/bin/python3 /usr/bin/python3

Use Python3
root@bt:~/Python-3.3.1# python3

Python 3.3.1 (default, Apr  9 2013, 12:32:54) 
[GCC 4.4.5 20101112 (Red Hat 4.4.5-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Read More

Saturday 6 April 2013

Solution: Unable to access mysql server of Amazon ec2 instance remotely



If you have problem in accessing mysql server server publicly or remote even in the security group if you open mysql port 3306 in inbound rules. to solve this problem simply stop iptables.

First check port 3306 whether it is Listining or not 
[root@ip-10-142-194-252 ~]# netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:40972               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
tcp        0    248 10.142.194.252:22           117.213.139.76:1086         ESTABLISHED
tcp        0      0 :::111                      :::*                        LISTEN
tcp        0      0 :::80                       :::*                        LISTEN
tcp        0      0 :::22                       :::*                        LISTEN
tcp        0      0 ::1:631                     :::*                        LISTEN
tcp        0      0 :::55704                    :::*                        LISTEN

Now stop iptables
[root@ip-10-142-194-252 ~]# service iptables stop;
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
[root@ip-10-142-194-252 ~]#

I think now you can access.
Read More

Solution: Unable to access httpd server on Amazon ec2 instance


If you have problem in accessing http server publicly even in the security group if you open http port 80 in inbound rules. to solve this problem simply stop iptables.

First check port 80  whether it is Listining or not 
[root@ip-10-142-194-252 ~]# netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:40972               0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
tcp        0    248 10.142.194.252:22           117.213.139.76:1086         ESTABLISHED
tcp        0      0 :::111                      :::*                        LISTEN
tcp        0      0 :::80                       :::*                        LISTEN
tcp        0      0 :::22                       :::*                        LISTEN
tcp        0      0 ::1:631                     :::*                        LISTEN
tcp        0      0 :::55704                    :::*                        LISTEN

Now stop iptables
[root@ip-10-142-194-252 ~]# service iptables stop;
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Unloading modules:                               [  OK  ]
[root@ip-10-142-194-252 ~]#

I think now you can access.
Read More
Here We Write The Problems we face at different situations and Solutions to those problems.