ablog

不器用で落着きのない技術者のメモ

php: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No such file or directory

現象

$ php -v
php: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No such file or directory

対応

$ su -
# usermod -G oinstall,dba foo
$ su - foo
$ vi ~/.bash_profile
# for oracle
export LANG=C
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/10.2.0
export PATH=.:$ORACLE_HOME/bin:$PATH
export ORA_NLS10=$ORACLE_HOME/nls/data
export LD_LIBRARY_PATH=.:$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=American_America.JA16SJISTILDE
export ORACLE_SID=orcl
umask 022

結果

$ . ~/.bash_profile
$ php -v
PHP 4.4.8 (cli) (built: May 21 2010 15:50:54)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies