สาขา Tops Food Hall | รหัสสาขา |
Tops Central Westgate | 156 |
Tops Central Westville | 234 |
Category: Uncategorized
Xdebug’s step debugger not working in phpStorm.
TL;DR
Try deleting all PHP > Servers

Then refresh web page again. If PHP run through line that has breakpoint phpStorm will pop up for you to click accept incoming request.

It’s annoying when I change computer and sometime I encounter this problem. PHP was installed Xdebug properly, I can confirm from php -v
and phpinfo();
that will show Xdebug as installed extension.
PHP 8.3.14 (cli) (built: Nov 19 2024 15:14:23) (NTS DEBUG) Copyright (c) The PHP Group Zend Engine v4.3.14, Copyright (c) Zend Technologies with Xdebug v3.3.2, Copyright (c) 2002-2024, by Derick Rethans with Zend OPcache v8.3.14, Copyright (c), by Zend Technologies
When I encounter this problem, it only affects on one project, while the other projects have no problem.
I started to get a clue from these threads. [1] [2]. But even though I unchecked that “Use path mappings” checkbox, it still doesn’t work. But in the end, I found that it could work again once I completely removed the server entry.
I would like to thank Steve E and Richard Pickering.
Directly connect to php-fpm
We can’t just curl to php-fpm because it does not serve HTTP. There is a tool “cgi-fcgi” that can make request to php-fpm to run specified script.
The reason that I have to do this is I running php-fpm in docker container. I set “opcache.validate_timestamps=0” so when there is new updates I need to run opcache_reset() function that can flush opcache without php-fpm reload or restart.
We can’t run opcache_reset() from php-cli, opcache in php-fpm won’t be reset. And I can’t just call through nginx (load balancer). Because there are multiple php-fpm nodes behind.
I have to trigger opcache_reset() on every php-fpm containers so finally I have to do like this.
docker exec \
-e SCRIPT_NAME=/opcache_reset.php \
-e SCRIPT_FILENAME=/var/www/html/opcache_reset.php \
-e REQUEST_METHOD=GET \
php-fpm-container \
cgi-fcgi -bind -connect 127.0.0.1:9000
Almalinux network driver
After fresh installation, If your NIC show as UNCLAIMED in lshw then maybe it is caused by your system require a driver that not is not supported by Almalinux. You can look for driver from ELRepo instead.
You need these 4 packages
- kernel-ml
- kernel-ml-core
- kernel-ml-modules
- kernel-ml-modules-extra
For Almalinux 8 on x86_64 : https://elrepo.org/linux/kernel/el8/x86_64/RPMS/
Download 4 packages above put them into flash drive and then use this command to install.
dnf install *.rpm
Using AutoHotkey to adjust DELL monitor brightness/contrast
- Install DELL Display Manager.
- Commands
Increase BrightnesssC:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe /IncControl 10 1
Increase ContrastC:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe /IncControl 12 1
Decrease BrightnessC:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe /DecControl 10 1
Decrease ContrastC:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe /DecControl 12 1
We can passing multiple arguments at the same time like thisC:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe /IncControl 10 1 /IncControl 12 1
- AutoHotkey example
>^PgDn::
Run, C:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe /DecControl 10 3 /DecControl 12 3
Return
>^PgUp::
Run, C:\Program Files (x86)\Dell\Dell Display Manager\ddm.exe /IncControl 10 3 /IncControl 12 3
Return
socket.io server (wss://) behind nginx proxy server
สามารถพบได้ทั่วๆ ที่ใครก็จะแนะนำให้ใส่ config ประมาณนี้ เพื่อทำ reversed proxy ไปยัง socket.io ด้านหลัง
location ^~ /socket.io/ {
proxy_pass https://127.0.0.1:8089;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
}
พอเราทำตามนี้กลับเจอ error WebSocket connection to 'wss://your-domain.com/socket.io/' failed: Error during WebSocket handshake: 'Upgrade' header is missing
นี้ใน Console ของ Browser
Protected: lnw.co.th mail server
GIT repos สำหรับหลาย users
PHP 7 ZTS on CentOS (PowerDNS as RBL)
ล่าสุด setup เครื่องนึง สำหรับทำหน้าที่เช็ค RBL (Realtime Blackhole List) เพื่อจะให้อีเมลเซิร์ฟเวอร์ทุกเครื่องมาเช็คผ่านตรงนี้. สาเหตุจริงๆ ที่ต้องทำแบบนี้เป็นเพราะว่า IP DNS ของ IDC บางที่โดน RBL บางที่บล็อคไม่ให้ใช้งาน ก็เลยตั้งใจมาเปิดเครื่องนึงสำหรับทำหน้าที่นี้โดยเฉพาะแล้วกัน โดยวางไว้ที่ IDC ที่ไม่โดน RBL บล็อค จะได้เช็คได้ครบทุกที่ แล้วเซิร์ฟเวอร์ที่อื่นก็มาวานให้เจ้าตัวนี้มันเป็นผู้ตรวจสอบให้.
ตัวเซิร์ฟเวอร์ติดตั้งเป็น PowerDNS + Pipe backend โดยเขียน php script เพื่อไปเช็คกับ RBL แต่ละที่. ตอนแรกเขียนเป็น for loop ง่ายๆ ในการไล่เช็คกับ RBL แต่ละที่ แต่ปัญหา คือ มันทำให้ response time ของเรามันนานเกินไป. เพื่อที่จะแก้ปัญหานี้ เราเลยลองหาวิธีเขียน pararell บน PHP เพื่อให้มันเช็ค RBL ทุกๆ ที่ไปพร้อมๆ กันเลย เป็นครั้งแรกที่ใช้ PHP แบบนี้ ก็เลยจะบันทึกเก็บไว้หน่อยแล้วกัน. Continue reading “PHP 7 ZTS on CentOS (PowerDNS as RBL)”
Install CentOS 6.4 บนเครื่องที่เป็น UEFI
พอดีได้เครื่อง IBM sytem x3250 M4 มา ผมก็จะนำมาติดตั้ง CentOS 6 + DirectAdmin ตามปรกติ แต่ปรากฏว่าติดปัญหาหลาย step โคตรๆ ตั้งแต่ไม่บูทแผ่น ไม่บูท USB กว่าจะ debug จนทำให้มันบูทเข้า USB ได้นี่ก็เสียเวลาไปเยอะ เพราะว่า Restart แต่ละทีมันรอนานมาก
สรุปประเด็นหลักๆ ที่ติด และวิธีการแก้ไข
1.) USB ที่สร้างมาจาก minimal มันจะไม่สามารถบูทได้ วิธีแก้ คือ ให้ copy โฟลเดอร์ /images/pxeboot ที่อยู่ในแผ่น DVD-1 มาใส่ใน USB ด้วย
2.) การกำหนด Partition ตอนติดตั้ง OS ให้กำหนดเป็นแบบนี้
- /dev/sda
- /boot ext3 200M
- /boot/efi EFI System Partition 200M
- /dev/sdb
- … ext3 200M
- … vfat 200M