修改/etc/wsl.conf,增加
[boot]
systemd=true
修改/etc/wsl.conf,增加
[boot]
systemd=true
sudo apt update
sudo apt -y upgrade
sudo apt install -y lsb-release ca-certificates apt-transport-https software-properties-common gnupg2
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
sudo apt update
sudo apt install php8.2 php8.2-bcmath php8.2-bz2 php8.2-cgi php8.2-cli php8.2-common php8.2-curl php8.2-dev php8.2-enchant php8.2-fpm php8.2-gd php8.2-http php8.2-igbinary php8.2-http php8.2-imagick php8.2-imap php8.2-intl php8.2-mbstring php8.2-mcrypt php8.2-memcached php8.2-memcache php8.2-msgpack php8.2-mysql php8.2-oauth php8.2-odbc php8.2-opcache php8.2-pgsql php8.2-redis php8.2-snmp php8.2-soap php8.2-sqlite3 php8.2-solr php8.2-ssh2 php8.2-stomp php8.2-tidy php8.2-uuid php8.2-xdebug php8.2-xml php8.2-xmlrpc php8.2-yaml php8.2-xsl php8.2-zip php8.2-zmq php8.2-raphf
PHP 7.4
sudo apt install php7.4 php7.4-bcmath php7.4-bz2 php7.4-cgi php7.4-cli php7.4-common php7.4-curl php7.4-dev php7.4-enchant php7.4-fpm php7.4-gd php7.4-grpc php7.4-http php7.4-igbinary php7.4-http php7.4-imagick php7.4-inotify php7.4-imap php7.4-intl php7.4-mbstring php7.4-mcrypt php7.4-memcached php7.4-memcache php7.4-msgpack php7.4-mysql php7.4-oauth php7.4-odbc php7.4-opcache php7.4-pgsql php7.4-redis php7.4-snmp php7.4-soap php7.4-sqlite3 php7.4-solr php7.4-ssh2 php7.4-stomp php7.4-tidy php7.4-uuid php7.4-xdebug php7.4-xhprof php7.4-xml php7.4-xmlrpc php7.4-yaml php7.4-xsl php7.4-zip php7.4-zmq php7.4-raphf
php -v
php -m
plugins=(git composer npm pip pyenv virtualenv debian systemd python history-substring-search zsh-autosuggestions zsh-syntax-highlighting last-working-dir wd extract zoxide)
find $log_path -cmin +1 -type d | xargs rm -rf {} # 1分钟前创建的
find $log_path -mmin +1 -type d | xargs rm -rf {} # 1分钟前修改的
find $log_path -ctime +1 -type d | xargs rm -rf {} # 1天前创建的
find $log_path -mtime +1 -type d | xargs rm -rf {} # 1天前修改的
find $log_path/* -mtime +1 -type d | xargs rm -rf {} # 30天钟前修改的,不包括当前目录
目前的解决方法:
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt upgrade
sudo apt install php7.4-common php7.4-cgi php7.4-gd php7.4-mysql php7.4-xml php7.4-cli php7.4-json php7.4-sqlite3 php7.4-xmlrpc php7.4-bcmath php7.4-enchant
php7.4-opcache php7.4-readline php7.4-xsl php7.4-bz2 php7.4-curl php7.4-fpm php7.4-mbstring php7.4-pgsql php7.4-tidy php7.4-zip
sudo apt install php8.0-common php8.0-cgi php8.0-gd php8.0-mysql php8.0-xml php8.0-cli php8.0-sqlite3 php8.0-xmlrpc php8.0-bcmath php8.0-enchant php8.0-opcache php8.0-readline php8.0-xsl php8.0-bz2 php8.0-curl php8.0-fpm php8.0-mbstring php8.0-pgsql php8.0-tidy php8.0-zip
安装composer
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
sudo mv composer.phar /usr/local/bin/composer
配置composer使用镜像
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
运行composer时指定PHP版本
php8.0 /usr/local/bin/composer
php7.4 /usr/local/bin/composer
alias composer7='php7.4 /usr/local/bin/composer'
alias composer8='php8.0 /usr/local/bin/composer'
查看本地所有PHP版本
symfony local:php:list
显示结果
┌─────────┬────────────┬────────────┬─────────┬─────────┬─────────┬─────────┐
│ Version │ Directory │ PHP CLI │ PHP FPM │ PHP CGI │ Server │ System? │
├─────────┼────────────┼────────────┼─────────┼─────────┼─────────┼─────────┤
│ 7.4.14 │ /usr/local │ bin/php │ │ │ PHP CLI │ * │
│ 7.4.16 │ /usr │ bin/php7.4 │ │ │ PHP CLI │ │
└─────────┴────────────┴────────────┴─────────┴─────────┴─────────┴─────────┘
指定symfony composer
使用PHP7
echo 7 > .php-version
指定symfony composer
使用PHP8
echo 8 > .php-version
使用symfony composer
安装或者更新包
symfony composer install
Cmder是一个可用于linux的便携式控制台虚拟器,可以让你在windows下使用linux命令。
Windows Terminal是Windows 10的控制台管理界面。
IDEA是广大开发人员的最爱。
本文介绍如何将Cmder整合到Windows Terminal和IDEA。
可以去 https://cmder.net/ 下载最新的压缩文件,解压后点击Cmder.exe即可使用。如果已经安装了git for windows下载mini版本就可以了,否则可以下载包含git的full版本。
以下d:\tools\Cmder
是Cmder解压目录
CMDER_ROOT = d:\tools\Cmder
进入Power shell,输入New-Guid
PS C:\Users\Administrator> New-Guid
Guid
----
092f8948-9ea5-4928-bea7-a1f71938e717
点击Windows Terminal
的下拉菜单,选择“配置”,会打开它的配置文件
增加
{
"guid": "{092f8948-9ea5-4928-bea7-a1f71938e717}",
"name": "Cmder",
"commandline": "cmd.exe /k %CMDER_ROOT%\\vendor\\init.bat",
"startingDirectory": "%USERPROFILE%",
"icon": "%CMDER_ROOT%\\icons\\cmder.ico",
"background": "#2e3436",
"padding": "15",
"fontFace": "Cascadia Code",
"fontSize": 10
}
然后修改
"defaultProfile": "Cmder",
点击Windows Terminal
的加号,查看效果
打开 PhpStrom
的设置,找到 Tools
下的 terminal
修改 Shell path
为 "cmd" /k ""%CMDER_ROOT%\vendor\init.bat""
wkhtmltopdf使用的qt版本比较久,不支持很多css3和html5特性,于是用qt写了一个html转PDF工具,需要常驻后台运行,采用supervisord守护,无需安装图形界面,这时候需要用到Xvfb。
Xvfb or X virtual framebuffer is a display server implementing the X11 display server protocol. In contrast to other display servers, Xvfb performs all graphical operations in virtual memory without showing any screen output.
简单说就是Xvfb是一个虚拟的X11显示服务,在虚拟内存中执行不需要显示图像。可以用来做远程左面显示,以及将桌面程序在非桌面环境使用(如headless的图形界面测试)。
安装xvfb
sudo apt-get install xvfb
命令行运行虚拟桌面
Xvfb :2 -screen 0 1024x768x16 &
x11vnc -listen 0.0.0.0 -rfbport 5900 -noipv6 -passwd xxxxxx -display 2
export DISPLAY=:2
from xvfbwrapper import Xvfb
with Xvfb(width=1920, height=1024, colordepth=24) as xvfb:
# launch stuff inside virtual display here.
# Xvfb will stop when this block completes
默认 Linux 下挂载的ntfs分区,会出现chown,chmod都无效,且默认都是root用户。需要采用ntfs-3g
方式挂载后,支持权限。图形界面下点击磁盘管理,修改挂载参数即可。命令行界面需要直接先mount.ntfs-3g /dev/sdb2 /data ntfs-3g
测试下,然后修改/etc/fstab
,然后运行mount -a
首先,让我们看一下完全的挂载参数:
~ >>> cat /etc/fstab
/dev/sdb2 /data ntfs-3g permissions,users,auto,exec,uid=ning,gid=ning 0 0
By default, ntfs-3g mounts the partition noexec, nosuid, and nodev.