Backend/php(xe)

[PHP/XE] debug print 찍기

rachel_13 2022. 8. 12. 12:14

* background에서 실행하려면 '@'를 붙여서 사용

{@debugPrint($hello_world)}

터미널에서 해당하는 파일 경로에 들어가면

나의 경우 개발 서버에 alias로 예약어를 등록해 둠 

~./bashrc 경로에 alias로 예약어를 등록해두면 단축키처럼 사용할 수 있다.

alias de='tail -f /home/user/_debug_message.php'

(참고 : https://ojava.tistory.com/153)

 

디버그 프린팅 되는 변수 값들을 확인할 수 있다.

<?php
/*========================================
[2022-08-12 08:59:12](생략) - (13.72MB)
stdClass Object
(
    [site_srl] => 
    [user] => 
    [is_logged_in] => 1
)

----------------------------------------*/
?>

* 일반 디버그 프린트 

{debugPrint($hello_world)}

https://ko.code-paper.com/php/examples-how-to-debug-printer-code-php