[nginx] Can't open PID file /var/run/nginx.pid (yet?) after start: No such file or directory

-- Unit nginx.service has begun starting up. Jan 15 01:40:19 test_server systemd[1]: Can't open PID file /var/run/nginx.pid (yet?) after start: No such file or directory Jan 15 01:40:19 test_server systemd[1]: Started nginx - high performance web server. -- Subject: Unit nginx.service has finished start-up -- Defined-By: systemd -- Support: http://lists.freedesktop....

[PHP] count(): Argument #1 ($value) must be of type Countable|array, null given ...

PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /…/… 배열이나 객체의 원소 수를 셀 때 count 함수를 쓰곤 한다. PHP 8 이상에서 셀 수 있는 객체나 변수를 count 함수로 세려고 하면 위와 같은 오류가 나올 수 있다. PHP 7까지는 없던 제한이다. $a = count($b); $b가 null 값이거나 셀 수 없는 것이면 오류가 날 수 있다. 아래처럼...

[PHP/SElinux] opcache JIT 기능을 켰을 때의 '502 Bad Gateway'

PHP에 들어간 opcache의 JIT 기능을 켜면 '502 Bad Gateway' 오류가 떴는데, Selinux를 끄면 오류가 나지 않으므로 SELinux에 원인이 있었다. Centos Stream 9로 돌리는 웹 서버에서는 Selinux를 끄고 php-fpm을 다시 실행하면 502 오류가 다시 뜨지 않았지만, 알마리눅스(AlmaLinux) 9.4로 돌리는 웹 서버는 Selinux를 끄면 502 오류가 다시 나왔다. audit2why와 audit2allow로 audit 로그(audit.log)와 해결...

[curl] SSL certificate problem: unable to get local issuer certificate

신뢰할 수 있는 인증 기관으로 등록되지 않은 SSL/TLS 인증서를 쓰는 곳을 curl로 접근하먼 이런 오류를 겪을 수 있다. 구글(google) 인증서를 쓰는 곳에서 그럴 수 있다. # curl https://www... curl: (60) SSL certificate problem: unable to get local issuer certificate More details here: https://curl.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore...

[최불암 시리즈] 키트

비 내리는 서울역 앞. 다 뜯어진 옷을 입고 살만 남은 우산을 쓴 남자가 씩씩하게 외쳤다. "나는 천하무적 람보다. 푸하하하…" 이를 지켜보던 지나가던 아가씨가 혀를 차며, "저 사람 머리가 돈 거 아냐? 내가 마돈나인지도 모르고 있으니…" 그러자 옆에 있던 최불암은 자신의 포니2 승용차에 시동을 걸면서 걱정스럽게 얘기했다. "요즘은 미친 사람이 참 많아. 어서 가자, 키트!"

[PHP] Cannot use isset() on the result of an expression (you can use "null !== expression" instead)

PHP Fatal error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead) /.../???.php on line 21 이 오류가 일어난 것은 아래 내용 때문이었다. if(isset($data && $data=='ok')) $result = 'pass'; 닫는 괄호 )를 잘못 넣었기 때문에 오류가 생겼다. isset 함수 안에 변수가 아닌 조건문이 들어가는 것은 자연스럽지 않다. 아래처럼 고쳐야 한다. if(isset($data...

[PHP] 함수 이름에 잘못 넣은 $ : Can't use function return value in write context

PHP Fatal error: Can't use function return value in write context in /.../???.php on line 539 list 함수를 쓰려다가 다음처럼 'list'를 '$list'로 잘못 넣으면 이런 오류를 볼 수 있다. $list($a, $b) = func($p); list는 함수 이름이지만, $를 붙인 $list는 변수이다. '$list(..)'는 '변수(...)'로서 list 함수를 쓰는 형식에 어긋난다. 아래처럼 고치면 위의 오류가 나지 않는다. list($a, $b) = func($p);

[최불암 시리즈] Coffee or Tea?

미국에 간 최불암. 영어회화가 좀 달리기는 했지만 손짓 발짓으로 어떻게 되겠지 하며 고급 음식점에 들어갔다. 메뉴판을 손가락으로 아무거나 찍어서 식사를 해결한 최불암에게 종업원이 다가와서 말했다. "Coffee or tea?" (커피와 차 가운데 후식으로 무엇을 받고 싶은지 묻는 말) 그 정도는 알아들었다는 표정을 지으며 최불암은 자신 있게 대답했다. "or"

[phpBB] cronstatus extension - container_exception (YAML, PHP)

CONTAINER_EXCEPTION EXCEPTION: The file "/.../ext/boardtools/cronstatus/config/services.yml" does not contain valid YAML: The reserved indicator "@" cannot start a plain scalar; you need to quote the scalar at line 5 (near "- @config"). #0 /.../vendor/symfony/dependency-injection/Loader/YamlFileLoader.php(117): Symfony\Component\DependencyInjection\Loader\Yaml...