티스토리

Blue Breeze
검색하기

블로그 홈

Blue Breeze

bluebreeze.co.kr/m

C.H가 끄적이는 개발자 로그

구독자
0
방명록 방문하기
공지 티스토리 반응형 디자인 적용 모두보기

주요 글 목록

  • Primary script unknown while reading response header from upstream nginx & php error nginx error connect to php5-fpm.sock failed (13: Permission denied) www-data user 권한, www-data 그룹 권한을 모두 설정했지만 file not found 에러 발생 결국 pool.d/www.conf 파일 설정에서 listen.mode = 0660을 설정하니 문제 없이 동작했다. # before listen.owner = www-data listen.group = www-data ; listen.mode = 0660 # after listen.owner = www-data listen.group = www-data listen.mode = 0660 공감수 2 댓글수 0 2022. 3. 31.
  • capture on nginx to php-fpm unix-socket NGINX - PHP-FPM. File not found. 문제 해결 Sniffing Unix Socket - debugging communication between nginx and php-fpm socat - Multipurpose relay socat 명령어 [Ubuntu] socat 을 사용한 포트 포워딩 Port forwarding socat 리눅스 가상 시리얼 포트(컴포트) 사용법 (RS232 테스트) CTF 사이트&문제 서버 설정 팁 CTF를 위한 공부 가이드 Capture The Flag tcpdump sudo tcpdump port 9000 -A | strings socat socket cat sudo apt-get install socat #sudo socat -t100 -x -v U.. 공감수 4 댓글수 0 2022. 3. 31.
  • 원격 이미지파일 크기(byte) 확인 get_headers - PHP Calculate Remote Image File Size Using PHP 원격 이미지 파일크기 확인 stream_context_set_default( array( 'http' => array( 'method' => 'HEAD' ) ) ); $headers = get_headers($source_file); /* [0] => HTTP/1.1 200 OK [1] => Date: Sat, 29 May 2004 12:28:13 GMT [2] => Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) [3] => Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT [4] => ETag: "3f80f-1b6-3e1cb03b".. 공감수 0 댓글수 0 2018. 8. 18.
  • PHP7 use NameSpace Using namespaces: Aliasing/Importing PHP 7 - use Statement PHP7 use Namespace구문 PHP7 이후부터는 단일 use 문을 사용하여 여러 use 문 대신 동일한 namespace에서 클래스, 함수 및 상수를 가져올 수 있습니다. // Before PHP 7 use com\tutorialspoint\ClassA; use com\tutorialspoint\ClassB; use com\tutorialspoint\ClassC as C; use function com\tutorialspoint\fn_a; use function com\tutorialspoint\fn_b; use function com\tutorialspoint\fn_c; use const .. 공감수 1 댓글수 0 2018. 8. 4.
  • PHP7 Expectations - Assert() Expectations New features PHP 7 - Expectations Assert() Expections Expectations는 이전 assert()함수에 대한 하위 호환성 향상입니다. 프로덕션 코드에서 비용이 없는 assertion을 허용하고 어설션이 실패 할 때 사용자 지정 예외를 throw하는 기능을 제공합니다. 이전 API는 호환성을 유지하기 위해 계속 유지되지만 assert()는 이제는 언어구문으로 제공되며, 첫 번째 매개 변수를 평가할 문자열 또는 테스트 할 부울 값이 아닌 표현식으로 사용할 수 있습니다. 운영환경에서 asert()기능을 구성하는 방법을 포함하여 기능에 대한 자세한 내용은 assert() > expectations절을 참조하세요. Configuration for Assert() 설정 .. 공감수 2 댓글수 0 2018. 8. 3.
  • PHP7 CSPRNG - 암호학적으로 안전한 랜덤(pseudo-random) 함수 New features CSPRNG 함수 목록 PHP 7 - CSPRNG CSPRNG 암호학적으로 안전한 random함수 random_bytes암호학적으로 안전한 pseudo-random bytes(의사-램덤 바이트) 생성 random_int암호학적으로 안전한 pseudo-random integers # Syntax # string random_bytes ( int $length ) # $length : 바이트단위로 반환되어야하는 길이 $bytes = random_bytes(5); print(bin2hex($bytes)); // 54cc305593 # Syntax # int random_int ( int $min , int $max ) # $min : PHP_INT_MIN 보다 큰값 # $max : PH.. 공감수 3 댓글수 0 2018. 8. 2.
  • PHP7 Filtered unserialize() - 시리얼라이저 복구 필터링 New features unserialize : php.net PHP 7 - Filtered unserialize() 시리얼라이저 복구 class MyClass1 { public $obj1prop; } class MyClass2 { public $obj2prop; } $obj1 = new MyClass1(); $obj1->obj1prop = 1; $obj2 = new MyClass2(); $obj2->obj2prop = 2; $serializedObj1 = serialize($obj1); $serializedObj2 = serialize($obj2); // 모든클래스 허용 옵션. 생략가능. // allowed_classes 가 false 설정하면, 모든 객체를 into __PHP_Incomplete_Cl.. 공감수 0 댓글수 0 2018. 8. 1.
  • PHP7 Closure::call() - 클루저 콜 New features PHP 7 - Closure::call() 클루저 콜 PHP7은 이전 bintTo()보다 훨씬 더 빠릅니다. Pre PHP7 class A { private $x = 1; } // php7 이전 클루저 정의 $getValue = function() { return $this->x; }; // 클루저 바인딩(연결)) $value = $getValue->bindTo(new A, 'A'); var_dump($value()); // 1 PHP7 class A { private $x = 1; } // PHP 7+ code, Define $value = function() { return $this->x; }; var_dump($value->call(new A)); // 1 공감수 1 댓글수 0 2018. 7. 31.
  • PHP7 Anonymous Classes - 익명 클래스 New features PHP 7 - Anonymous Classes 익명 클래스 logger; } public function setLogger(Logger $logger) { $this->logger = $logger; } } $app = new Application; // instance $app->setLogger(new class implements Logger { // anonymous classes injection public function log(string $msg) { print($msg); } }); $app->getLogger()->log("message""); // message 공감수 1 댓글수 0 2018. 7. 30.
  • PHP7 constant Arrays - 배열 상수 New features PHP 7 - Constant Arrays PHP7 이전의 PHP에서 define()으로 정의할 때 배열을 사용할수 없었다. PHP7에서는 배열상수를 정의할수 있다. 공감수 1 댓글수 0 2018. 7. 28.
  • PHP7 Spaceship Operator 스페이스윕 연산자 New features PHP 7 - Spaceship Operator 스페이스쉽 연산자 연산자로 좌측 항목을 기준으로 우축항목 비교 결과를 0, -1, 1 결과값을 가진다. 0 비교값이 같을 경우 -1 기준값(좌)이 작을 경우 1 기준값(좌)이 클 경우 공감수 0 댓글수 0 2018. 7. 27.
  • PHP7 Null coalescing Operator - Null 통합 연산자 New features PHP 7 - Null Coalescing Operator Null 통합연산자 PHP7에서 Null 통합 연산자(Null Coalescing Operator) ??가 도입되었다. Null 통합 연산자는 첫번째 연산자가 존재하고 Null이 아닐경우 이를 반환한다. Javascript || 연산자와 동일(?)한 기능이다. 공감수 0 댓글수 0 2018. 7. 26.
  • PHP7 Scalar 타입 선언 PHP 7 - Scalar Type Declarations PHP7 Scalar 타입 선언 아래 옵션을 설정한뒤 함수 매개변수에 특정 유형을 적용(강제)할수 있다. Options coercivecoercive is default mode and need not to be specified. strictstrict mode has to explicitly hinted. Types int float bool string interfaces array callable Example 공감수 1 댓글수 0 2018. 7. 25.
  • PHP DB가 없는 CMS 프로젝트 GRAV Grav - A Modern Flat-File CMS | Grav Installation | Grav Documentation markdown을 이용한 DB없이 홈페이지CMS 구축 프로젝트 GRAV Installation composer create-project getgrav/grav grav Run php -S localhost:8000 system/router.php http://localhost:8000/ 접속하면 된다. 페이지 추가/수정 Grav 설치위치에서 user/pages/ 폴더에 {숫자.페이지이름} 형식으로 폴더를 추가하면 된다. 폴더에 default.md 파일을 추가하면 자동 랜더링 된다. 폴더에 default.md 파일이 없으면 404에러가 표시된다. 정상적으로 페이지를 추가 했다면 .. 공감수 0 댓글수 0 2018. 7. 19.
  • PHP 이용 웹서버 디렉토리 서비스를 더 깔끔하고 편리하게 이용하기 Project-CleverWeb/LastAutoIndex Requirements The ablity to set the directory index 디렉토리 인덱스를 사용할 수 있는 관리자 PHP 5.4 or later Composer Installation composer require projectcleverweb/lastautoindex Setting # Apache Options -Indexes DirectoryIndex index.php index.html index.htm /path/to/LastAutoIndex/index.php # Nginx autoindex off; index index.php index.html index.htm /path/to/LastAutoIndex/index.php.. 공감수 0 댓글수 0 2018. 7. 18.
  • Composer require Could not find package Could not find package * at any version for your minimum-stability (stable). Check the package spelling or your min imum-stability #5118 공감수 3 댓글수 0 2018. 7. 13.
  • PHP 상대주소 절대주소변경 [함수] 상대경로를 특정URI 기준의 절대경로로 변환하기 PHP Warning: preg_replace(): The /e modifier is no longer supported PHP >= 7.0.0 : preg_replace /e modifier는 지원되지 않는다. [함수] 상대경로를 특정URI 기준의 절대경로로 변환하기 에서 원래 소스를 확인 할 수 있다. preg_replace to preg_replace_callback function http_src_to_abs($content, $base_uri) { $pattern_a = array("@(\s*href|\s*src)(\s*=\s*'{1})([^']+)('{1})@i" , "@(\s*href|\s*src)(\s*=\s*\"{1})([^\"]+.. 공감수 3 댓글수 0 2018. 7. 11.
  • PHP 로그, 에러 리포팅 제어 PHP – How to disable error log, display errors and error reporting programmatically 최고의 방법은 php.ini에서 제어하는게 좋다. Apache Web Server Setting error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT display_errors = Off log_errors = On error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT : 모든 종류의 경고를 빼거나 뺄수 있도록 지시. display_errors = Off : 에러 표시해제 log_errors = On : 로컬파일에 에러기록 PHP Setting ini_set('error_repo.. 공감수 4 댓글수 0 2018. 7. 10.
  • PHP Warning: preg_replace(): The /e modifier is no longer supported PHP – How to fix the “Warning: preg_replace(): The /e modifier is no longer supported” error in PHP7 well-documented issue in PHP manualphp.net 패턴변경자 Warning: preg_replace(): The /e modifier is no longer supported PHP 5.x에서 PHP7으로 업그레이드 시 발생하는 가장 일반적인 문제들 중 하나. well-documented issue in PHP manual PHP 매뉴얼에서 v5.5 부터 사용되지 않으며(deprecated) v7.0.0에는 지원되지 않은(unsupported)다고 문서에 명시되어 있지만, 과거 레거시 코드를 그대로 .. 공감수 4 댓글수 0 2018. 7. 9.
  • PHP tidy 예제 및 기능 PHP에서 HTML / XML을 구문 분석하고 처리하는 방법은 무엇입니까? https://ko.wikipedia.org/wiki/HTML_타이디 https://en.wikipedia.org/wiki/HTML_Tidyhttp://tidy.sourceforge.net/docs/quickref.html Comparison of HTML parsers https://ko.wikipedia.org/wiki/위키백과:린트_오류 PHP simple-html-dom-parser Tidy Function 혼재된 태그를 바로 잡기 존재하지 않거나 일치되지 않는 종료 태그 수정 존재하지 않는 항목 추가 (일부 태그, 인용 등) 사유 HTML 확장 기능 보고 마크업 레이아웃을 미리 정의된 스타일로 변경 일부 인코딩의 문자열들.. 공감수 4 댓글수 0 2018. 7. 7.
  • PHP Codeigniter - idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated A PHP Error was encountered Severity: 8192 Message: idn_to_ascii(): INTL_IDNA_VARIANT_2003 is deprecated Filename: libraries/Form_validation.php Line Number: 1234 ... Conclusion 2018.07.04 현재 3.1.9 최신버전으로 업그레이드 codeigniter 3.1.5 에서 발생 공감수 4 댓글수 0 2018. 7. 5.
  • PHP mysql-database-class https://packagist.org/packages/joshcam/mysqli-database-class Installation composer require joshcam/mysqli-database-class:dev-master $db = new MysqliDb ('host', 'username', 'password', 'databaseName'); // $db->setPrefix ('my_'); # load Date $opt = [ "fieldChar" => ';', // 데이터 구분 "lineChar" => '\r\n', // 라인구분 "linesToIgnore" => 1, // 데이터 시작 라인 "loadDataLocal" => true, // localdata 사용여부 ]; $db->loa.. 공감수 4 댓글수 0 2018. 7. 4.
  • PHP simple-html-dom-parser github.com/sunra/php-simple-html-dom-parser packagist.org/packages/sunra/php-simple-html-dom-parser PHP Simple HTML DOM Parser Manual Installation "require": { "sunra/php-simple-html-dom-parser": "1.5.2" } composer require sunra/php-simple-html-dom-parser Usage require_once "vendor/autoload.php"; use Sunra\PhpSimple\HtmlDomParser; ... $dom = HtmlDomParser::str_get_html( $str ); or $dom = HtmlDom.. 공감수 6 댓글수 0 2018. 7. 3.
  • PHP Gouttle DomCrawler Component The DomCrawler Component - Sympony Goutte 설치 composer install fabpot/goutte Crawler 컨텐츠 탐색 방법 Get Crawler Content require 'vendor/autoload.php'; use Goutte\Client; use Symfony\Component\DomCrawler\Crawler; $domain = 'http://www.etoland.co.kr'; $url = $domain.'/bbs/board.php?bo_table=star'; $client = new \Goutte\Client(); $client->setClient(new \GuzzleHttp\Client([ 'timeout' => 90, 'verify' => fa.. 공감수 4 댓글수 0 2018. 7. 2.
  • PHP Goutte Cookie The BrowserKit Component別々のGoutte\ClientにCookie情報を引き継いで渡したい composer.json { "require": { "fabpot/goutte": "^3.2" } } Cookie 정보 확인 require 'vendor/autoload.php'; use Goutte\Client; $url = 'https://github.com/login'; $client = new \Goutte\Client(); $client->setClient(new \GuzzleHttp\Client([ 'timeout' => 90, 'verify' => false, 'cookie'=>true ])); $crawler = $client->request('GET', $url); echo $cra.. 공감수 4 댓글수 0 2018. 7. 1.
  • PHP Guzzle Scraper https://github.com/guzzle/guzzleGuzzle6 Overview Requirements Guzzle:~6.0 PHP 5.5.0 PHP 스트림 핸들러를 사용하려면 시스템의 php.ini에서 allow_url_fopen을 활성화해야합니다. cURL 처리기를 사용하려면 OpenSSL 및 zlib로 컴파일 된 cURL> = 7.19.4의 최신 버전이 있어야합니다. Guzzle은 더 이상 HTTP 요청을 보내기 위해 cURL이 필요하지 않습니다. Guzzle은 cURL이 설치되지 않은 경우 PHP 스트림 래퍼를 사용하여 HTTP 요청을 보냅니다. 또는 요청을 보내는 데 사용되는 자체 HTTP 처리기를 제공 할 수 있습니다. Installation composer require guzzleh.. 공감수 4 댓글수 0 2018. 6. 30.
  • Simple PHP Web Scraper Guotte https://github.com/FriendsOfPHP/Goutte Guzzle Documentation https://symfony.com/components/BrowserKit https://symfony.com/doc/current/components/dom_crawler.htmlWeb Scraping 101 with CuotteLaravel: Url preview like Facebook with PHP Goutte Goutte, a simple PHP Web Scraper 구트(Goutte), 심플 PHP 웹 스크레이퍼 Installation composer require fabpot/goutte Usage require_once "vendor/autoload.php"; use Goutte\C.. 공감수 4 댓글수 0 2018. 6. 29.
  • PHP Laravel Framework helloWorld Lalavel 5.6 Installation Laravel # composer glob al require "lalavel/installer" # PATH : $HOME/.config/composer/vendor/bin composer require "laravel/installer" # laravel new blog vendor/laravel/installer/laravel new blog composer create-project --prefer-dist laravel/laravel blog vi blog/routes/web.php 공감수 12 댓글수 0 2018. 6. 15.
  • PHP reactPHP helloWorld ReactPHP로 고성능 PHP 앱 만들기 ReactPHP composer require 'react/react=*' vi server.php 공감수 15 댓글수 0 2018. 6. 14.
  • PHP workman Container helloWorld walkor/WorkermanWorkerman Socket Server, Multi Process 및 libevent 폴링 라이브러리 PHP Performence On Framework And Event-driven PHP (1) Workerman composer require workerman/workerman vi serve.php 공감수 12 댓글수 0 2018. 6. 12.
    반응형
    문의안내
    • 티스토리
    • 로그인
    • 고객센터

    티스토리는 카카오에서 사랑을 담아 만듭니다.

    © Kakao Corp.