PHPMailer 사용 SMTP

PHP 2019. 1. 8. 23:37

필요한 파일

/lib/class.phpmailer.php

/lib/class.smtp.php

/lib/PHPMailerAutoload.php


 

 

 

require '/lib/PHPMailerAutoload.php';


 

    $mail = new PHPMailer;

    //$mail->SMTPSecure = 'tls';

    $mail->CharSet = "utf-8";

    $mail->Encoding = "base64";

    

    $mail->isSMTP();

    

    //Enable SMTP debugging

    // 0 = off (for production use)

    // 1 = client messages

    // 2 = client and server messages

    $mail->SMTPDebug = 0;

    $mail->Debugoutput = 'html';

    

    $mail->Host = '메일서버주소';

    $mail->Port = '포트';

    

    $mail->SMTPAuth = false;//true 또는 false

    

    $mail->Username = '유저명';

    $mail->Password = '비밀번호';

    

    $mail->setFrom('발신자이메일', '발신자명');//보내는이

    $mail->addAddress('수신자이메일1', '수신자명1');//받는이

    $mail->addAddress('수신자이메일2', '수신자명2');//받는이

    (계속 추가할 수 있음)

    

    $mail->addCC('cc메일주소', 'cc수신자명');

    $mail->addBCC('bcc메일주소', 'bcc수신자명');

    $mail->addReplyTo('답변받을이메일', '답변받는자');//답변받는자

    

    $subject = "메일제목입니다.";

    //$subject    = "=?utf-8?B?".base64_encode($subject)."?=\n";//UTF-8이 아닌 경우

    $mail->Subject = $subject;

    

    

      

    $body = "메일본문. html 가능";

    $body = file_get_contents('/where/message.html');//html파일을 가져올 경우

    $mail->msgHTML($body, dirname(__FILE__));

    

    $mail->AltBody = '이메일 본문입니다.';

    

    //폼으로 넘어온 첨부파일(userfile)이 있는 경우

    if (array_key_exists('userfile', $_FILES)) {

        $uploadfile = tempnam(sys_get_temp_dir(), sha1($_FILES['userfile']['name']));

        if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {  

                   $mail->addAttachment($uploadfile, 'My uploaded file');

                }

        }


       //첨부파일 경로를 알고 있는 경우
       $mail->addAttachment("/첨부파일경로/test.pdf", "test.pdf", "base64", "application/pdf");

    //send the message, check for errors

    if (!$mail->send()) {

  echo $mail->ErrorInfo;//에러메시지 출력

    } else { 

        echo "전송성공!";

    }

    


'PHP' 카테고리의 다른 글

magento23.0 OSX 모하비에 설치  (0) 2019.03.03
zendframework 3 설치  (0) 2019.02.28
코드이그나이터 3.1.9 + 오라클 데이터베이스 세션  (0) 2019.01.08
PHP7 session_regenerate_id() 대체  (0) 2019.01.08
IIS PHP 헤더설정  (0) 2019.01.08
블로그 이미지

엘로드넷

,

코드이그나이터 버전 : 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
블로그 이미지

엘로드넷

,

1. 복구모드로 부팅 ( 커맨드 + R)

2. 터미널 열기

3. cd /Volumes

4. mkdir TimeMachine

5. cd TimeMachine

6. mount -t afp afp://아디디:비밀번호@외부타임머신서버/타임머신폴더 /Volumes/TimeMachine

7. ls -la (.sparsebundle 확장자를 가진 파일을 확인한다.)

8. hdid /Volumes/TimeMachine/이름.sparsebundle

9. exit

 

 

enter image description here 

 

 

10. Restore From Time Machine Backup

enter image description here 

 

11. 타임머신 폴더를 선택한다.("Backup" on network "sunvm100105")

enter image description here 

 

12. 원하는 백업본을 선택한다.

enter image description here 

 

13. 복구할 디스크를 선택한다.

enter image description here 

 

14. 기다리면 된다.

 

블로그 이미지

엘로드넷

,

1. 복구모드로 부팅 (커맨드 + R)

2. Reinstall OS X

3. 설치완료 후 Migration Assistant 자동시작됨

(자동 시작되지 않으면 사용자 설정 후 수동으로 시작)

 

4. From a Mac, Time Machine, or startup disk 선택

5. Other Server 선택

6. 원격 타임머신 서버 정보 입력

 

Migration Assistant 

7. 타임머신 속의 사용자와 방금 전 만든 사용자가 동일하면 사용자 정보를 덮어쓸지 확인한다.

 

블로그 이미지

엘로드넷

,

디스크 유틸리티에서 외장하드 파티션 아이콘이 비활성화되어 파티션 나눌 수 없을 때.

아래와 같이 커맨드라인 명령어를 통해 파티셔닝이 가능하다.

 

먼저 diskutil list 명령어를 통해 연결된 디스크 정보를 확인한다.

 

ELLORDNET-MPR:~ ellord$ diskutil list

/dev/disk0 (internal, physical):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        *525.1 GB   disk0

   1:                        EFI EFI                     209.7 MB   disk0s1

   2:                 Apple_APFS Container disk1         524.9 GB   disk0s2

 

/dev/disk1 (synthesized):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      APFS Container Scheme -                      +524.9 GB   disk1

                                 Physical Store disk0s2

   1:                APFS Volume Macintosh HD            431.9 GB   disk1s1

   2:                APFS Volume Preboot                 43.7 MB    disk1s2

   3:                APFS Volume Recovery                1.0 GB     disk1s3

   4:                APFS Volume VM                      3.2 GB     disk1s4

 

/dev/disk2 (disk image):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        +13.6 MB    disk2

   1:                  Apple_HFS LabelWorksDriver_1.35_1 13.6 MB    disk2s1

 

/dev/disk3 (external, physical):

   #:                       TYPE NAME                    SIZE       IDENTIFIER

   0:      GUID_partition_scheme                        *3.0 TB     disk3

 

 

 

/dev/disk3 (external, physical): 이하가 외장하드 정보이다.

 

먼저,

 

sudo diskutil partitionDisk disk3 1 JHFS+ one 10GB

 

disk3에 파티션명 one으로 10GB를 할당한다.

 

 

ELLORDNET-MPR:~ ellord$ sudo diskutil partitionDisk disk3 1 JHFS+ one 10GB

password :

 

만약

 

두번째 파티션 명으로 Second 으로 하고 100GB를 할당하고자 한다면,

 

아래와 같이 입력하면 된다.

 

sudo diskutil partitionDisk disk3 1 JHFS+ Second 100GB 

 

 

위와 같이 계속 추가하면 된다.

 

 

참고로,

 

위와 같이 만든 후에 디스크 유틸리티 GUI 앱에서 보면 파티션 아이콘이 활성화되어 있을 것이다.

디스크 유틸리티 GUI 앱에서 파티션 작업이 가능하다. 

 

 

끝.

'Mac' 카테고리의 다른 글

원격 타임머신으로 복구하기  (0) 2019.01.08
원격 타임머신 백업 두번째  (0) 2019.01.08
oracle instantclient 12.2, oci8 설치  (0) 2019.01.08
show hidden files in OSX eclipse  (0) 2019.01.08
OSX JDK9 설치 후 Eclipse 시작에러  (0) 2018.06.07
블로그 이미지

엘로드넷

,

OSX High Sierra 에 오라클 인스턴트 클라이언트 및 oci8 설치

 

 

1. 오라클 사이트에서 아래 3개 파일 다운로드

 

instantclient-basic-maxos.x64-12.2.0.1.zip

instantclient-sqlplus-maxos.x64-12.2.0.1.zip

instantclient-sdk-maxos.x64-12.2.0.1.zip

 

2. 압축을 푼다.

 

/usr/local/instantclient/12.2.0.1 폴더에 모든 압축을 풀어 놓는다.

 

폴더 구조는 아래와 같다.

 

-rw-rw-rw-@ 1 ellord  staff        400 Jan  9 23:52 BASIC_README

-rw-rw-rw-@ 1 ellord  staff        404 Jan  9 23:53 SQLPLUS_README

-rwxrwxrwx@ 1 ellord  staff      10036 Jan  9 23:52 adrci

-rwxrwxrwx@ 1 ellord  staff      40360 Jan  9 23:52 genezi

-r-xr-xr-x@ 1 ellord  staff        342 Apr 24  2015 glogin.sql

lrwxr-xr-x@ 1 ellord  staff         20 May 31 23:28 libclntsh.dylib -> libclntsh.dylib.12.1

-rwxrwxrwx@ 1 ellord  staff   85621532 Jan  9 23:51 libclntsh.dylib.12.1

-rwxrwxrwx@ 1 ellord  staff    4685408 Jan  9 23:51 libclntshcore.dylib.12.1

-r-xr-xr-x@ 1 ellord  staff    8179072 Jun 28  2017 libnnz12.dylib

lrwxr-xr-x@ 1 ellord  staff         18 May 31 23:28 libocci.dylib -> libocci.dylib.12.1

-rwxrwxrwx@ 1 ellord  staff    1465312 Jan  9 23:44 libocci.dylib.12.1

-rwxrwxrwx@ 1 ellord  staff  124769196 Jan  9 23:52 libociei.dylib

-r-xr-xr-x@ 1 ellord  staff     151748 Aug  8  2017 libocijdbc12.dylib

-r-xr-xr-x@ 1 ellord  staff     237780 Jan  8 05:33 libons.dylib

-rwxrwxrwx@ 1 ellord  staff      84988 Jan  9 23:40 liboramysql12.dylib

-rwxrwxrwx@ 1 ellord  staff    1267088 Jan  9 23:13 libsqlplus.dylib

-r-xr-xr-x@ 1 ellord  staff    1639388 Jul 12  2017 libsqlplusic.dylib

-r--r--r--@ 1 ellord  staff    4036257 Dec 13  2016 ojdbc8.jar

drwxrwxrwx@ 8 ellord  staff        256 Jan  9 23:53 sdk

-rwxr-xr-x@ 1 ellord  staff       8480 Jan  9 23:53 sqlplus

-rwxrwxrwx@ 1 ellord  staff     146084 Jan  9 23:52 uidrvci

 

-r--r--r--@ 1 ellord  staff      74230 Jan 26  2017 xstreams.jar

 

 

3. 링크를 걸어준다.

 

sudo ln -sF /usr/local/instantclient/12.2.0.1/sdk/include/*.h /usr/local/include/

sudo ln -sF /usr/local/instantclient/12.2.0.1/sqlplus /usr/local/bin/

sudo ln -sF /usr/local/instantclient/12.2.0.1/*.dylib /usr/local/lib/

sudo ln -sf /usr/local/instantclient/12.2.0.1/*.dylib.12.1 /usr/local/lib/

sudo ln -sF /usr/local/lib/libclntsh.dylib.12.1 /usr/local/lib/libclntsh.dylib

 

 

 

 

4. sqlplus로 오라클 서버에 접속해 본다.

 

sudo /usr/local/bin/sqlplus 유저명/비밀번호@서버IP:port/SID

 

 

 

5. pecl로 oci8 설치

 

 

sudo pecl install oci8-2.0.10    #php 5.x

 

sudo pecl install oci8                #php 7

 

입력창에서 아래와 같이 입력하고 엔터

 

instantclient,/usr/local/lib

 

 

 

sh-3.2# pecl install oci8

 

Warning: Declaration of PEAR_Installer::download($packages, $options, &$config, &$installpackages, &$errors, $installed = false, $willinstall = false, $state = false) should be compatible with & PEAR_Downloader::download($params) in Installer.php on line 43

 

Warning: Declaration of PEAR_Installer::download($packages, $options, &$config, &$installpackages, &$errors, $installed = false, $willinstall = false, $state = false) should be compatible with & PEAR_Downloader::download($params) in /usr/local/pear/share/pear/PEAR/Installer.php on line 43

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

 

Warning: Declaration of & PEAR_PackageFile_Parser_v2::parse($data, $file, $archive = false, $class = 'PEAR_Packa...') should be compatible with PEAR_XMLParser::parse($data) in v2.php on line 113

 

Warning: Declaration of & PEAR_PackageFile_Parser_v2::parse($data, $file, $archive = false, $class = 'PEAR_Packa...') should be compatible with PEAR_XMLParser::parse($data) in /usr/local/pear/share/pear/PEAR/PackageFile/Parser/v2.php on line 113

 

Warning: Declaration of PEAR_Builder::log($level, $msg) should be compatible with PEAR_Common::log($level, $msg, $append_crlf = true) in Builder.php on line 489

 

Warning: Declaration of PEAR_Builder::log($level, $msg) should be compatible with PEAR_Common::log($level, $msg, $append_crlf = true) in /usr/local/pear/share/pear/PEAR/Builder.php on line 489

11 source files, building

running: phpize

Configuring for:

PHP Api Version:         20160303

Zend Module Api No:      20160303

Zend Extension Api No:   320160303

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/local/lib

building in /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8

running: /private/tmp/pear/install/oci8/configure --with-oci8=instantclient,/usr/local/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-apple-darwin17.5.0

checking host system type... x86_64-apple-darwin17.5.0

checking target system type... x86_64-apple-darwin17.5.0

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/lib/php/extensions/no-debug-non-zts-20160303

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... no

checking for nawk... no

checking for awk... awk

checking if awk is broken... no

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

checking PHP version... 7.1.14, 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/local/lib

checking Oracle Instant Client SDK header directory... /usr/local/include

checking Oracle Instant Client library version compatibility... 12.1

checking for ld used by cc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld

checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no

checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r

checking for BSD-compatible nm... /usr/bin/nm -B

checking whether ln -s works... yes

checking how to recognize dependent libraries... pass_all

checking dlfcn.h usability... yes

checking dlfcn.h presence... yes

checking for dlfcn.h... yes

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

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

checking for objdir... .libs

checking for ar... ar

checking for ranlib... ranlib

checking for strip... strip

checking for dsymutil... dsymutil

checking for nmedit... nmedit

checking for -single_module linker flag... yes

checking for -exported_symbols_list linker flag... yes

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

checking for cc option to produce PIC... -fno-common

checking if cc PIC flag -fno-common works... yes

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

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

checking whether the cc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes

checking dynamic linker characteristics... darwin17.5.0 dyld

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

 

creating libtool

appending configuration tag "CXX" to libtool

configure: creating ./config.status

config.status: creating config.h

running: make

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=compile cc  -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/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/local/include  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/install/oci8/oci8.c -o oci8.lo

mkdir .libs

 cc -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/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/local/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/oci8/oci8.c  -fno-common -DPIC -o .libs/oci8.o

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=compile cc  -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/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/local/include  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/install/oci8/oci8_lob.c -o oci8_lob.lo

 cc -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/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/local/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/oci8/oci8_lob.c  -fno-common -DPIC -o .libs/oci8_lob.o

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=compile cc  -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/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/local/include  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/install/oci8/oci8_statement.c -o oci8_statement.lo

 cc -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/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/local/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/oci8/oci8_statement.c  -fno-common -DPIC -o .libs/oci8_statement.o

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=compile cc  -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/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/local/include  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/install/oci8/oci8_collection.c -o oci8_collection.lo

 cc -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/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/local/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/oci8/oci8_collection.c  -fno-common -DPIC -o .libs/oci8_collection.o

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=compile cc  -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/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/local/include  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/install/oci8/oci8_interface.c -o oci8_interface.lo

 cc -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/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/local/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/oci8/oci8_interface.c  -fno-common -DPIC -o .libs/oci8_interface.o

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=compile cc  -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/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/local/include  -DHAVE_CONFIG_H  -g -O2   -c /private/tmp/pear/install/oci8/oci8_failover.c -o oci8_failover.lo

 cc -I. -I/private/tmp/pear/install/oci8 -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/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/local/include -DHAVE_CONFIG_H -g -O2 -c /private/tmp/pear/install/oci8/oci8_failover.c  -fno-common -DPIC -o .libs/oci8_failover.o

/bin/sh /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/libtool --mode=link cc -DPHP_ATOM_INC -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/include -I/private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/main -I/private/tmp/pear/install/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/local/include  -DHAVE_CONFIG_H  -g -O2   -o oci8.la -export-dynamic -avoid-version -prefer-pic -module -rpath /private/tmp/pear/install/pear-build-root4n2lSS/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/local/lib -L/usr/local/lib -lclntsh

cc ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/oci8.so -bundle  .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/local/lib -lclntsh  -Wl,-rpath -Wl,/usr/local/lib

dsymutil .libs/oci8.so || :

creating oci8.la

(cd .libs && rm -f oci8.la && ln -s ../oci8.la oci8.la)

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

cp ./.libs/oci8.so /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/modules/oci8.so

cp ./.libs/oci8.lai /private/tmp/pear/install/pear-build-root4n2lSS/oci8-2.1.8/modules/oci8.la

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

Libraries have been installed in:

   /private/tmp/pear/install/pear-build-root4n2lSS/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 `DYLD_LIBRARY_PATH' environment variable

     during execution

 

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="/private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8" install

Installing shared extensions:     /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8/usr/lib/php/extensions/no-debug-non-zts-20160303/

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

14107085   0 drwxr-xr-x  3 root  wheel      96 Jun  1 00:24 /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8

14107435   0 drwxr-xr-x  3 root  wheel      96 Jun  1 00:24 /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8/usr

14107436   0 drwxr-xr-x  3 root  wheel      96 Jun  1 00:24 /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8/usr/lib

14107437   0 drwxr-xr-x  3 root  wheel      96 Jun  1 00:24 /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8/usr/lib/php

14107438   0 drwxr-xr-x  3 root  wheel      96 Jun  1 00:24 /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8/usr/lib/php/extensions

14107439   0 drwxr-xr-x  3 root  wheel      96 Jun  1 00:24 /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8/usr/lib/php/extensions/no-debug-non-zts-20160303

14107440 352 -rwxr-xr-x  1 root  wheel  176164 Jun  1 00:24 /private/tmp/pear/install/pear-build-root4n2lSS/install-oci8-2.1.8/usr/lib/php/extensions/no-debug-non-zts-20160303/oci8.so

 

Build process completed successfully

Installing '/usr/lib/php/extensions/no-debug-non-zts-20160303/oci8.so'

 

 

 

 

6. /usr/lib/php/extensions/no-debug-non-zts-20160303/ 위치에 oci8.so 가 만들어졌다.

 

 

 

7. MAMP php extensions에 oci8.so 추가

 

/Applications/MAMP/bin/php/php7.1.8/lib/php/extensions/oci8.so

 

 

 

 

8. MAMP를 재시작하고 phpinfo를 찍어본다.

 

 

992C36335B112203317C65

 

 

 

9. 끝.

 

'Mac' 카테고리의 다른 글

원격 타임머신 백업 두번째  (0) 2019.01.08
디스크유틸리티에서 파티션 비활성화 될 때.  (0) 2019.01.08
show hidden files in OSX eclipse  (0) 2019.01.08
OSX JDK9 설치 후 Eclipse 시작에러  (0) 2018.06.07
PECL/PEAR 설치  (0) 2018.06.01
블로그 이미지

엘로드넷

,

맥 이클립스에서 숨김파일 보기

 

1. 프로젝트 익스플로러에서 역삼각형 아이콘을 클릭하면 아래와 같은 메뉴가 나온다.

 

41610489ff56d4ebcccc1a8585b893e0_1534145320_3368.png
 

2. Filters and Customization... 으로 들어간다.

 

기본적으로 아래와 같이 되어 있다.

 

41610489ff56d4ebcccc1a8585b893e0_1534145369_4311.png
 

 

숨김파일(. 으로 시작되는 파일들..) 을 보려면 

.* resources 에 체크 해제한다.

 

 

 

 

체크되어 있는 상태

 

41610489ff56d4ebcccc1a8585b893e0_1534145479_7118.png
 

 

 

체크 해제된 상태.

 

41610489ff56d4ebcccc1a8585b893e0_1534145506_4031.png
 

 

.htaccess 와 같은 파일들이 보인다.

 

 

끝.

 

블로그 이미지

엘로드넷

,