2014年2月19日 星期三

ubuntu 12.04 install php + mysql + apache2 + oracle + mssql develop environment

1. install all packages for os
# apt-get update
# apt-get upgrade

2. install compiler packages
# apt-get install buiild-essential fakeroot dpkg-dev

3. install apache, mysql server, php
# aptg-get install mysql-server mysql-client php5 php5-cli libapache2-mod-auth-mysql apache2

4. check php function
# vim /var/www/1.php
echo phpinfo();
?>

5. install mssql odbc module
# apt-get install php5-sybase

6. install oracle module
# apt-get install libaio1 php-pear unzip

7. download instantclient for oracle
# cd /usr/local/lib
# wget http://download.oracle.com/otn/linux/instantclient/121010/instantclient-basic-linux.x64-12.1.0.1.0.zip
# wget http://download.oracle.com/otn/llinux/instantclient/instantclient-sdk-linux.x64-12.1.0.1.0.zip
# unzip instantclient-basic-linux.x64-12.1.0.1.0.zip
# unzip instantclient-sdk-linux.x64-12.1.0.1.0.zip
# cd instantclient_12_1
# ln -s libclntsh.so.12.1 libclntsh.so

8. add some line to /etc/environment
# vim /etc/environment

# Oracle Instant Client
LD_LIBRARY_PATH="/usr/local/lib/instantclient_12_1"
TNS_ADMIN="/usr/local/lib/instantclient_12_1"
ORACLE_BASE="/usr/local/lib/instantclient_12_1"
ORACLE_HOME=$ORACLE_BASE

9. install oci8 package for pear
# pecl install oci8
when you get the prompt for oracle_home, key in the path 
'instantclient,/usr/local/lib/instantclient_12_1'

10. add extension to php.ini
# vim /etc/php5/apache2/php.ini

extension=oci8.so

11. change apache default charset to utf-8
#vim /etc/apache2/conf.d/charset
uncomment AddDefaultCharset UTF-8


12. restart apache
#/etc/init.d/apache2 restart

沒有留言:

張貼留言