코드이그나이터 버전 : 3.1.9

오라클 : 12c

 

 

 

1. /application/config/config.php

 

 

$config['sess_driver'] = 'database';

$config['sess_save_path'] = 'CI_SESSIONS';

$config['sess_cookie_name'] = 'ci_session';

$config['sess_expiration'] = 3600;

$config['sess_expire_on_close'] = TRUE;

$config['sess_encrypt_cookie'] = TRUE;

$config['sess_use_database'] = TRUE;

$config['sess_table_name'] = 'CI_SESSIONS';

$config['sess_match_ip'] = TRUE;

$config['sess_match_useragent'] = TRUE;

$config['sess_time_to_update'] = 300;

 

$config['sess_regenerate_destroy'] = FALSE;



2. /application/config/database.php

$tnsname = '(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.211.55.51)(PORT = 1521))

        (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl)))';

 

 

$db['default'] = array(

    'dsn' => '',

    'hostname' => $tnsname,

    'username' => 'ci3',

    'password' => 'ci3',

    'database' => '',

    'dbdriver' => 'oci8',    //mysqli, oci8

    'dbprefix' => '',

    'pconnect' => FALSE,

    'db_debug' => (ENVIRONMENT !== 'production'),

    'cache_on' => FALSE,

    'cachedir' => '',

    'char_set' => 'utf8',

    'dbcollat' => 'utf8_general_ci',

    'swap_pre' => '',

    'encrypt' => FALSE,

    'compress' => FALSE,

    'stricton' => FALSE,

    'failover' => array(),

    'save_queries' => TRUE

);



3. 테이블 만들기

CREATE TABLE CI_SESSIONS 

(

  SESSION_ID VARCHAR2(50 BYTE) DEFAULT '0' NOT NULL 

, TIMESTAMP NUMBER DEFAULT 0 NOT NULL 

, USER_AGENT VARCHAR2(256 BYTE) NOT NULL 

, USER_DATA VARCHAR2(1000 BYTE) 

, IP_ADDRESS VARCHAR2(256 BYTE) DEFAULT '0' NOT NULL 

) ;


CREATE UNIQUE INDEX CI_SESSIONS_PK ON CI_SESSIONS (SESSION_ID ASC

 

ALTER TABLE CI_SESSIONS ADD CONSTRAINT CI_SESSIONS_PK PRIMARY KEY (SESSION_ID);




4. /system/libraries/Session/drivers/Session_database_driver.php
변경(추가)된 부분은 빨간색으로 표시함.
-필드명과, 대소문자 주의

*오라클 사용자에게 SYS.DBMS_LOCK 권한이 주어져 있어야 함.
그렇지 않으면 다음과 같은 에러 메시지가 출력됨.

Message: oci_execute(): ORA-06550: 줄 3, 열4:PLS-00201: 'SYS.DBMS_LOCK' 식별자가 정의되어야 합니다 ORA-06550: 줄 3, 열4:PL/SQL: Statement ignored ORA-06550: 줄 4, 열15:PLS-00201: 'SYS.DBMS_LOCK' 식별자가 정의되어야 합니다 ORA-06550: 줄 4, 열4:PL/SQL: Statement ignored

 

 

 

CI3사용자에게 SYS.DBMS_LOCK 권한을 주는 방법 : 

SQLPLUS로  SYS로 로그인.

 

SQL> GRANT EXECUTE ON SYS.DBMS_LOCK TO CI3;

권한이 부여되었습니다.

 

 

 

 






<?php

/**

 * CodeIgniter

 *

 * An open source application development framework for PHP

 *

 * This content is released under the MIT License (MIT)

 *

 * Copyright (c) 2014 - 2018, British Columbia Institute of Technology

 *

 * Permission is hereby granted, free of charge, to any person obtaining a copy

 * of this software and associated documentation files (the "Software"), to deal

 * in the Software without restriction, including without limitation the rights

 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

 * copies of the Software, and to permit persons to whom the Software is

 * furnished to do so, subject to the following conditions:

 *

 * The above copyright notice and this permission notice shall be included in

 * all copies or substantial portions of the Software.

 *

 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,

 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN

 * THE SOFTWARE.

 *

 * @package CodeIgniter

 * @author EllisLab Dev Team

 * @copyright Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)

 * @copyright Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)

 * @license http://opensource.org/licenses/MIT MIT License

 * @link https://codeigniter.com

 * @since Version 3.0.0

 * @filesource

 */

defined('BASEPATH') OR exit('No direct script access allowed');

 

/**

 * CodeIgniter Session Database Driver

 *

 * @package CodeIgniter

 * @subpackage Libraries

 * @category Sessions

 * @author Andrey Andreev

 * @link https://codeigniter.com/user_guide/libraries/sessions.html

 */

class CI_Session_database_driver extends CI_Session_driver implements SessionHandlerInterface {

 

/**

 * DB object

 *

 * @var object

 */

protected $_db;

 

/**

 * Row exists flag

 *

 * @var bool

 */

protected $_row_exists = FALSE;

 

/**

 * Lock "driver" flag

 *

 * @var string

 */

protected $_platform;

 

// ------------------------------------------------------------------------

 

/**

 * Class constructor

 *

 * @param array $params Configuration parameters

 * @return void

 */

public function __construct(&$params)

{

parent::__construct($params);

 

$CI =& get_instance();

isset($CI->db) OR $CI->load->database();

$this->_db = $CI->db;

 

if ( ! $this->_db instanceof CI_DB_query_builder)

{

throw new Exception('Query Builder not enabled for the configured database. Aborting.');

}

elseif ($this->_db->pconnect)

{

throw new Exception('Configured database connection is persistent. Aborting.');

}

elseif ($this->_db->cache_on)

{

throw new Exception('Configured database connection has cache enabled. Aborting.');

}

 

$db_driver = $this->_db->dbdriver.(empty($this->_db->subdriver) ? '' : '_'.$this->_db->subdriver);

if (strpos($db_driver, 'mysql') !== FALSE)

{

$this->_platform = 'mysql';

}

elseif (in_array($db_driver, array('postgre', 'pdo_pgsql'), TRUE))

{

$this->_platform = 'postgre';

}

/* ellord */

elseif (strpos($db_driver,'oci8') !== FALSE)

{

    $this->_platform = 'oracle';

}

// Note: BC work-around for the old 'sess_table_name' setting, should be removed in the future.

if ( ! isset($this->_config['save_path']) && ($this->_config['save_path'] = config_item('sess_table_name')))

{

log_message('debug', 'Session: "sess_save_path" is empty; using BC fallback to "sess_table_name".');

}

}

 

// ------------------------------------------------------------------------

 

/**

 * Open

 *

 * Initializes the database connection

 *

 * @param string $save_path Table name

 * @param string $name Session cookie name, unused

 * @return bool

 */

public function open($save_path, $name)

{

if (empty($this->_db->conn_id) && ! $this->_db->db_connect())

{

return $this->_fail();

}

 

$this->php5_validate_id();

 

return $this->_success;

}

 

// ------------------------------------------------------------------------

 

/**

 * Read

 *

 * Reads session data and acquires a lock

 *

 * @param string $session_id Session ID

 * @return string Serialized session data

 */

public function read($session_id)

{

if ($this->_get_lock($session_id) !== FALSE)

{

// Prevent previous QB calls from messing with our queries

$this->_db->reset_query();

 

// Needed by write() to detect session_regenerate_id() calls

$this->_session_id = $session_id;

 

$this->_db

->select('USER_DATA')

->from($this->_config['save_path'])

->where('SESSION_ID', $session_id);

 

if ($this->_config['match_ip'])

{

$this->_db->where('IP_ADDRESS', $_SERVER['REMOTE_ADDR']);

}

 

if ( ! ($result = $this->_db->get()) OR ($result = $result->row()) === NULL)

{

// PHP7 will reuse the same SessionHandler object after

// ID regeneration, so we need to explicitly set this to

// FALSE instead of relying on the default ...

$this->_row_exists = FALSE;

$this->_fingerprint = md5('');

return '';

}

 

// PostgreSQL's variant of a BLOB datatype is Bytea, which is a

// PITA to work with, so we use base64-encoded data in a TEXT

// field instead.

if ($this->_platform === 'postgre')

{

    $result=base64_decode(rtrim($result->data));

}

/* ellord */

elseif ($this->_platform === 'oracle')

{

 

    //$result=base64_decode(rtrim($result->data->load()));

    $result=base64_decode(rtrim($result->USER_DATA));

}

else {

    $result=$result->data;

}

 

 

$this->_fingerprint = md5($result);

$this->_row_exists = TRUE;

return $result;

}

 

$this->_fingerprint = md5('');

return '';

}

 

// ------------------------------------------------------------------------

 

/**

 * Write

 *

 * Writes (create / update) session data

 *

 * @param string $session_id Session ID

 * @param string $session_data Serialized session data

 * @return bool

 */

public function write($session_id, $session_data)

{

// Prevent previous QB calls from messing with our queries

$this->_db->reset_query();

 

// Was the ID regenerated?

if (isset($this->_session_id) && $session_id !== $this->_session_id)

{

if ( ! $this->_release_lock() OR ! $this->_get_lock($session_id))

{

return $this->_fail();

}

 

$this->_row_exists = FALSE;

$this->_session_id = $session_id;

}

elseif ($this->_lock === FALSE)

{

return $this->_fail();

}

 

if ($this->_row_exists === FALSE)

{

    

    

    if ($this->_platform === 'oracle')

    {

        

        $dateTime = time() + 3600;

        $sql = '

                        MERGE INTO "'.$this->_config['save_path'].'" A

                            USING DUAL

                            ON (A.SESSION_ID = :session_id)

                            WHEN MATCHED THEN

                                      UPDATE SET

                            

                                            TIMESTAMP = :timestamp,

                                            USER_AGENT = :user_agent,

                                            USER_DATA = :user_data,

                                            IP_ADDRESS = :ip_address

                            

                            

                            WHEN NOT MATCHED THEN

                                      INSERT (SESSION_ID, TIMESTAMP, USER_AGENT, USER_DATA, IP_ADDRESS)

                                             VALUES (:session_id, :timestamp, :user_agent, :user_data, :ip_address)

                            

                ';

        $enc_session_data = base64_encode($session_data);

        

        $stmt = oci_parse($this->_db->conn_id, $sql);

        oci_bind_by_name($stmt, ':session_id', $session_id, -1, SQLT_CHR);

        oci_bind_by_name($stmt, ':ip_address', $_SERVER['REMOTE_ADDR'], -1, SQLT_CHR);

        $time=time();

        oci_bind_by_name($stmt, ':timestamp', $time, -1, SQLT_INT);

        oci_bind_by_name($stmt, ':user_data', $enc_session_data, -1, SQLT_CHR);

        oci_bind_by_name($stmt, ':user_agent', $_SERVER['HTTP_USER_AGENT'], -1, SQLT_CHR);

        

        

        $bOk = oci_execute($stmt, OCI_DEFAULT);

        if ($bOk)

        {

            oci_commit($this->_db->conn_id);

            oci_free_statement($stmt);

            $this->_fingerprint = md5($session_data);

            $this->_row_exists = TRUE;

            return $this->_success;

        }

        else

        {

            oci_rollback($this->_db->conn_id);

            oci_free_statement($stmt);

            return $this->_fail();

        }

        

        

        

    }else{

     $insert_data = array(

     'session_id' => $session_id,

     'ip_address' => $_SERVER['REMOTE_ADDR'],

     'timestamp' => time(),

     'user_data' => ($this->_platform === 'postgre' ? base64_encode($session_data) : $session_data)

     );

    }

    

    

if ($this->_db->insert($this->_config['save_path'], $insert_data))

{

$this->_fingerprint = md5($session_data);

$this->_row_exists = TRUE;

return $this->_success;

}

 

return $this->_fail();

}

 

$this->_db->where('SESSION_ID', $session_id);

if ($this->_config['match_ip'])

{

$this->_db->where('IP_ADDRESS', $_SERVER['REMOTE_ADDR']);

}

 

$update_data = array('TIMESTAMP' => time());

if ($this->_fingerprint !== md5($session_data))

{

         $update_data['USER_DATA'] = ($this->_platform === 'postgre' || $this->_platform === 'oracle')

? base64_encode($session_data

: $session_data;

}

 

if ($this->_db->update($this->_config['save_path'], $update_data))

{

$this->_fingerprint = md5($session_data);

return $this->_success;

}

 

return $this->_fail();

}

 

// ------------------------------------------------------------------------

 

/**

 * Close

 *

 * Releases locks

 *

 * @return bool

 */

public function close()

{

return ($this->_lock && ! $this->_release_lock())

? $this->_fail()

: $this->_success;

}

 

// ------------------------------------------------------------------------

 

/**

 * Destroy

 *

 * Destroys the current session.

 *

 * @param string $session_id Session ID

 * @return bool

 */

public function destroy($session_id)

{

if ($this->_lock)

{

// Prevent previous QB calls from messing with our queries

$this->_db->reset_query();

 

$this->_db->where('SESSION_ID', $session_id);

if ($this->_config['match_ip'])

{

$this->_db->where('IP_ADDRESS', $_SERVER['REMOTE_ADDR']);

}

 

if ( ! $this->_db->delete($this->_config['save_path']))

{

return $this->_fail();

}

}

 

if ($this->close() === $this->_success)

{

$this->_cookie_destroy();

return $this->_success;

}

 

return $this->_fail();

}

 

// ------------------------------------------------------------------------

 

/**

 * Garbage Collector

 *

 * Deletes expired sessions

 *

 * @param int  $maxlifetime Maximum lifetime of sessions

 * @return bool

 */

public function gc($maxlifetime)

{

// Prevent previous QB calls from messing with our queries

$this->_db->reset_query();

 

return ($this->_db->delete($this->_config['save_path'], 'TIMESTAMP < '.(time() - $maxlifetime)))

? $this->_success

: $this->_fail();

}

 

// --------------------------------------------------------------------

 

/**

 * Validate ID

 *

 * Checks whether a session ID record exists server-side,

 * to enforce session.use_strict_mode.

 *

 * @param string $id

 * @return bool

 */

public function validateId($id)

{

// Prevent previous QB calls from messing with our queries

$this->_db->reset_query();

 

$this->_db->select('1')->from($this->_config['save_path'])->where('SESSION_ID', $id);

empty($this->_config['match_ip']) OR $this->_db->where('IP_ADDRESS', $_SERVER['REMOTE_ADDR']);

$result = $this->_db->get();

empty($result) OR $result = $result->row();

 

return ! empty($result);

}

 

// ------------------------------------------------------------------------

 

/**

 * Get lock

 *

 * Acquires a lock, depending on the underlying platform.

 *

 * @param string $session_id Session ID

 * @return bool

 */

protected function _get_lock($session_id)

{

if ($this->_platform === 'mysql')

{

$arg = md5($session_id.($this->_config['match_ip'] ? '_'.$_SERVER['REMOTE_ADDR'] : ''));

if ($this->_db->query("SELECT GET_LOCK('".$arg."', 300) AS ci_session_lock")->row()->ci_session_lock)

{

$this->_lock = $arg;

return TRUE;

}

 

return FALSE;

}

elseif ($this->_platform === 'postgre')

{

$arg = "hashtext('".$session_id."')".($this->_config['match_ip'] ? ", hashtext('".$_SERVER['REMOTE_ADDR']."')" : '');

if ($this->_db->simple_query('SELECT pg_advisory_lock('.$arg.')'))

{

$this->_lock = $arg;

return TRUE;

}

 

return FALSE;

}

/* ellord */

elseif ($this->_platform === 'oracle')

{

    $lockname=$session_id.($this->_config['match_ip'] ? '_'.$_SERVER['REMOTE_ADDR'] : '');

    $lockid='';

    $result=99;

    $sql='

begin

SYS.DBMS_LOCK.ALLOCATE_UNIQUE (:lockname, :lockid);

:result := SYS.DBMS_LOCK.REQUEST (:lockid, DBMS_LOCK.X_MODE, 300, FALSE);

end;';

    $stmt = oci_parse($this->_db->conn_id,$sql);

    oci_bind_by_name($stmt,':lockname',$lockname,-1,SQLT_CHR);

    oci_bind_by_name($stmt,':lockid',$lockid,256,SQLT_CHR);

    oci_bind_by_name($stmt,':result',$result,2,SQLT_INT);

    

    $bOk=oci_execute($stmt);

    /*echo 'getlock ';

     var_dump(array($result,$lockid)); */

    if ($bOk && $result==0)

    {

        $this->_lock = $lockid;

        return TRUE;

    }

    return FALSE;

    

}

return parent::_get_lock($session_id);

}

 

// ------------------------------------------------------------------------

 

/**

 * Release lock

 *

 * Releases a previously acquired lock

 *

 * @return bool

 */

protected function _release_lock()

{

if ( ! $this->_lock)

{

return TRUE;

}

 

if ($this->_platform === 'mysql')

{

if ($this->_db->query("SELECT RELEASE_LOCK('".$this->_lock."') AS ci_session_lock")->row()->ci_session_lock)

{

$this->_lock = FALSE;

return TRUE;

}

 

return FALSE;

}

elseif ($this->_platform === 'postgre')

{

if ($this->_db->simple_query('SELECT pg_advisory_unlock('.$this->_lock.')'))

{

$this->_lock = FALSE;

return TRUE;

}

 

return FALSE;

}

/* ellord */

elseif ($this->_platform === 'oracle')

{

    

    $sql='

begin

:result := SYS.DBMS_LOCK.RELEASE (:lockid);

end;';

    $stmt = oci_parse($this->_db->conn_id,$sql);

    $result=99;

    oci_bind_by_name($stmt,':lockid',$this->_lock,256,SQLT_CHR);

    oci_bind_by_name($stmt,':result',$result,2,SQLT_INT);

    

    

    $bOk=oci_execute($stmt);

    

    /*echo 'releaselock ';

     var_dump(array($result,$this->_lock));*/

    

    if ($bOk && $result==0)

    {

        $this->_lock = FALSE;

        return TRUE;

    }

    return FALSE;

}

return parent::_release_lock();

}

}







7e2431ed98c6d12fad6c84c8d60026f7_1534677020_9655.png




5. 참고

* 세션 데이터가 중복하여 생성되거나 새로고침 할 때마다 생기는 경우

3.0.x  버전에서 생기는 버그이므로 3.1.9 최신버전으로 업데이트 하면 된다.


'PHP' 카테고리의 다른 글

zendframework 3 설치  (0) 2019.02.28
PHPMailer 사용 SMTP  (0) 2019.01.08
PHP7 session_regenerate_id() 대체  (0) 2019.01.08
IIS PHP 헤더설정  (0) 2019.01.08
단방향 암호화 문자열 crypt sha512 암호화  (0) 2019.01.08
블로그 이미지

엘로드넷

,

function my_session_start() {

    @session_start();

    if (isset($_SESSION['destroyed'])) {

        if ($_SESSION['destroyed'] < time()-300) {

            // 일반적으로 일어나서는 안됨. 느리거나 불안정한 네트웍일때

            // 이 사용자 세션의 모든 인증상태를 제거

            @remove_all_authentication_flag_from_active_sessions($_SESSION['userid']);

            //throw(new DestroyedSessionAccessException);

        }

        if (isset($_SESSION['new_session_id'])) {

            // 아직 만료되지 않음. 불안정한 네트워크로 인해 쿠키가 손실될 수 있음

            // 다시 올바른 세션ID 쿠키 생성

            // 주의: 인증 플래그를 제거하려면 세션 ID를 다시 설정하지 마십시오.

            session_commit();

            session_id($_SESSION['new_session_id']);

            // 새로운 세션ID가 있어야 함.

            @session_start();

            return;

        }

    }

    

    //session_write_close();

}

 

 

 

my_session_start();

 

 

 

 

 

 

function my_session_regenerate_id() {

            // 불안정한 네트워크로 인해 세션ID가 설정되지 않은 경우 올바른 세션ID를 설정하려면 새 세션ID가 필요함.

            

            $new_session_id = session_create_id();

            //$new_session_id = session_regenerate_id();//for php7.0

            $_SESSION['new_session_id'] = $new_session_id;

            

            // Set destroy timestamp

            $_SESSION['destroyed'] = time();

            

            // 현재 세션 쓰기 및 닫기;

// DB에 세션을 저장하는 경우 주석처리

            session_save_path($_SERVER['DOCUMENT_ROOT'] . "/data/session");

            

            session_commit();

            

            // Start session with new session ID

            session_id($new_session_id);

            ini_set('session.use_strict_mode', 0);

            @session_start();

            ini_set('session.use_strict_mode', 1);

            

            // New session does not need them

            unset($_SESSION['destroyed']);

            unset($_SESSION['new_session_id']);

}

        

 

my_session_regenerate_id();

 

 

 

 

참조 : http://php.net/manual/en/function.session-regenerate-id.php

 

블로그 이미지

엘로드넷

,

IIS PHP 헤더설정

PHP 2019. 1. 8. 23:35

HTTP 응답헤더 설정

 

1452e2743cb3fda4b0515cd404d3994c_1534377785_9074.png
 

아래 내용 추가

 

X-Content-Type-Options nosniff

X-Frame-Options SAMEORIGIN

 

X-XSS-Protection 1; mode=block

 

 

 

1452e2743cb3fda4b0515cd404d3994c_1534377848_5007.png
 

 

 

 

블로그 이미지

엘로드넷

,

$newpasshash = crypt("비밀번호", '$6$rounds=10000$salts$');

 

$6 : SHA512 //SHA256은 $5

rounds=10000 : 해싱루프 숫자 : 1000 ~ 999999999 까지

salts : 임의의 문자열

 

결과 :  $6$rounds=10000$salts$oS9pt.WPNWUrsuH64IR8jC0i0vbHTRHJRC5tCD.fw.lgHtFxB6Y6FuqhNt6WQschEyBLK1sTN8qUURZDV672e.

 

 

 

비교 : 

if(validate_pw("비밀번호", "$6$rounds=10000$salts$oS9pt.WPNWUrsuH64IR8jC0i0vbHTRHJRC5tCD.fw.lgHtFxB6Y6FuqhNt6WQschEyBLK1sTN8qUURZDV672e.")){ 

echo "암호일치";

}else{

echo "불일치";

}

 

 

 

function validate_pw($password, $hash){

    /* Regenerating the with an available hash as the options parameter should

     * produce the same hash if the same password is passed.

     */

    return crypt($password, $hash)==$hash;

 

}

 

'PHP' 카테고리의 다른 글

PHP7 session_regenerate_id() 대체  (0) 2019.01.08
IIS PHP 헤더설정  (0) 2019.01.08
CentOS7 에서 php7.2 yum 설치  (0) 2018.06.07
CentOS7 PHP7 oci8.so 설치  (0) 2017.11.07
php-mcrypt 설치가 안될 때  (0) 2017.11.05
블로그 이미지

엘로드넷

,

0. 버전확인

1. repl-release 설치

2. yum repo 7.2 추가

3. yum-utils 설치

4. php7.2 설치

5. 관련모듈 설치

6. 심볼릭링크

7. 버전확인

8. 끝.





0. 버전확인. (아직 설치되어 있지 않음)

[root@localhost mysql]# php -v

-bash: php: command not found



1. epel-release 설치 (EPEL; Extra Packages for Enterprise Linux)

[root@localhost mysql]# yum install epel-release

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: ftp.kaist.ac.kr

 * extras: ftp.kaist.ac.kr

 * updates: ftp.kaist.ac.kr

Resolving Dependencies

--> Running transaction check

---> Package epel-release.noarch 0:7-11 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================================

 Package                   Arch                Version             Repository           Size

=============================================================================================

Installing:

 epel-release              noarch              7-11                extras               15 k


Transaction Summary

=============================================================================================

Install  1 Package


Total download size: 15 k

Installed size: 24 k

Is this ok [y/d/N]: y

Downloading packages:

epel-release-7-11.noarch.rpm                                          |  15 kB  00:00:00     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : epel-release-7-11.noarch                                                  1/1 

  Verifying  : epel-release-7-11.noarch                                                  1/1 


Installed:

  epel-release.noarch 0:7-11                                                                 


Complete!



2. 7.2설치를 위한 repository 추가(CentOS7에서는 5.4버전이 설치되므로)

[root@localhost mysql]# yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

Loaded plugins: fastestmirror

remi-release-7.rpm                                                    |  15 kB  00:00:00     

Examining /var/tmp/yum-root-1e8WPG/remi-release-7.rpm: remi-release-7.5-1.el7.remi.noarch

Marking /var/tmp/yum-root-1e8WPG/remi-release-7.rpm to be installed

Resolving Dependencies

--> Running transaction check

---> Package remi-release.noarch 0:7.5-1.el7.remi will be installed

--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================================

 Package              Arch           Version                   Repository               Size

=============================================================================================

Installing:

 remi-release         noarch         7.5-1.el7.remi            /remi-release-7          16 k


Transaction Summary

=============================================================================================

Install  1 Package


Total size: 16 k

Installed size: 16 k

Is this ok [y/d/N]: y

Downloading packages:

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : remi-release-7.5-1.el7.remi.noarch                                        1/1 

  Verifying  : remi-release-7.5-1.el7.remi.noarch                                        1/1 


Installed:

  remi-release.noarch 0:7.5-1.el7.remi                                                       


Complete!



3. yum-utils설치

[root@localhost mysql]# yum install yum-utils

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

epel/x86_64/metalink                                                  | 7.0 kB  00:00:00     

 * base: ftp.kaist.ac.kr

 * epel: mirror.premi.st

 * extras: ftp.kaist.ac.kr

 * remi-safe: mirrors.thzhost.com

 * updates: ftp.kaist.ac.kr

epel                                                                  | 3.2 kB  00:00:00     

remi-safe                                                             | 2.9 kB  00:00:00     

(1/4): epel/x86_64/group_gz                                           |  88 kB  00:00:00     

(2/4): epel/x86_64/updateinfo                                         | 933 kB  00:00:00     

(3/4): epel/x86_64/primary                                            | 3.5 MB  00:00:00     

(4/4): remi-safe/primary_db                                           | 1.2 MB  00:00:01     

epel                                                                             12586/12586

Resolving Dependencies

--> Running transaction check

---> Package yum-utils.noarch 0:1.1.31-45.el7 will be installed

--> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-45.el7.noarch

--> Processing Dependency: libxml2-python for package: yum-utils-1.1.31-45.el7.noarch

--> Running transaction check

---> Package libxml2-python.x86_64 0:2.9.1-6.el7_2.3 will be installed

---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed

--> Processing Dependency: python-chardet for package: python-kitchen-1.1.1-5.el7.noarch

--> Running transaction check

---> Package python-chardet.noarch 0:2.2.1-1.el7_1 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================================

 Package                  Arch             Version                      Repository      Size

=============================================================================================

Installing:

 yum-utils                noarch           1.1.31-45.el7                base           119 k

Installing for dependencies:

 libxml2-python           x86_64           2.9.1-6.el7_2.3              base           247 k

 python-chardet           noarch           2.2.1-1.el7_1                base           227 k

 python-kitchen           noarch           1.1.1-5.el7                  base           267 k


Transaction Summary

=============================================================================================

Install  1 Package (+3 Dependent packages)


Total download size: 859 k

Installed size: 4.3 M

Is this ok [y/d/N]: y

Downloading packages:

(1/4): yum-utils-1.1.31-45.el7.noarch.rpm                             | 119 kB  00:00:00     

(2/4): python-chardet-2.2.1-1.el7_1.noarch.rpm                        | 227 kB  00:00:00     

(3/4): python-kitchen-1.1.1-5.el7.noarch.rpm                          | 267 kB  00:00:00     

(4/4): libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm                      | 247 kB  00:00:00     

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

Total                                                        3.1 MB/s | 859 kB  00:00:00     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : python-chardet-2.2.1-1.el7_1.noarch                                       1/4 

  Installing : python-kitchen-1.1.1-5.el7.noarch                                         2/4 

  Installing : libxml2-python-2.9.1-6.el7_2.3.x86_64                                     3/4 

  Installing : yum-utils-1.1.31-45.el7.noarch                                            4/4 

  Verifying  : yum-utils-1.1.31-45.el7.noarch                                            1/4 

  Verifying  : libxml2-python-2.9.1-6.el7_2.3.x86_64                                     2/4 

  Verifying  : python-kitchen-1.1.1-5.el7.noarch                                         3/4 

  Verifying  : python-chardet-2.2.1-1.el7_1.noarch                                       4/4 


Installed:

  yum-utils.noarch 0:1.1.31-45.el7                                                           


Dependency Installed:

  libxml2-python.x86_64 0:2.9.1-6.el7_2.3        python-chardet.noarch 0:2.2.1-1.el7_1       

  python-kitchen.noarch 0:1.1.1-5.el7           


Complete!



4. php7.2 설치

[root@localhost mysql]# yum-config-manager --enable remi-php72

Loaded plugins: fastestmirror

===================================== repo: remi-php72 ======================================

[remi-php72]

async = True

bandwidth = 0

base_persistdir = /var/lib/yum/repos/x86_64/7

baseurl = 

cache = 0

cachedir = /var/cache/yum/x86_64/7/remi-php72

check_config_file_age = True

compare_providers_priority = 80

cost = 1000

deltarpm_metadata_percentage = 100

deltarpm_percentage = 

enabled = 1

enablegroups = True

exclude = 

failovermethod = priority

ftp_disable_epsv = False

gpgcadir = /var/lib/yum/repos/x86_64/7/remi-php72/gpgcadir

gpgcakey = 

gpgcheck = True

gpgdir = /var/lib/yum/repos/x86_64/7/remi-php72/gpgdir

gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

hdrdir = /var/cache/yum/x86_64/7/remi-php72/headers

http_caching = all

includepkgs = 

ip_resolve = 

keepalive = True

keepcache = False

mddownloadpolicy = sqlite

mdpolicy = group:small

mediaid = 

metadata_expire = 21600

metadata_expire_filter = read-only:present

metalink = 

minrate = 0

mirrorlist = http://cdn.remirepo.net/enterprise/7/php72/mirror

mirrorlist_expire = 86400

name = Remi's PHP 7.2 RPM repository for Enterprise Linux 7 - x86_64

old_base_cache_dir = 

password = 

persistdir = /var/lib/yum/repos/x86_64/7/remi-php72

pkgdir = /var/cache/yum/x86_64/7/remi-php72/packages

proxy = False

proxy_dict = 

proxy_password = 

proxy_username = 

repo_gpgcheck = False

retries = 10

skip_if_unavailable = False

ssl_check_cert_permissions = True

sslcacert = 

sslclientcert = 

sslclientkey = 

sslverify = True

throttle = 0

timeout = 30.0

ui_id = remi-php72

ui_repoid_vars = releasever,

   basearch

username = 




[root@localhost mysql]# yum update

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: ftp.kaist.ac.kr

 * epel: mirror.premi.st

 * extras: ftp.kaist.ac.kr

 * remi-php72: repo1.ash.innoscale.net

 * remi-safe: repo1.ash.innoscale.net

 * updates: ftp.kaist.ac.kr

remi-php72                                                            | 2.9 kB  00:00:00     

remi-php72/primary_db                                                 | 189 kB  00:00:01     

No packages marked for update




[root@localhost mysql]# yum install php72

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: ftp.kaist.ac.kr

 * epel: mirror.premi.st

 * extras: ftp.kaist.ac.kr

 * remi-php72: mirrors.mediatemple.net

 * remi-safe: mirrors.mediatemple.net

 * updates: ftp.kaist.ac.kr

Resolving Dependencies

--> Running transaction check

---> Package php72.x86_64 0:1.0-1.el7.remi will be installed

--> Processing Dependency: php72-runtime(x86-64) = 1.0-1.el7.remi for package: php72-1.0-1.el7.remi.x86_64

--> Processing Dependency: php72-runtime for package: php72-1.0-1.el7.remi.x86_64

--> Processing Dependency: php72-php-common(x86-64) for package: php72-1.0-1.el7.remi.x86_64

--> Processing Dependency: php72-php-cli(x86-64) for package: php72-1.0-1.el7.remi.x86_64

--> Running transaction check

---> Package php72-php-cli.x86_64 0:7.2.6-1.el7.remi will be installed

--> Processing Dependency: libargon2.so.0()(64bit) for package: php72-php-cli-7.2.6-1.el7.remi.x86_64

---> Package php72-php-common.x86_64 0:7.2.6-1.el7.remi will be installed

--> Processing Dependency: php72-php-json(x86-64) = 7.2.6-1.el7.remi for package: php72-php-common-7.2.6-1.el7.remi.x86_64

---> Package php72-runtime.x86_64 0:1.0-1.el7.remi will be installed

--> Processing Dependency: scl-utils for package: php72-runtime-1.0-1.el7.remi.x86_64

--> Processing Dependency: environment-modules for package: php72-runtime-1.0-1.el7.remi.x86_64

--> Running transaction check

---> Package environment-modules.x86_64 0:3.2.10-10.el7 will be installed

--> Processing Dependency: libtcl8.5.so()(64bit) for package: environment-modules-3.2.10-10.el7.x86_64

--> Processing Dependency: libX11.so.6()(64bit) for package: environment-modules-3.2.10-10.el7.x86_64

---> Package libargon2.x86_64 0:20161029-2.el7 will be installed

---> Package php72-php-json.x86_64 0:7.2.6-1.el7.remi will be installed

---> Package scl-utils.x86_64 0:20130529-18.el7_4 will be installed

--> Running transaction check

---> Package libX11.x86_64 0:1.6.5-1.el7 will be installed

--> Processing Dependency: libX11-common >= 1.6.5-1.el7 for package: libX11-1.6.5-1.el7.x86_64

--> Processing Dependency: libxcb.so.1()(64bit) for package: libX11-1.6.5-1.el7.x86_64

---> Package tcl.x86_64 1:8.5.13-8.el7 will be installed

--> Running transaction check

---> Package libX11-common.noarch 0:1.6.5-1.el7 will be installed

---> Package libxcb.x86_64 0:1.12-1.el7 will be installed

--> Processing Dependency: libXau.so.6()(64bit) for package: libxcb-1.12-1.el7.x86_64

--> Running transaction check

---> Package libXau.x86_64 0:1.0.8-2.1.el7 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================================

 Package                    Arch          Version                     Repository        Size

=============================================================================================

Installing:

 php72                      x86_64        1.0-1.el7.remi              remi-safe        2.2 k

Installing for dependencies:

 environment-modules        x86_64        3.2.10-10.el7               base             107 k

 libX11                     x86_64        1.6.5-1.el7                 base             606 k

 libX11-common              noarch        1.6.5-1.el7                 base             164 k

 libXau                     x86_64        1.0.8-2.1.el7               base              29 k

 libargon2                  x86_64        20161029-2.el7              epel              23 k

 libxcb                     x86_64        1.12-1.el7                  base             211 k

 php72-php-cli              x86_64        7.2.6-1.el7.remi            remi-safe        3.2 M

 php72-php-common           x86_64        7.2.6-1.el7.remi            remi-safe        625 k

 php72-php-json             x86_64        7.2.6-1.el7.remi            remi-safe         64 k

 php72-runtime              x86_64        1.0-1.el7.remi              remi-safe        1.1 M

 scl-utils                  x86_64        20130529-18.el7_4           base              24 k

 tcl                        x86_64        1:8.5.13-8.el7              base             1.9 M


Transaction Summary

=============================================================================================

Install  1 Package (+12 Dependent packages)


Total download size: 8.1 M

Installed size: 24 M

Is this ok [y/d/N]: y

Downloading packages:

(1/13): libXau-1.0.8-2.1.el7.x86_64.rpm                               |  29 kB  00:00:00     

(2/13): libX11-1.6.5-1.el7.x86_64.rpm                                 | 606 kB  00:00:00     

(3/13): environment-modules-3.2.10-10.el7.x86_64.rpm                  | 107 kB  00:00:00     

(4/13): libX11-common-1.6.5-1.el7.noarch.rpm                          | 164 kB  00:00:00     

(5/13): libxcb-1.12-1.el7.x86_64.rpm                                  | 211 kB  00:00:00     

warning: /var/cache/yum/x86_64/7/remi-safe/packages/php72-1.0-1.el7.remi.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 00f97f56: NOKEY

Public key for php72-1.0-1.el7.remi.x86_64.rpm is not installed

(6/13): php72-1.0-1.el7.remi.x86_64.rpm                               | 2.2 kB  00:00:00     

warning: /var/cache/yum/x86_64/7/epel/packages/libargon2-20161029-2.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY

Public key for libargon2-20161029-2.el7.x86_64.rpm is not installed

(7/13): libargon2-20161029-2.el7.x86_64.rpm                           |  23 kB  00:00:00     

(8/13): scl-utils-20130529-18.el7_4.x86_64.rpm                        |  24 kB  00:00:00     

(9/13): tcl-8.5.13-8.el7.x86_64.rpm                                   | 1.9 MB  00:00:00     

(10/13): php72-php-json-7.2.6-1.el7.remi.x86_64.rpm                   |  64 kB  00:00:02     

(11/13): php72-runtime-1.0-1.el7.remi.x86_64.rpm                      | 1.1 MB  00:00:02     

(12/13): php72-php-cli-7.2.6-1.el7.remi.x86_64.rpm                    | 3.2 MB  00:00:03     

(13/13): php72-php-common-7.2.6-1.el7.remi.x86_64.rpm                 | 625 kB  00:00:03     

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

Total                                                        2.3 MB/s | 8.1 MB  00:00:03     

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Importing GPG key 0x00F97F56:

 Userid     : "Remi Collet <RPMS@FamilleCollet.com>"

 Fingerprint: 1ee0 4cce 88a4 ae4a a29a 5df5 004e 6f47 00f9 7f56

 Package    : remi-release-7.5-1.el7.remi.noarch (installed)

 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-remi

Is this ok [y/N]: y

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Importing GPG key 0x352C64E5:

 Userid     : "Fedora EPEL (7) <epel@fedoraproject.org>"

 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5

 Package    : epel-release-7-11.noarch (@extras)

 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Is this ok [y/N]: y

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : libX11-common-1.6.5-1.el7.noarch                                         1/13 

  Installing : libargon2-20161029-2.el7.x86_64                                          2/13 

  Installing : libXau-1.0.8-2.1.el7.x86_64                                              3/13 

  Installing : libxcb-1.12-1.el7.x86_64                                                 4/13 

  Installing : libX11-1.6.5-1.el7.x86_64                                                5/13 

  Installing : 1:tcl-8.5.13-8.el7.x86_64                                                6/13 

  Installing : environment-modules-3.2.10-10.el7.x86_64                                 7/13 

  Installing : scl-utils-20130529-18.el7_4.x86_64                                       8/13 

  Installing : php72-runtime-1.0-1.el7.remi.x86_64                                      9/13 

  Installing : php72-php-json-7.2.6-1.el7.remi.x86_64                                  10/13 

  Installing : php72-php-common-7.2.6-1.el7.remi.x86_64                                11/13 

  Installing : php72-php-cli-7.2.6-1.el7.remi.x86_64                                   12/13 

  Installing : php72-1.0-1.el7.remi.x86_64                                             13/13 

  Verifying  : scl-utils-20130529-18.el7_4.x86_64                                       1/13 

  Verifying  : libX11-1.6.5-1.el7.x86_64                                                2/13 

  Verifying  : 1:tcl-8.5.13-8.el7.x86_64                                                3/13 

  Verifying  : libxcb-1.12-1.el7.x86_64                                                 4/13 

  Verifying  : libXau-1.0.8-2.1.el7.x86_64                                              5/13 

  Verifying  : php72-1.0-1.el7.remi.x86_64                                              6/13 

  Verifying  : php72-php-common-7.2.6-1.el7.remi.x86_64                                 7/13 

  Verifying  : php72-php-json-7.2.6-1.el7.remi.x86_64                                   8/13 

  Verifying  : environment-modules-3.2.10-10.el7.x86_64                                 9/13 

  Verifying  : libargon2-20161029-2.el7.x86_64                                         10/13 

  Verifying  : php72-runtime-1.0-1.el7.remi.x86_64                                     11/13 

  Verifying  : php72-php-cli-7.2.6-1.el7.remi.x86_64                                   12/13 

  Verifying  : libX11-common-1.6.5-1.el7.noarch                                        13/13 


Installed:

  php72.x86_64 0:1.0-1.el7.remi                                                              


Dependency Installed:

  environment-modules.x86_64 0:3.2.10-10.el7    libX11.x86_64 0:1.6.5-1.el7                  

  libX11-common.noarch 0:1.6.5-1.el7            libXau.x86_64 0:1.0.8-2.1.el7                

  libargon2.x86_64 0:20161029-2.el7             libxcb.x86_64 0:1.12-1.el7                   

  php72-php-cli.x86_64 0:7.2.6-1.el7.remi       php72-php-common.x86_64 0:7.2.6-1.el7.remi   

  php72-php-json.x86_64 0:7.2.6-1.el7.remi      php72-runtime.x86_64 0:1.0-1.el7.remi        

  scl-utils.x86_64 0:20130529-18.el7_4          tcl.x86_64 1:8.5.13-8.el7                    


Complete!



5. 추가모듈 설치

[root@localhost mysql]# yum install php72-php-fpm php72-php-gd php72-php-json php72-php-mbstring php72-php-mysqlnd php72-php-xml php72-php-xmlrpc php72-php-opcache

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: ftp.kaist.ac.kr

 * epel: mirror.premi.st

 * extras: ftp.kaist.ac.kr

 * remi-php72: repo1.sea.innoscale.net

 * remi-safe: repo1.sea.innoscale.net

 * updates: ftp.kaist.ac.kr

Package php72-php-json-7.2.6-1.el7.remi.x86_64 already installed and latest version

Resolving Dependencies

--> Running transaction check

---> Package php72-php-fpm.x86_64 0:7.2.6-1.el7.remi will be installed

---> Package php72-php-gd.x86_64 0:7.2.6-1.el7.remi will be installed

--> Processing Dependency: gd-last(x86-64) >= 2.1.1 for package: php72-php-gd-7.2.6-1.el7.remi.x86_64

--> Processing Dependency: libpng15.so.15()(64bit) for package: php72-php-gd-7.2.6-1.el7.remi.x86_64

--> Processing Dependency: libjpeg.so.62()(64bit) for package: php72-php-gd-7.2.6-1.el7.remi.x86_64

--> Processing Dependency: libgd.so.3()(64bit) for package: php72-php-gd-7.2.6-1.el7.remi.x86_64

--> Processing Dependency: libXpm.so.4()(64bit) for package: php72-php-gd-7.2.6-1.el7.remi.x86_64

---> Package php72-php-mbstring.x86_64 0:7.2.6-1.el7.remi will be installed

---> Package php72-php-mysqlnd.x86_64 0:7.2.6-1.el7.remi will be installed

--> Processing Dependency: php72-php-pdo(x86-64) = 7.2.6-1.el7.remi for package: php72-php-mysqlnd-7.2.6-1.el7.remi.x86_64

---> Package php72-php-opcache.x86_64 0:7.2.6-1.el7.remi will be installed

---> Package php72-php-xml.x86_64 0:7.2.6-1.el7.remi will be installed

--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.24)(64bit) for package: php72-php-xml-7.2.6-1.el7.remi.x86_64

--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.22)(64bit) for package: php72-php-xml-7.2.6-1.el7.remi.x86_64

--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: php72-php-xml-7.2.6-1.el7.remi.x86_64

--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.13)(64bit) for package: php72-php-xml-7.2.6-1.el7.remi.x86_64

--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: php72-php-xml-7.2.6-1.el7.remi.x86_64

--> Processing Dependency: libxslt.so.1()(64bit) for package: php72-php-xml-7.2.6-1.el7.remi.x86_64

--> Processing Dependency: libexslt.so.0()(64bit) for package: php72-php-xml-7.2.6-1.el7.remi.x86_64

---> Package php72-php-xmlrpc.x86_64 0:7.2.6-1.el7.remi will be installed

--> Running transaction check

---> Package gd-last.x86_64 0:2.2.5-2.el7.remi will be installed

--> Processing Dependency: libtiff.so.5(LIBTIFF_4.0)(64bit) for package: gd-last-2.2.5-2.el7.remi.x86_64

--> Processing Dependency: libwebp.so.4()(64bit) for package: gd-last-2.2.5-2.el7.remi.x86_64

--> Processing Dependency: libtiff.so.5()(64bit) for package: gd-last-2.2.5-2.el7.remi.x86_64

--> Processing Dependency: libfontconfig.so.1()(64bit) for package: gd-last-2.2.5-2.el7.remi.x86_64

---> Package libXpm.x86_64 0:3.5.12-1.el7 will be installed

---> Package libjpeg-turbo.x86_64 0:1.2.90-5.el7 will be installed

---> Package libpng.x86_64 2:1.5.13-7.el7_2 will be installed

---> Package libxslt.x86_64 0:1.1.28-5.el7 will be installed

---> Package php72-php-pdo.x86_64 0:7.2.6-1.el7.remi will be installed

--> Running transaction check

---> Package fontconfig.x86_64 0:2.10.95-11.el7 will be installed

--> Processing Dependency: fontpackages-filesystem for package: fontconfig-2.10.95-11.el7.x86_64

--> Processing Dependency: font(:lang=en) for package: fontconfig-2.10.95-11.el7.x86_64

---> Package libtiff.x86_64 0:4.0.3-27.el7_3 will be installed

--> Processing Dependency: libjbig.so.2.0()(64bit) for package: libtiff-4.0.3-27.el7_3.x86_64

---> Package libwebp.x86_64 0:0.3.0-7.el7 will be installed

--> Running transaction check

---> Package fontpackages-filesystem.noarch 0:1.44-8.el7 will be installed

---> Package jbigkit-libs.x86_64 0:2.0-11.el7 will be installed

---> Package lyx-fonts.noarch 0:2.2.3-1.el7 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


=============================================================================================

 Package                        Arch          Version                 Repository        Size

=============================================================================================

Installing:

 php72-php-fpm                  x86_64        7.2.6-1.el7.remi        remi-safe        1.7 M

 php72-php-gd                   x86_64        7.2.6-1.el7.remi        remi-safe         74 k

 php72-php-mbstring             x86_64        7.2.6-1.el7.remi        remi-safe        564 k

 php72-php-mysqlnd              x86_64        7.2.6-1.el7.remi        remi-safe        176 k

 php72-php-opcache              x86_64        7.2.6-1.el7.remi        remi-safe        216 k

 php72-php-xml                  x86_64        7.2.6-1.el7.remi        remi-safe        169 k

 php72-php-xmlrpc               x86_64        7.2.6-1.el7.remi        remi-safe         79 k

Installing for dependencies:

 fontconfig                     x86_64        2.10.95-11.el7          base             229 k

 fontpackages-filesystem        noarch        1.44-8.el7              base             9.9 k

 gd-last                        x86_64        2.2.5-2.el7.remi        remi-safe        133 k

 jbigkit-libs                   x86_64        2.0-11.el7              base              46 k

 libXpm                         x86_64        3.5.12-1.el7            base              55 k

 libjpeg-turbo                  x86_64        1.2.90-5.el7            base             134 k

 libpng                         x86_64        2:1.5.13-7.el7_2        base             213 k

 libtiff                        x86_64        4.0.3-27.el7_3          base             170 k

 libwebp                        x86_64        0.3.0-7.el7             base             170 k

 libxslt                        x86_64        1.1.28-5.el7            base             242 k

 lyx-fonts                      noarch        2.2.3-1.el7             epel             159 k

 php72-php-pdo                  x86_64        7.2.6-1.el7.remi        remi-safe        110 k


Transaction Summary

=============================================================================================

Install  7 Packages (+12 Dependent packages)


Total download size: 4.5 M

Installed size: 12 M

Is this ok [y/d/N]: y

Downloading packages:

(1/19): fontpackages-filesystem-1.44-8.el7.noarch.rpm                 | 9.9 kB  00:00:00     

(2/19): libjpeg-turbo-1.2.90-5.el7.x86_64.rpm                         | 134 kB  00:00:00     

(3/19): fontconfig-2.10.95-11.el7.x86_64.rpm                          | 229 kB  00:00:00     

(4/19): jbigkit-libs-2.0-11.el7.x86_64.rpm                            |  46 kB  00:00:00     

(5/19): libXpm-3.5.12-1.el7.x86_64.rpm                                |  55 kB  00:00:00     

(6/19): libpng-1.5.13-7.el7_2.x86_64.rpm                              | 213 kB  00:00:00     

(7/19): libxslt-1.1.28-5.el7.x86_64.rpm                               | 242 kB  00:00:00     

(8/19): libtiff-4.0.3-27.el7_3.x86_64.rpm                             | 170 kB  00:00:00     

(9/19): libwebp-0.3.0-7.el7.x86_64.rpm                                | 170 kB  00:00:00     

(10/19): lyx-fonts-2.2.3-1.el7.noarch.rpm                             | 159 kB  00:00:00     

(11/19): gd-last-2.2.5-2.el7.remi.x86_64.rpm                          | 133 kB  00:00:01     

(12/19): php72-php-opcache-7.2.6-1.el7.remi.x86_64.rpm                | 216 kB  00:00:00     

(13/19): php72-php-pdo-7.2.6-1.el7.remi.x86_64.rpm                    | 110 kB  00:00:00     

(14/19): php72-php-fpm-7.2.6-1.el7.remi.x86_64.rpm                    | 1.7 MB  00:00:01     

(15/19): php72-php-gd-7.2.6-1.el7.remi.x86_64.rpm                     |  74 kB  00:00:01     

(16/19): php72-php-xml-7.2.6-1.el7.remi.x86_64.rpm                    | 169 kB  00:00:00     

(17/19): php72-php-xmlrpc-7.2.6-1.el7.remi.x86_64.rpm                 |  79 kB  00:00:00     

(18/19): php72-php-mysqlnd-7.2.6-1.el7.remi.x86_64.rpm                | 176 kB  00:00:02     

(19/19): php72-php-mbstring-7.2.6-1.el7.remi.x86_64.rpm               | 564 kB  00:00:03     

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

Total                                                        1.2 MB/s | 4.5 MB  00:00:03     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : libjpeg-turbo-1.2.90-5.el7.x86_64                                        1/19 

  Installing : 2:libpng-1.5.13-7.el7_2.x86_64                                           2/19 

  Installing : fontpackages-filesystem-1.44-8.el7.noarch                                3/19 

  Installing : libXpm-3.5.12-1.el7.x86_64                                               4/19 

  Installing : lyx-fonts-2.2.3-1.el7.noarch                                             5/19 

  Installing : fontconfig-2.10.95-11.el7.x86_64                                         6/19 

  Installing : jbigkit-libs-2.0-11.el7.x86_64                                           7/19 

  Installing : libtiff-4.0.3-27.el7_3.x86_64                                            8/19 

  Installing : libxslt-1.1.28-5.el7.x86_64                                              9/19 

  Installing : php72-php-xml-7.2.6-1.el7.remi.x86_64                                   10/19 

  Installing : php72-php-pdo-7.2.6-1.el7.remi.x86_64                                   11/19 

  Installing : libwebp-0.3.0-7.el7.x86_64                                              12/19 

  Installing : gd-last-2.2.5-2.el7.remi.x86_64                                         13/19 

  Installing : php72-php-gd-7.2.6-1.el7.remi.x86_64                                    14/19 

  Installing : php72-php-mysqlnd-7.2.6-1.el7.remi.x86_64                               15/19 

  Installing : php72-php-xmlrpc-7.2.6-1.el7.remi.x86_64                                16/19 

  Installing : php72-php-fpm-7.2.6-1.el7.remi.x86_64                                   17/19 

  Installing : php72-php-mbstring-7.2.6-1.el7.remi.x86_64                              18/19 

  Installing : php72-php-opcache-7.2.6-1.el7.remi.x86_64                               19/19 

  Verifying  : libXpm-3.5.12-1.el7.x86_64                                               1/19 

  Verifying  : libwebp-0.3.0-7.el7.x86_64                                               2/19 

  Verifying  : lyx-fonts-2.2.3-1.el7.noarch                                             3/19 

  Verifying  : libtiff-4.0.3-27.el7_3.x86_64                                            4/19 

  Verifying  : php72-php-pdo-7.2.6-1.el7.remi.x86_64                                    5/19 

  Verifying  : php72-php-opcache-7.2.6-1.el7.remi.x86_64                                6/19 

  Verifying  : php72-php-mysqlnd-7.2.6-1.el7.remi.x86_64                                7/19 

  Verifying  : libjpeg-turbo-1.2.90-5.el7.x86_64                                        8/19 

  Verifying  : fontconfig-2.10.95-11.el7.x86_64                                         9/19 

  Verifying  : gd-last-2.2.5-2.el7.remi.x86_64                                         10/19 

  Verifying  : libxslt-1.1.28-5.el7.x86_64                                             11/19 

  Verifying  : php72-php-xmlrpc-7.2.6-1.el7.remi.x86_64                                12/19 

  Verifying  : fontpackages-filesystem-1.44-8.el7.noarch                               13/19 

  Verifying  : php72-php-xml-7.2.6-1.el7.remi.x86_64                                   14/19 

  Verifying  : 2:libpng-1.5.13-7.el7_2.x86_64                                          15/19 

  Verifying  : php72-php-mbstring-7.2.6-1.el7.remi.x86_64                              16/19 

  Verifying  : jbigkit-libs-2.0-11.el7.x86_64                                          17/19 

  Verifying  : php72-php-fpm-7.2.6-1.el7.remi.x86_64                                   18/19 

  Verifying  : php72-php-gd-7.2.6-1.el7.remi.x86_64                                    19/19 


Installed:

  php72-php-fpm.x86_64 0:7.2.6-1.el7.remi       php72-php-gd.x86_64 0:7.2.6-1.el7.remi      

  php72-php-mbstring.x86_64 0:7.2.6-1.el7.remi  php72-php-mysqlnd.x86_64 0:7.2.6-1.el7.remi 

  php72-php-opcache.x86_64 0:7.2.6-1.el7.remi   php72-php-xml.x86_64 0:7.2.6-1.el7.remi     

  php72-php-xmlrpc.x86_64 0:7.2.6-1.el7.remi   


Dependency Installed:

  fontconfig.x86_64 0:2.10.95-11.el7       fontpackages-filesystem.noarch 0:1.44-8.el7      

  gd-last.x86_64 0:2.2.5-2.el7.remi        jbigkit-libs.x86_64 0:2.0-11.el7                 

  libXpm.x86_64 0:3.5.12-1.el7             libjpeg-turbo.x86_64 0:1.2.90-5.el7              

  libpng.x86_64 2:1.5.13-7.el7_2           libtiff.x86_64 0:4.0.3-27.el7_3                  

  libwebp.x86_64 0:0.3.0-7.el7             libxslt.x86_64 0:1.1.28-5.el7                    

  lyx-fonts.noarch 0:2.2.3-1.el7           php72-php-pdo.x86_64 0:7.2.6-1.el7.remi          


Complete!



6. 심볼릭링크

[root@localhost bin]# ln -s /opt/remi/php72/root/usr/bin/php php

[root@localhost bin]# ln -s /opt/remi/php72/root/usr/bin/php-cgi php-cgi

[root@localhost bin]# ln -s /opt/remi/php72/root/usr/bin/phar.phar phar.phar




7. 버전확인

[root@localhost bin]# php -v

PHP 7.2.6 (cli) (built: May 23 2018 08:56:04) ( NTS )

Copyright (c) 1997-2018 The PHP Group

Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

    with Zend OPcache v7.2.6, Copyright (c) 1999-2018, by Zend Technologies

[root@localhost bin]# 





8. 끝.











'PHP' 카테고리의 다른 글

IIS PHP 헤더설정  (0) 2019.01.08
단방향 암호화 문자열 crypt sha512 암호화  (0) 2019.01.08
CentOS7 PHP7 oci8.so 설치  (0) 2017.11.07
php-mcrypt 설치가 안될 때  (0) 2017.11.05
페이징 및 함수이용  (0) 2016.03.01
블로그 이미지

엘로드넷

,

CentOS7 PHP7 oci8.so 설치

PHP 2017. 11. 7. 18:04

1. php70w 설치



[root@centos-linux ellord]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

[root@centos-linux ellord]# rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm



[root@centos-linux ellord]# yum install php70w



[root@centos-linux ellord]# yum install php70w-mysqlnd php70w-pdo php70w-pgsql php70w-odbc php70w-mbstring php70w-mcrypt php70w-gd php70w-pear php70w-pdo_dblib php70w-pecl-imagick php70w-pecl-imagick-devel php70w-xml php70w-xmlrpc




2. oracle-instantclient 를 다운받는다.


http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html


11.2.0.4.0 버전으로 아래 두개의 파일을 받는다.


oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm


oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm





3. 다운받은 rpm 파일을 설치한다.


[root@centos-linux ellord]# rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm

[root@centos-linux ellord]# rpm -ivh oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm




4. oci8모듈 소스를 다운 받는다.


[root@centos-linux ellord]# pecl install oci8

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update

downloading oci8-2.1.8.tgz ...

Starting to download oci8-2.1.8.tgz (194,154 bytes)

.........................................done: 194,154 bytes

11 source files, building

running: phpize

Configuring for:

PHP Api Version:         20151012

Zend Module Api No:      20151012

Zend Extension Api No:   320151012

Please provide the path to the ORACLE_HOME directory. Use 'instantclient,/path/to/instant/client/lib' if you're compiling with Oracle Instant Client [autodetect] : instantclient,/usr/lib/oracle/11.2/client64/lib



[autodetect] : 부분에 instantclient,/usr/lib/oracle/11.2/client64/lib

와 같이 입력해 준다.


아래와 같이 자동으로 컴파일하고 oci8.so 파일이 만들어진다.


building in /var/tmp/pear-build-root87TwHg/oci8-2.1.8

running: /var/tmp/oci8/configure --with-php-config=/usr/bin/php-config --with-oci8=instantclient,/usr/lib/oracle/11.2/client64/lib

checking for grep that handles long lines and -e... /usr/bin/grep

checking for egrep... /usr/bin/grep -E

checking for a sed that does not truncate output... /usr/bin/sed

checking for cc... cc

checking whether the C compiler works... yes

checking for C compiler default output file name... a.out

checking for suffix of executables...

checking whether we are cross compiling... no

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether cc accepts -g... yes

checking for cc option to accept ISO C89... none needed

checking how to run the C preprocessor... cc -E

checking for icc... no

checking for suncc... no

checking whether cc understands -c and -o together... yes

checking for system library directory... lib

checking if compiler supports -R... no

checking if compiler supports -Wl,-rpath,... yes

checking build system type... x86_64-unknown-linux-gnu

checking host system type... x86_64-unknown-linux-gnu

checking target system type... x86_64-unknown-linux-gnu

checking for PHP prefix... /usr

checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib

checking for PHP extension directory... /usr/lib64/php/modules

checking for PHP installed headers prefix... /usr/include/php

checking if debug is enabled... no

checking if zts is enabled... no

checking for re2c... no

configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.

checking for gawk... gawk

checking for Oracle Database OCI8 support... yes, shared

checking PHP version... 7.0.24, ok

checking OCI8 DTrace support... no

checking size of long int... 8

checking checking if we're on a 64-bit platform... yes

checking Oracle Instant Client directory... /usr/lib/oracle/11.2/client64/lib

checking Oracle Instant Client SDK header directory... /usr/include/oracle/11.2/client64

checking Oracle Instant Client library version compatibility... 11.1

checking how to print strings... printf

checking for a sed that does not truncate output... (cached) /usr/bin/sed

checking for fgrep... /usr/bin/grep -F

checking for ld used by cc... /usr/bin/ld

checking if the linker (/usr/bin/ld) is GNU ld... yes

checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B

checking the name lister (/usr/bin/nm -B) interface... BSD nm

checking whether ln -s works... yes

checking the maximum length of command line arguments... 1572864

checking whether the shell understands some XSI constructs... yes

checking whether the shell understands "+="... yes

checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop

checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop

checking for /usr/bin/ld option to reload object files... -r

checking for objdump... objdump

checking how to recognize dependent libraries... pass_all

checking for dlltool... no

checking how to associate runtime and link libraries... printf %s\n

checking for ar... ar

checking for archiver @FILE support... @

checking for strip... strip

checking for ranlib... ranlib

checking for gawk... (cached) gawk

checking command to parse /usr/bin/nm -B output from cc object... ok

checking for sysroot... no

checking for mt... no

checking if : is a manifest tool... no

checking for dlfcn.h... yes

checking for objdir... .libs

checking if cc supports -fno-rtti -fno-exceptions... no

checking for cc option to produce PIC... -fPIC -DPIC

checking if cc PIC flag -fPIC -DPIC works... yes

checking if cc static flag -static works... no

checking if cc supports -c -o file.o... yes

checking if cc supports -c -o file.o... (cached) yes

checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes

checking whether -lc should be explicitly linked in... no

checking dynamic linker characteristics... GNU/Linux ld.so

checking how to hardcode library paths into programs... immediate

checking whether stripping libraries is possible... yes

checking if libtool supports shared libraries... yes

checking whether to build shared libraries... yes

checking whether to build static libraries... no

configure: creating ./config.status

config.status: creating config.h

config.status: executing libtool commands

running: make

/bin/sh /var/tmp/pear-build-root87TwHg/oci8-2.1.8/libtool --mode=compile cc  -I. -I/var/tmp/oci8 -DPHP_ATOM_INC -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/include -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/main -I/var/tmp/oci8 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/oracle/11.2/client64  -DHAVE_CONFIG_H  -g -O2   -c /var/tmp/oci8/oci8.c -o oci8.lo

libtool: compile:  cc -I. -I/var/tmp/oci8 -DPHP_ATOM_INC -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/include -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/main -I/var/tmp/oci8 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/oracle/11.2/client64 -DHAVE_CONFIG_H -g -O2 -c /var/tmp/oci8/oci8.c  -fPIC -DPIC -o .libs/oci8.o

/bin/sh /var/tmp/pear-build-root87TwHg/oci8-2.1.8/libtool --mode=compile cc  -I. -I/var/tmp/oci8 -DPHP_ATOM_INC -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/include -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/main -I/var/tmp/oci8 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/oracle/11.2/client64  -DHAVE_CONFIG_H  -g -O2   -c /var/tmp/oci8/oci8_lob.c -o oci8_lob.lo

libtool: compile:  cc -I. -I/var/tmp/oci8 -DPHP_ATOM_INC -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/include -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/main -I/var/tmp/oci8 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/oracle/11.2/client64 -DHAVE_CONFIG_H -g -O2 -c /var/tmp/oci8/oci8_lob.c  -fPIC -DPIC -o .libs/oci8_lob.o

/bin/sh /var/tmp/pear-build-root87TwHg/oci8-2.1.8/libtool --mode=compile cc  -I. -I/var/tmp/oci8 -DPHP_ATOM_INC -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/include -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/main -I/var/tmp/oci8 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/oracle/11.2/client64  -DHAVE_CONFIG_H  -g -O2   -c /var/tmp/oci8/oci8_statement.c -o oci8_statement.lo

libtool: compile:  cc -I. -I/var/tmp/oci8 -DPHP_ATOM_INC -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/include -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/main -I/var/tmp/oci8 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/oracle/11.2/client64 -DHAVE_CONFIG_H -g -O2 -c /var/tmp/oci8/oci8_statement.c  -fPIC -DPIC -o .libs/oci8_statement.o

/bin/sh /var/tmp/pear-build-root87TwHg/oci8-2.1.8/libtool --mode=compile cc  -I. -I/var/tmp/oci8 -DPHP_ATOM_INC -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/include -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/main -I/var/tmp/oci8 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/oracle/11.2/client64  -DHAVE_CONFIG_H  -g -O2   -c /var/tmp/oci8/oci8_collection.c -o oci8_collection.lo

libtool: compile:  cc -I. -I/var/tmp/oci8 -DPHP_ATOM_INC -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/include -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/main -I/var/tmp/oci8 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/oracle/11.2/client64 -DHAVE_CONFIG_H -g -O2 -c /var/tmp/oci8/oci8_collection.c  -fPIC -DPIC -o .libs/oci8_collection.o

/bin/sh /var/tmp/pear-build-root87TwHg/oci8-2.1.8/libtool --mode=compile cc  -I. -I/var/tmp/oci8 -DPHP_ATOM_INC -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/include -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/main -I/var/tmp/oci8 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/oracle/11.2/client64  -DHAVE_CONFIG_H  -g -O2   -c /var/tmp/oci8/oci8_interface.c -o oci8_interface.lo

libtool: compile:  cc -I. -I/var/tmp/oci8 -DPHP_ATOM_INC -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/include -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/main -I/var/tmp/oci8 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/oracle/11.2/client64 -DHAVE_CONFIG_H -g -O2 -c /var/tmp/oci8/oci8_interface.c  -fPIC -DPIC -o .libs/oci8_interface.o

/bin/sh /var/tmp/pear-build-root87TwHg/oci8-2.1.8/libtool --mode=compile cc  -I. -I/var/tmp/oci8 -DPHP_ATOM_INC -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/include -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/main -I/var/tmp/oci8 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/oracle/11.2/client64  -DHAVE_CONFIG_H  -g -O2   -c /var/tmp/oci8/oci8_failover.c -o oci8_failover.lo

libtool: compile:  cc -I. -I/var/tmp/oci8 -DPHP_ATOM_INC -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/include -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/main -I/var/tmp/oci8 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/oracle/11.2/client64 -DHAVE_CONFIG_H -g -O2 -c /var/tmp/oci8/oci8_failover.c  -fPIC -DPIC -o .libs/oci8_failover.o

/bin/sh /var/tmp/pear-build-root87TwHg/oci8-2.1.8/libtool --mode=link cc -DPHP_ATOM_INC -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/include -I/var/tmp/pear-build-root87TwHg/oci8-2.1.8/main -I/var/tmp/oci8 -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -I/usr/include/oracle/11.2/client64  -DHAVE_CONFIG_H  -g -O2   -o oci8.la -export-dynamic -avoid-version -prefer-pic -module -rpath /var/tmp/pear-build-root87TwHg/oci8-2.1.8/modules  oci8.lo oci8_lob.lo oci8_statement.lo oci8_collection.lo oci8_interface.lo oci8_failover.lo -Wl,-rpath,/usr/lib/oracle/11.2/client64/lib -L/usr/lib/oracle/11.2/client64/lib -lclntsh

libtool: link: cc -shared  -fPIC -DPIC  .libs/oci8.o .libs/oci8_lob.o .libs/oci8_statement.o .libs/oci8_collection.o .libs/oci8_interface.o .libs/oci8_failover.o   -L/usr/lib/oracle/11.2/client64/lib -lclntsh  -O2 -Wl,-rpath -Wl,/usr/lib/oracle/11.2/client64/lib   -Wl,-soname -Wl,oci8.so -o .libs/oci8.so

libtool: link: ( cd ".libs" && rm -f "oci8.la" && ln -s "../oci8.la" "oci8.la" )

/bin/sh /var/tmp/pear-build-root87TwHg/oci8-2.1.8/libtool --mode=install cp ./oci8.la /var/tmp/pear-build-root87TwHg/oci8-2.1.8/modules

libtool: install: cp ./.libs/oci8.so /var/tmp/pear-build-root87TwHg/oci8-2.1.8/modules/oci8.so

libtool: install: cp ./.libs/oci8.lai /var/tmp/pear-build-root87TwHg/oci8-2.1.8/modules/oci8.la

libtool: finish: PATH="/usr/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /var/tmp/pear-build-root87TwHg/oci8-2.1.8/modules

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

Libraries have been installed in:

   /var/tmp/pear-build-root87TwHg/oci8-2.1.8/modules


If you ever happen to want to link against installed libraries

in a given directory, LIBDIR, you must either use libtool, and

specify the full pathname of the library, or use the `-LLIBDIR'

flag during linking and do at least one of the following:

   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable

     during execution

   - add LIBDIR to the `LD_RUN_PATH' environment variable

     during linking

   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag

   - have your system administrator add LIBDIR to `/etc/ld.so.conf'


See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

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


Build complete.

Don't forget to run 'make test'.


running: make INSTALL_ROOT="/var/tmp/pear-build-root87TwHg/install-oci8-2.1.8" install

Installing shared extensions:     /var/tmp/pear-build-root87TwHg/install-oci8-2.1.8/usr/lib64/php/modules/

running: find "/var/tmp/pear-build-root87TwHg/install-oci8-2.1.8" | xargs ls -dils

  1252758   0 drwxr-xr-x. 3 root root     17 11월  7 17:46 /var/tmp/pear-build-root87TwHg/install-oci8-2.1.8

101046009   0 drwxr-xr-x. 3 root root     19 11월  7 17:46 /var/tmp/pear-build-root87TwHg/install-oci8-2.1.8/usr

  1252759   0 drwxr-xr-x. 3 root root     17 11월  7 17:46 /var/tmp/pear-build-root87TwHg/install-oci8-2.1.8/usr/lib64

 34473647   0 drwxr-xr-x. 3 root root     21 11월  7 17:46 /var/tmp/pear-build-root87TwHg/install-oci8-2.1.8/usr/lib64/php

 67823917   0 drwxr-xr-x. 2 root root     21 11월  7 17:46 /var/tmp/pear-build-root87TwHg/install-oci8-2.1.8/usr/lib64/php/modules

 67823918 584 -rwxr-xr-x. 1 root root 595672 11월  7 17:46 /var/tmp/pear-build-root87TwHg/install-oci8-2.1.8/usr/lib64/php/modules/oci8.so


Build process completed successfully

Installing '/usr/lib64/php/modules/oci8.so'

install ok: channel://pecl.php.net/oci8-2.1.8

configuration option "php_ini" is not set to php.ini location

You should add "extension=oci8.so" to php.ini




해당 디렉토리로 가 본다.


[root@centos-linux conf.d]# cd /usr/lib64/php/modules/

[root@centos-linux modules]# ls

bz2.so       exif.so      gmp.so       mcrypt.so          pdo.so          pdo_sqlite.so  simplexml.so  sysvshm.so    xmlrpc.so

calendar.so  fileinfo.so  iconv.so     mysqlnd.so         pdo_dblib.so    pgsql.so       sockets.so    tokenizer.so  xmlwriter.so

ctype.so     ftp.so       imagick.so   mysqlnd_mysqli.so  pdo_mysqlnd.so  phar.so        sqlite3.so    wddx.so       xsl.so

curl.so      gd.so        json.so      oci8.so            pdo_odbc.so     posix.so       sysvmsg.so    xml.so        zip.so

dom.so       gettext.so   mbstring.so  odbc.so            pdo_pgsql.so    shmop.so       sysvsem.so    xmlreader.so


oci8.so 파일이 만들어져 있다.


퍼미션을 조절해 준다.

[root@centos-linux modules]# chmod 755 oci8.so




5. php.ini 파일에 extension 을 추가해 준다.


;;;;;;;;;;;;;;;;;;;;;;

; Dynamic Extensions ;

;;;;;;;;;;;;;;;;;;;;;;

extension=oci8.so





6. 아파치를 재시작하고 phpinfo 를 해본다.


아래와 같이 등록되어 있다.


oci8

OCI8 Supportenabled
OCI8 DTrace Supportdisabled
OCI8 Version2.1.8
Revision$Id: 8a26cf66ca0f9556b6376408c8f71ead69bdbcbf $
Oracle Run-time Client Library Version11.2.0.4.0
Oracle Compile-time Instant Client Version11.2
DirectiveLocal ValueMaster Value
oci8.connection_classno valueno value
oci8.default_prefetch100100
oci8.eventsOffOff
oci8.max_persistent-1-1
oci8.old_oci_close_semanticsOffOff
oci8.persistent_timeout-1-1
oci8.ping_interval6060
oci8.privileged_connectOffOff
oci8.statement_cache_size2020
Statistics
Active Persistent Connections0
Active Connections0




끝.











'PHP' 카테고리의 다른 글

단방향 암호화 문자열 crypt sha512 암호화  (0) 2019.01.08
CentOS7 에서 php7.2 yum 설치  (0) 2018.06.07
php-mcrypt 설치가 안될 때  (0) 2017.11.05
페이징 및 함수이용  (0) 2016.03.01
MySQL 트랜잭션  (0) 2016.02.29
블로그 이미지

엘로드넷

,

이니시스 결제모듈연동시 mcrypt 가 필요하다.



yum install php-mcrypt 하니 아래와 같은 에러가 발생하고 설치되지 않는다.


[root@localhost ~]# yum list php-mcrypt

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: ftp.daumkakao.com

 * extras: centos.mirror.cdnetworks.com

 * updates: centos.mirror.cdnetworks.com

Error: No matching Packages to list




epel-release 를 먼저 설치한 후 시도하면 된다.

[root@localhost ~]# yum install epel-release

Loaded plugins: fastestmirror

base                                                                    | 3.6 kB  00:00:00     

extras                                                                  | 3.4 kB  00:00:00     

mariadb                                                                 | 2.9 kB  00:00:00     

updates                                                                 | 3.4 kB  00:00:00     

(1/3): extras/7/x86_64/primary_db                                       | 129 kB  00:00:00     

(2/3): updates/7/x86_64/primary_db                                      | 3.6 MB  00:00:00     

(3/3): mariadb/primary_db                                               |  21 kB  00:00:00     

Loading mirror speeds from cached hostfile

 * base: ftp.daumkakao.com

 * extras: centos.mirror.cdnetworks.com

 * updates: centos.mirror.cdnetworks.com

Resolving Dependencies

--> Running transaction check

---> Package epel-release.noarch 0:7-9 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


===============================================================================================

 Package                    Arch                 Version            Repository            Size

===============================================================================================

Installing:

 epel-release               noarch               7-9                extras                14 k


Transaction Summary

===============================================================================================

Install  1 Package


Total download size: 14 k

Installed size: 24 k

Is this ok [y/d/N]: y 

Downloading packages:

epel-release-7-9.noarch.rpm                                             |  14 kB  00:00:00     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : epel-release-7-9.noarch                                                     1/1 

  Verifying  : epel-release-7-9.noarch                                                     1/1 


Installed:

  epel-release.noarch 0:7-9                                                                    


Complete!

You have new mail in /var/spool/mail/root

[root@localhost ~]# 



php-mcrypt 를 다시 설치해 본다.

[root@localhost ~]# yum install php-mcrypt

Loaded plugins: fastestmirror

epel/x86_64/metalink                                                    | 4.7 kB  00:00:00     

epel                                                                    | 4.7 kB  00:00:00     

epel/x86_64/updateinfo         FAILED                                          B  --:--:-- ETA 

http://ftp.riken.jp/Linux/fedora/epel/7/x86_64/repodata/0227446f2304402f8c35b5249d193d1ce408d171eaaa4750f8391db462d429ce-updateinfo.xml.bz2: [Errno 14] HTTP Error 404 - Not Found

Trying other mirror.

To address this issue please refer to the below knowledge base article 


https://access.redhat.com/articles/1320623


If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/


epel/x86_64/primary_db         FAILED                                          

http://kartolo.sby.datautama.net.id/EPEL/7/x86_64/repodata/5a9079da4e65782bcad40e6bc28b7cc431191a1ce1bcb67d137fbebaffbc9744-primary.sqlite.bz2: [Errno 14] HTTP Error 404 - Not Found

Trying other mirror.

(1/3): epel/x86_64/group_gz                                             | 261 kB  00:00:00     

(2/3): epel/x86_64/primary_db                                           | 6.1 MB  00:00:01     

(3/3): epel/x86_64/updateinfo                                           | 841 kB  00:00:17     

Loading mirror speeds from cached hostfile

 * base: ftp.daumkakao.com

 * epel: mirror.nes.co.id

 * extras: centos.mirror.cdnetworks.com

 * updates: centos.mirror.cdnetworks.com

Resolving Dependencies

--> Running transaction check

---> Package php-mcrypt.x86_64 0:5.4.16-7.el7 will be installed

--> Processing Dependency: libmcrypt.so.4()(64bit) for package: php-mcrypt-5.4.16-7.el7.x86_64

--> Running transaction check

---> Package libmcrypt.x86_64 0:2.5.8-13.el7 will be installed

--> Finished Dependency Resolution


Dependencies Resolved


===============================================================================================

 Package                 Arch                Version                   Repository         Size

===============================================================================================

Installing:

 php-mcrypt              x86_64              5.4.16-7.el7              epel               20 k

Installing for dependencies:

 libmcrypt               x86_64              2.5.8-13.el7              epel               99 k


Transaction Summary

===============================================================================================

Install  1 Package (+1 Dependent package)


Total download size: 119 k

Installed size: 331 k

Is this ok [y/d/N]: y

Downloading packages:

경고: /var/cache/yum/x86_64/7/epel/packages/libmcrypt-2.5.8-13.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY

Public key for libmcrypt-2.5.8-13.el7.x86_64.rpm is not installed

(1/2): libmcrypt-2.5.8-13.el7.x86_64.rpm                                |  99 kB  00:00:00     

(2/2): php-mcrypt-5.4.16-7.el7.x86_64.rpm                               |  20 kB  00:00:00     

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

Total                                                          154 kB/s | 119 kB  00:00:00     

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Importing GPG key 0x352C64E5:

 Userid     : "Fedora EPEL (7) <epel@fedoraproject.org>"

 Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5

 Package    : epel-release-7-9.noarch (@extras)

 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

Is this ok [y/N]: y

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : libmcrypt-2.5.8-13.el7.x86_64                                               1/2 

  Installing : php-mcrypt-5.4.16-7.el7.x86_64                                              2/2 

  Verifying  : libmcrypt-2.5.8-13.el7.x86_64                                               1/2 

  Verifying  : php-mcrypt-5.4.16-7.el7.x86_64                                              2/2 


Installed:

  php-mcrypt.x86_64 0:5.4.16-7.el7                                                             


Dependency Installed:

  libmcrypt.x86_64 0:2.5.8-13.el7                                                              


Complete!

[root@localhost ~]# 



정상적으로 설치가 되었다.



phpinfo(); 를 해보면 아래와 같이 모듈이 올라와 있다.



mcrypt

mcrypt supportenabled
mcrypt_filter supportenabled
Version 2.5.8 
Api No 20021217 
Supported ciphers cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes 
Supported modes cbc cfb ctr ecb ncfb nofb ofb stream 


DirectiveLocal ValueMaster Value
mcrypt.algorithms_dirno valueno value
mcrypt.modes_dirno valueno value





끝.






'PHP' 카테고리의 다른 글

CentOS7 에서 php7.2 yum 설치  (0) 2018.06.07
CentOS7 PHP7 oci8.so 설치  (0) 2017.11.07
페이징 및 함수이용  (0) 2016.03.01
MySQL 트랜잭션  (0) 2016.02.29
php 5.4 number_format  (0) 2016.01.27
블로그 이미지

엘로드넷

,

페이징 및 함수이용

PHP 2016. 3. 1. 20:16

1. 기본형


   $temp=@mysql_fetch_array(mysql_query($count_sql, $connect));

   $total=$temp[0]; 

 

   $page_num = 20; //페이지당 자료수


   if(!$page){ 

 $page=1;//$page 값이 없으면 1

  }


$start_num=($page-1)*$page_num;

$total_page=(int)(($total-1)/$page_num)+1; 

$show_page_num=15; // 페이지 하단에 표시할 페이지 링크 수 

$start_page=(int)(($page-1)/$show_page_num)*$show_page_num; 




$sql = " .....  " . " LIMIT " . $start_num . "," . $page_num ;



// ======================== 페이지 이동 링크 ===========================//

$i=1; 

// 만약 현재 페이지가 10페이지보다 클 때, 즉 11, 12이상의 페이지일 때 이전 페이지 보기를 출력. 

If($page>$show_page_num) { 

$prev_page=$page-$show_page_num; 

echo"<a href=$PHP_SELF?page=$prev_page><img src=/image/ico_prev.gif></a>

<a href=$PHP_SELF?page=1>[1]</a>.."; 

} else {

echo "<img src=/image/ico_prev.gif>";

}


// 아래 while부분이 [1]~[10]등의 페이지를 출력하는 부분입니다. 

while($i+$start_page<=$total_page&&$i<=$show_page_num) { 

$move_page=$i+$start_page; 

if($page==$move_page) {

echo" <font style='color:#FF3300;font-size:12pt;font-weight:bold'>$move_page</font> "; 

} else {

echo"<a href=$PHP_SELF?page=$move_page> [$move_page] </a>"; 

}

$i++; 


// 만약 전체 페이지 수가 지금 나타나 있는 페이지리스트보다 클 때 다음 페이지 보기를 출력합니다. 

if($total_page>$move_page) {

$next_page=$move_page+1; 

echo"..<a href=$PHP_SELF?page=$total_page>[$total_page]

<a href=$PHP_SELF?page=$next_page><img src=/image/ico_next.gif></a>";

} else {

echo "<img src=/image/ico_next.gif>";

}











2. 함수형



<?=getPage($nowpage, $showpage, $total_count, $prev_str, $next_str, $current_color, $f_url )?>


<?


function getPage($nowpage, $total_count, $prev_str, $next_str, $current_color, $field, $keyword ){

global $PHP_SELF;

global $showpage;

global $blockpage;

$page_str = "";



        parse_str($_SERVER[QUERY_STRING],$QUERY_STRING);

        unset($QUERY_STRING["nowpage"]);

$params="";

        foreach($QUERY_STRING as $key=>$value){

$params.="&$key=$value";

        }//End foreach  



if(!$total_count) $total_count =1;

if(!$nowpage) $nowpage = 1;

if(!$showpage) $showpage = 10;

if(!$blockpage) $blockpage = 10;

if(!$current_color) $current_color = "#000000";

$total_page = ceil($total_count/$showpage);  //전체페이지수를 뽑자 (전체글 / 보여지는 글)

$group_page = ceil($nowpage/$blockpage)-1;  //그룹페이지??


//이전

if ($group_page>0){

$page_str .= "<a href='$PHP_SELF?nowpage=1&field=$field&keyword=$keyword".$params."'  style='font-weight:500'>[처음]</a>&nbsp;";

$prev_page_num = ($group_page-1)*$blockpage+1;


if(!$prev_str){//기본값

$page_str .= "<a href='$PHP_SELF?nowpage=$prev_page_num&field=$field&keyword=$keyword". $params ."'  style='font-weight:500'>[이전]</a>"; 

}else{//이미지가 있다면

$page_str .= "<a href='$PHP_SELF?nowpage=$prev_page_num&field=$field&keyword=$keyword". $params ."'>";

$page_str .= "<img src='".$prev_str."' /></a>"; 

}

$page_str .= "&nbsp;&nbsp;&nbsp;";

}



$page_loop=($group_page+1)*$blockpage; 

$start_page = $group_page * $blockpage +1;

if ($page_loop>$total_page)$page_loop=$total_page;

for ($i=$start_page ; $i<=$page_loop ; $i++){ 

if($i==$nowpage){// 현재페이지

$page_str .= "<span style='color:".$current_color.";'>$i</span>";

}else{ 

$page_str .= "<span style='color:#808080; font-weight:500'><a href=$PHP_SELF?nowpage=$i&field=$field&keyword=$keyword".$params.">[$i]</a></span>"; 

}

$page_str .= "&nbsp;";

}



//다음

if($page_loop<$total_page){

$next_page_num = ($group_page+1)*$blockpage+1;

if(!$next_str){//기본값

$page_str .= "&nbsp;&nbsp;<a href='$PHP_SELF?nowpage=$next_page_num&field=$field&keyword=$keyword".$params."'style='font-weight:500'>[다음]</a>";

}else{// 이미지

$page_str .= "<a href='$PHP_SELF?nowpage=$next_page_num&field=$field&keyword=$keyword".$params."'>";

$page_str .= "<img src='".$next_str."'></a>";

}

$page_str .= "&nbsp;";

$page_str .= "<a href='$PHP_SELF?nowpage=$total_page&field=$field&keyword=$keyword".$params."'style='font-weight:500'>[마지막]</a> ";

}


return $page_str; 


}


?>

'PHP' 카테고리의 다른 글

CentOS7 PHP7 oci8.so 설치  (0) 2017.11.07
php-mcrypt 설치가 안될 때  (0) 2017.11.05
MySQL 트랜잭션  (0) 2016.02.29
php 5.4 number_format  (0) 2016.01.27
php 5.4 eregi to preg_match  (0) 2016.01.27
블로그 이미지

엘로드넷

,

MySQL 트랜잭션

PHP 2016. 2. 29. 19:49

트랜잭션 시작

mysql_query("START TRANACTION");



쿼리 실행
$sql = "";
$result =mysq_query($sql);


if($result){//쿼리성공
    mysql_query("COMMIT");
    return $result;
}else{//쿼리실패(롤백)
    mysql_query("ROLLBACK");
}





'PHP' 카테고리의 다른 글

php-mcrypt 설치가 안될 때  (0) 2017.11.05
페이징 및 함수이용  (0) 2016.03.01
php 5.4 number_format  (0) 2016.01.27
php 5.4 eregi to preg_match  (0) 2016.01.27
php 5.4 split to explode  (0) 2016.01.27
블로그 이미지

엘로드넷

,

php 5.4 number_format

PHP 2016. 1. 27. 17:33

php5.3이전에는 number_format($var) 에서 $var값이 숫자이든 문자이든 에러를 발생시키지 않았으나,

php5.3이후부턴 오류 발생함


아래와 같이 변경


$var1 = 2000;

$var2 = 20.00;

$var3 = "20한글00";



1. 변수에 포함된 공백, 마침표, 쉼표, 문자 등 숫자 이외의 것들을 걸러낸다.


$output = preg_replace('/[^0-9]/', '', $var3);


2. number_format() 을 적용한다.

$output = number_format($output);


echo $output;



결과 값은  : 2,000



 






'PHP' 카테고리의 다른 글

페이징 및 함수이용  (0) 2016.03.01
MySQL 트랜잭션  (0) 2016.02.29
php 5.4 eregi to preg_match  (0) 2016.01.27
php 5.4 split to explode  (0) 2016.01.27
PHP 5.3이상에서 변경되는 함수들  (0) 2015.07.24
블로그 이미지

엘로드넷

,