Skip to content

Instantly share code, notes, and snippets.

@Siglud
Siglud / php_xdebug_wsl_phpstorm.md
Last active February 1, 2024 04:59
Config PHP Xdebug in PHPStorm with WSL & PHP 8.3 & Xdebug 3.3.0

Config PHP

The method of the Xdebug working is the IDE should open a port for connection, then we debug session is comming, the Xdebug extension will connect to the location and the port you defined in php.ini or you $_REQUEST['REMOTE_HOST'] by default.

In WSL, we mostly use localhost to visit the web server. but the php server in the WSL cannot connect to the Windows by using 127.0.0.1. So, we need to change the config in php.ini using this config.

# Set to your Xdebug location
zend_extension=xdebug.so
# When the Xdebug version >= 3, this option will open debug mode
@Siglud
Siglud / running_elysia_with_bun_in_azure_app_service.md
Last active January 4, 2024 08:40
Running Elysia with Bun in Azure App Service

Azure App Service do not support Bun yet, but we can still use docker container to run elysia.

  1. Create a Container Registry using Azure CLI.
az acr create --name myregistry --resource-group mygroup --sku standard --admin-enabled true
  1. Login.
az acr login -n myregistry
@Siglud
Siglud / wordpress_nginx_http3.md
Last active July 6, 2023 05:08
Problem when WordPress enable HTTP3 on nginx version >= 1.25.0

Nginx >= 1.25.0 supports HTTP/3 navitly. But with HTTP/3 enabled, WordPress does not work properly in index page & some other pages in admin site.

The reason is that $_SERVER['HTTP_HOST'] and $_SERVER['SERVER_NAME'] are lost in HTTP/3 mode.

To work around this, we can hardcode the server name into the fastcgi_param like this

server {
    listen 443 quic;
    listen 443 ssl;
    # http2 flag only works on 1.25.1
@Siglud
Siglud / proxy_for_github.md
Last active June 14, 2021 09:36
github的SSH协议代理配置

网上有一大堆可以给github增加http和https代理的方式,总结起来大概就是修改~/.gitconfig然后增加

[http "https://github.com"]
	proxy = socks5h://127.0.0.1:1080

但是这样只能代理https和http协议的内容,也就是说 git clone https://github.com/some_repertory 是可以走代理的,但是git clone git@github.com:someone/repertory 就不行了

因为其实git协议本身是走的ssh协议,因此,这个也可以直接通过ssh的config来设置代理