Wednesday, May 23, 2012

Install phpMyAdmin on CentOS 5 - With Yum Installation

Install MySQL

yum install mysql-server mysql mysql-devel
chkconfig mysqld on
service mysqld start
 Set Password for MYSQL
mysql -u root -p
enter password

Install PHP & HTTPD

yum install php php-mysql
yum Install httpd

Download the rpmforge package from Centos website
after installing rpmforge run following command
yum install phpmyadmin

vi /etc/httpd/conf.d/phpmyadmin.conf
the format should be like below (allow from all)
<Directory "/usr/share/phpmyadmin">
  Order Deny,Allow
  Deny from all
  Allow from all
</Directory>


Go to phpmyadmin direcotry (in my case it /usr/share/phpmyadmin)
cp config.sample.inc.php config.inc.php
vi config.inc.php

Edit th config.inc.php file, find the line that contacin "blowfish_secret", and modify like below
$cfg['blowfish_secret'] = 'TypeAnything_for_secure';

(Type any secure password instead of TypeAnything_for_secure)

service httpd restart


Open browser & type http://ipaddress_of_machine/phpmyadmin
login with root
password of mysql (which you set earlier)

Tuesday, May 22, 2012

Install DBD::Oracle in Ubuntu

ERROR

root@bhagwat-desktop: perl Makefile.PL
Using DBI 1.620 (for perl 5.012004 on i686-linux-gnu-thread-multi-64int) installed in /usr/local/lib/perl/5.12.4/auto/DBI/

Configuring DBD::Oracle for perl 5.012004 on linux (i686-linux-gnu-thread-multi-64int)

Remember to actually *READ* the README file! Especially if you have any problems.

Trying to find an ORACLE_HOME
Your LD_LIBRARY_PATH env var is set to ''

      The ORACLE_HOME environment variable is not set and I couldn't guess it.
      It must be set to hold the path to an Oracle installation directory
      on this machine (or a machine with a compatible architecture).
      See the appropriate README file for your OS for more information.
      ABORTED!

Solution


Oracle Instant Client

Download the instant client packages you’ll need. I chose to download the RPMs and convert them to .deb files using alien Oracle also provides .zip files if you don’t want to do it the alien way.
convert rpm into deb package through aliean (apt-get install alien)
aliean oracle-instantclient11.2-basic-xx.x.x.x.x-x.i386.rpm
Above command convert rpm to deb package
install the deb package 
dpkg -i  xxxxx*.deb
 Then type this command at terminal
export ORACLE_HOME=/usr/lib/oracle/11.2/client/
echo $ORACLE_HOME 
create permanent entry with 
vi /etc/profile
ORACLE_HOME=/usr/lib/oracle/11.2/client/
export ORACLE_HOME

 

 Install DBD::Oracle with following command

cpan DBD::Oracle
or 
go to downloaded directory of DBD::Oracle package & run 
perl Makefile.PL
make
make install

Wednesday, May 9, 2012

Install OCI8 in Centos/RedHat

Install OCI8 in Centos

Download OCI8 package from here
http://pecl.php.net/package/oci8
tar -xzvf oci-<VERSION>.tgz
cd oci-<VERSION>
phpize

1) Configure the PECL package as a shared object using the instant client and specifying where the Oracle client libraries are. Then build and install it.

./configure –with-oci8=instantclient,/usr/lib/oracle/<VERSION>/client/lib
make
make install

2) Add the library shared object for PHP

echo extension=oci8.so > /etc/php.d/oci8.ini

3) Start Apache

‘service httpd start’ _or_ ‘/etc/init.d/httpd restart’

4) Create a PHP info page and checked to see if the Oracle (oci8) driver is listed:

echo <? phpinfo(); ?> > /var/www/html/phpinfo.php

Install PDO_OCI in Centos

First install oracle instant client
Download Oracle Instant Client (basic and devel) from here:
    http://www.oracle.com/technetwork/topics/linuxsoft-082809.html

Install
    rpm -ivh oracle-instantclient11.2-basic-11.2.0.1.0-1.i386.rpm
    rpm -ivh oracle-instantclient11.2-devel-11.2.0.1.0-1.i386.rpm

Optional - Add the Oracle instant client to dynamic linker
    echo /usr/include/oracle/11.2/client/lib/ > /etc/ld.so.conf.d/oracle_client.conf
    ldconfig -v
    If not working then type below command (Both do the same thing)
    echo /usr/lib/oracle/11.2/client/lib/ > /etc/ld.so.conf.d/oracle_client.conf

Optional - Oracle Profile
    Create a new file in /etc/profile.d named oracle.sh and include the following:
        export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client/lib/
        export     ORACLE_HOME=/usr/lib/oracle/11.2/client/lib/
      
Save the file with :wq Enter
    Run:
        source /etc/profile.d/oracle.sh

Download pdo_oci
Download pdo_oci from there:
        http://pecl.php.net/package/PDO_OCI/1.0

Untar the package and prepare it for compiling (using directory /opt/oracle/src/)
   tar -xzvf PDO_OCI-.tgz
   cd PDO_OCI-
   phpize
Example
   tar –xzvf PDO_OCI-1.0.tgz
   cd PDO_OCI-1.0
   phpize

Patch
If you work with Oracle Instant Client version 11.2, you need edit the config.m4 file and add the following after exploding the src look for similar sections:
Block 1:
   elif test -f $PDO_OCI_DIR/lib/libclntsh.$SHLIB_SUFFIX_NAME.11.2; then
   PDO_OCI_VERSION=11.2
Block 2
   11.2)
      PHP_ADD_LIBRARY(clntsh, 1, PDO_OCI_SHARED_LIBADD)
     ;;

Compiler
(IMP) Please run phpize command again in PDO_OCI folder else Patch won't work

   ./configure  --with-pdo-oci=instantclient,/usr,11.2
   make
   make install

If above command not working please run below command otherwise continue with next step
./configure  --with-pdo-oci=instantclient,/usr/lib/oracle/11.2/client/lib
make
make install

Include in files to php parsed
Create a new file in /etc/php.d named pdo_oci.ini and include the following

   extension=pdo_oci.so

Start apache
   service httpd start  or /etc/init.d/httpd restart

It's Done.........:)
Write to me bhagwat@outlook.in if you need more support on this

Must Read for Every Corporate Employee

It’s half past 8 in the office but the lights are still on… PCs still running, coffee machines still buzzing… And who’s at work? Most of them ??? Take a closer look…

All or most specimens are ?? Something male species of the human race…

Look closer… again all or most of them are bachelors…

And why are they sitting late? Working hard? No way!!! Any guesses??? Let’s ask one of them… Here’s what he says… ‘What’s there 2 do after going home…Here we get to surf, AC, phone, food, coffee that is why I am working late…Importantly no bossssssss!!!!!!!!!!!’

This is the scene in most research centers and software companies and other off-shore offices.

Bachelors ‘Passing-Time’ during late hours in the office just bcoz they say they’ve nothing else to do… Now what r the consequences…

‘Working’ (for the record only) late hours soon becomes part of the institute or company culture.

With bosses more than eager to provide support to those ‘working’ late in the form of taxi vouchers, food vouchers and of course good feedback, (oh, he’s a hard worker….. goes home only to change..!!). They aren’t helping things too…

To hell with bosses who don’t understand the difference between ‘sitting’ late and ‘working’ late!!!

Very soon, the boss start expecting all employees to put in extra working hours.

So, My dear Bachelors let me tell you, life changes when u get married and start having a family… office is no longer a priority, family is… and That’s when the problem starts… b’coz u start having commitments at home too.

For your boss, the earlier ‘hardworking’ guy suddenly seems to become a ‘early leaver’ even if u leave an hour after regular time… after doing the same amount of work.

People leaving on time after doing their tasks for the day are labelled as work-shirkers…

Girls who thankfully always (its changing nowadays… though) leave on time are labelled as ‘not up to it’. All the while, the bachelors pat their own backs and carry on ‘working’ not realizing that they r spoiling the work culture at their own place and never realize that they would have to regret at one point of time.

So what’s the moral of the story??
* Very clear, LEAVE ON TIME!!!
* Never put in extra time ‘ unless really needed ‘
* Don’t stay back unnecessarily and spoil your company work culture which will in turn cause inconvenience to you and your colleagues.

There are hundred other things to do in the evening..

Learn music…..

Learn a foreign language…

Try a sport… TT, cricket………..

Importantly,get a girl friend or boy friend, take him/her around town…

* And for heaven’s sake, net cafe rates have dropped to an all-time low (plus, no fire-walls) and try cooking for a change.

Take a tip from the Smirnoff ad: *’Life’s calling, where are you??’*

Please pass on this message to all those colleagues and please do it before leaving time, don’t stay back till midnight to forward this!!!

IT’S A TYPICAL INDIAN MENTALITY THAT WORKING FOR LONG HOURS MEANS VERY HARD WORKING & 100% COMMITMENT ETC.

PEOPLE WHO REGULARLY SIT LATE IN THE OFFICE DON’T KNOW TO MANAGE THEIR TIME. SIMPLE !