2016年9月のアーカイブ

Search




TOPページへ

このブログのフィードを取得
[フィードとは]

Powered by
Movable Type 4.23-ja

template by tokyobuddha

 ■■■■■免 責■■■■■
このサイトを参考にしたために発生した一切の損害に「てきとー管理者」は一切関知しませんし、補償もしません。 また、本サイトの記述が正しいことも保証しません。
自己責任にてお願いします。
 -------------------------

Galler Chocolate
ベルギー王室御用達として認定されたチョコレートブランド、ガレー。

岩塩ならクリスタルキンガ
野菜、肉、魚など素材本来の味を引き出します。上質でクセがなく西洋料理はもちろん中華、日本料理にも幅広くお使い頂けます。

Centos7でoci8を使う場合

OS標準のPHPだとoci8のパッケージが無いので、個別に入れなければならない。
ちと、面倒〜〜

oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm のインストール後、

# pecl install oci8-2.0.11
# vi /etc/php.d/oci8.ini
---
; Enable oci8 extension module
extension=oci8.so
---
を書き込んで、

# systemctl restart httpd

# php -m | grep oci
oci8


# php -i | grep oci8
/etc/php.d/oci8.ini,
oci8
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20


# php -i | egrep -i 'oracle|oci'
/etc/php.d/oci8.ini,
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.0.11
Oracle Run-time Client Library Version => 12.1.0.2.0
Oracle Compile-time Instant Client Version => 12.1
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20


# php --rf oci_connect
Function [ function oci_connect ] {

- Parameters [5] {
Parameter #0 [ $username ]
Parameter #1 [ $password ]
Parameter #2 [ $connection_string ]
Parameter #3 [ $character_set ]
Parameter #4 [ $session_mode ]
}
}


pdo_ociも使い場合は、下記も実行

# git clone https://github.com/hotta/pdo_oci
# cd pdo_oci
# phpize
# ./configure --prefix=/usr --exec-prefix=/usr --with-php-config=php-config --with-pdo-oci=instantclient,/usr,12.1
# make
# make install

# vi /etc/php.d/pdo_oci.ini
---
; Enable oci extension module
extension=pdo_oci.so
---


# systemctl restart httpd


# php -m|grep -i pdo_oci
PDO_OCI


# php -i | egrep -i 'oracle|oci'
/etc/php.d/oci8.ini,
/etc/php.d/pdo_oci.ini,
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.0.11
Oracle Run-time Client Library Version => 12.1.0.2.0
Oracle Compile-time Instant Client Version => 12.1
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
PDO drivers => mysql, oci, odbc, sqlite
PDO_OCI
PDO Driver for OCI 8 and later => enabled
PWD => /home/takahashi/soft/pdo_oci
ORACLE_HOME => /usr/lib/oracle/12.1/client64/lib
_SERVER["PWD"] => /home/takahashi/soft/pdo_oci
_SERVER["ORACLE_HOME"] => /usr/lib/oracle/12.1/client64/lib


# php -m | grep oci
oci8


# php -i | grep oci8
/etc/php.d/oci8.ini,
oci8
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20


# php -i | egrep -i 'oracle|oci'
/etc/php.d/oci8.ini,
/etc/php.d/pdo_oci.ini,
oci8
OCI8 Support => enabled
OCI8 DTrace Support => disabled
OCI8 Version => 2.0.11
Oracle Run-time Client Library Version => 12.1.0.2.0
Oracle Compile-time Instant Client Version => 12.1
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
PDO drivers => mysql, oci, odbc, sqlite
PDO_OCI
PDO Driver for OCI 8 and later => enabled
PWD => /home/takahashi/soft/pdo_oci
ORACLE_HOME => /usr/lib/oracle/12.1/client64/lib
_SERVER["PWD"] => /home/takahashi/soft/pdo_oci
_SERVER["ORACLE_HOME"] => /usr/lib/oracle/12.1/client64/lib


# php --rf oci_connect
Function [ function oci_connect ] {

- Parameters [5] {
Parameter #0 [ $username ]
Parameter #1 [ $password ]
Parameter #2 [ $connection_string ]
Parameter #3 [ $character_set ]
Parameter #4 [ $session_mode ]
}
}

こんな感じでしょうか〜〜

続きを読む "Centos7でoci8を使う場合" »

投稿時間: 12:40

Centos7のvsftps

Centos6.xの内容で設定していると、接続出来ない・・・(泣)
FTPクライアントでは
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
と、エラーになったり、
サーバーでは
# systemctl start vsftpd
Job for vsftpd.service failed because the control process exited with error code. See "systemctl status vsftpd.service" and "journalctl -xe" for details.

だったりと、色々大変・・・(汗)


以下の様な設定で接続できた。

------------------------------------------------------------------------

# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
# Allow anonymous FTP? (Beware - allowed by default if you comment this out).
#anonymous_enable=YES
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
# When SELinux is enforcing check for SE bool ftp_home_dir
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
# When SELinux is enforcing check for SE bool allow_ftpd_anon_write, allow_ftpd_full_access
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# Activate logging of uploads/downloads.
#xferlog_enable=YES
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/xferlog
xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
#xferlog_std_format=YES
xferlog_std_format=NO
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
ascii_upload_enable=YES
ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd/banned_emails
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
#chroot_local_user=YES
#chroot_list_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd/chroot_list
chroot_list_file=/etc/vsftpd/chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
ls_recurse_enable=YES
#
# When "listen" directive is enabled, vsftpd runs in standalone mode and
# listens on IPv4 sockets. This directive cannot be used in conjunction
# with the listen_ipv6 directive.
listen=NO
#listen=YES
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
# Make sure, that one of the listen options is commented !!
listen_ipv6=YES
#listen_ipv6=NO

#listen_address=
#listen_address6=

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES

# 追加設定 2016/09/06
use_localtime=YES
pasv_addr_resolve=YES
#pasv_address=XXXXXXXX.com
pasv_min_port=60000
pasv_max_port=60030
#ssl_enable=YES
#rsa_cert_file=/etc/pki/tls/certs/vsftpd.pem
#force_local_logins_ssl=NO
#force_local_data_ssl=NO
force_dot_files=YES
#reverse_lookup_enable=NO
seccomp_sandbox=NO
allow_writeable_chroot=YES

# ユーザー毎にアクセスディレクトリを変更するときの参照ディレクトリ
#user_config_dir=/etc/vsftpd/vsftpd_user_conf

------------------------------------------------------------------------

ポイントは
seccomp_sandbox=NO
allow_writeable_chroot=YES

でした。

投稿時間: 15:51