Tikejhya: Ashish Nepal

Knowledgebase

Month: June 2011

PHP Fatal error: Call to undefined function mysql_connect()

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

there are various reason why you may get this error.

  • Verify that your installation of PHP has been compiled with mysql support.
  • In Linux, the line is
    extension=mysql.so

    and in Windows, the line is

    extension=php_mysql.dll

    .

  • Check if the php-mysql package is installed by opening a terminal window (bash), and typing,

    Your ads will be inserted here by

    Easy Plugin for AdSense.

    Please go to the plugin admin page to
    Paste your ad code OR
    Suppress this ad slot.

    rpm -qa | grep php

    . If you don’t see it, make a note of the exact version of PHP that is installed.

  • If Not Install php-mysql (yum install php-mysql – centos)
  • The last step is to restart Apache. You can do this with one of the following commands,
    apachectl restart

    or

    /etc/rc.d/init.d/httpd restart

    .

BASH Screen Share

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

Shell1 – screen
Shell2 – screen -x

screen

screen -r [attach]

ctrl-a d [detach]
ctrl-a : [command mode]
sessionname SESSIONNAME [set session name]

Using command-line history

The command

:his

lists the command history, and

:his /

lists the search history.

Type q: for commands, or q/ for searches;

@: holds the last command, and @/ holds the last search.

Disable/Enable DNS SRV records

vi /etc/asterisk/sip.conf or if you donot edit sip.conf manually,

vi /etc/asterisk/additional_sip.conf

srvlookup=yes
srvlookup=no

FREEPBX - GUI
Go to tools option ¬
Asterisk SIP Setting ¬

SRV LookupEnable Asterisk srvlookup.

Mysql Dump & Restore

MYSQL Dump

mysqldump -u root -p ‘database_name’ >database.dump

 

MYSQL Restore

mysql -u root -p ‘database_name’ < database.dump

mysqladmin create/update password

 

mysqladmin -u root password NEWPASSWORD

Chage or update root password.

mysqladmin -u root -p'oldpassword' password newpass

Mysql Grant Privileges

CREATE USER 'honkey'@'localhost' IDENTIFIED BY 'mypass';
GRANT ALL PRIVILEGES ON honkey_test.* TO 'honkey'@'localhost' WITH GRANT OPTION

;

Disable Linux User Shell Account

Type the following command to disable shell access for [user]:

# chsh -s /sbin/nologin {username}

New Repository (Remi’s Repo)

Lets say if we want to install PHP 5.2.5 which is the latest version in the repos  you can make use of a RPM repository maintained by Remi. He has a repository for many distros.
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm

(if there is no 5-3 try 5-4 no 5-4 try 5-5 ……..)

wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm

# rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm

Now you have remi’s repo in ur system. so to use the remis repo to install your packages you have to tell yum to use the new repo..

(using same context of PHP update follow below given command)
yum –enablerepo=remi update php (package)

RPM (Redhat Package Manager)

RPM “Redhat Package Manager” is open source package management system created by Redhat.

RPM DB Location: /var/lib/rpm

(Holds database files that the RPM needs in order to refer to recent Installation, updates.)

File Convention: packagename-version-release-architecture.extension (bison-2.3- 2.1 – i386-.rpm)

Read More

Powered by WordPress & Theme by Anders Norén