macOS PHP 7.4 开发环境完整配置教程
macOS PHP 7.4 开发环境配置教程涵盖 Homebrew 安装、PHP 7.4 及扩展部署、MySQL 8.4 数据库配置、Nginx Web 服务器设置、Redis 缓存服务集成以及域名 hosts 配置。内容包括环境搭建步骤、配置文件修改、测试页面验证、常用命令速查及故障排除指南,旨在帮助开发者快速构建本地多项目开发与调试环境。

macOS PHP 7.4 开发环境配置教程涵盖 Homebrew 安装、PHP 7.4 及扩展部署、MySQL 8.4 数据库配置、Nginx Web 服务器设置、Redis 缓存服务集成以及域名 hosts 配置。内容包括环境搭建步骤、配置文件修改、测试页面验证、常用命令速查及故障排除指南,旨在帮助开发者快速构建本地多项目开发与调试环境。

| 组件 | 版本 | 说明 |
|---|
| PHP | 7.4.33 | 使用 shivammathur/php tap 安装 |
| MySQL | 8.4.x | Homebrew 官方版本 |
| Redis | 8.4.x | 缓存服务器 |
| Nginx | 1.29.x | Web 服务器 |
~/Sites/ # 项目根目录
├── localhost/ # 主开发环境
│ ├── index.php
│ ├── phpinfo.php
│ ├── db_test.php
│ ├── redis_test.php
│ └── final_verification.php
├── projects/ # 多项目目录
│ ├── blog/
│ ├── shop/
│ ├── admin/
│ └── api/
├── logs/ # 日志目录
│ ├── php/
│ └── nginx/
└── ssl/ # SSL 证书目录
/opt/homebrew/ # Homebrew 安装目录
├── etc/ # 配置文件
│ ├── php/7.4/
│ ├── nginx/
│ └── [email protected]/
└── var/ # 数据目录
├── [email protected]/
└── log/
# 检查 Homebrew 是否已安装
which brew
# 检查 Homebrew 版本
brew --version
# 检查系统架构
uname -m # 应该是 arm64(M1/M2/M3)或 x86_64(Intel)
# 更新 Homebrew
brew update
# 检查是否有待升级的包
brew upgrade
# 安装 Homebrew(官方命令)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 添加 Homebrew 到 PATH(Apple Silicon Mac)
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
# 安装常用工具
brew install curl
brew install wget
brew install git
macOS 的 Homebrew 官方仓库不再提供 PHP 7.4,需要使用 shivammathur/php tap:
# 添加 PHP 版本管理仓库
brew tap shivammathur/php
# 更新 brew
brew update
# 安装 PHP 7.4(包含常用扩展)
brew install shivammathur/php/[email protected]
# 验证安装
/opt/homebrew/opt/[email protected]/bin/php --version
输出示例:
PHP 7.4.33 (cli) (built: Dec 19 2025 22:33:57) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.33, Copyright (c), by Zend Technologies
# 编辑 shell 配置文件
vi ~/.zshrc
# 添加以下内容:
export PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"
export PATH="/opt/homebrew/opt/[email protected]/sbin:$PATH"
# 使配置生效
source ~/.zshrc
# 检查 PHP 版本
php --version
# 检查已加载的扩展
php -m
# 查看 PHP 配置信息
php -i
# 安装 MySQL 8.4
brew install [email protected]
# 启动 MySQL 服务
brew services start [email protected]
# 验证 MySQL 运行
brew services list | grep mysql
# 运行安全配置脚本
/opt/homebrew/opt/[email protected]/bin/mysql_secure_installation
# 按照提示完成配置:
# 1. 设置 VALIDATE PASSWORD component(可选)
# 2. 设置 root 密码
# 3. 移除匿名用户
# 4. 禁止 root 远程登录
# 5. 移除 test 数据库
# 6. 重新加载权限表
# 连接 MySQL
mysql -u root -p
# 在 MySQL 命令行中执行:
CREATE DATABASE IF NOT EXISTS dev_database CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER IF NOT EXISTS 'dev_user'@'localhost' IDENTIFIED BY '你的密码';
GRANT ALL PRIVILEGES ON dev_database.* TO 'dev_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
# 使用 root 用户连接
mysql -u root -p -e "SELECT VERSION();"
# 使用开发用户连接
mysql -u dev_user -p -e "USE dev_database; SHOW TABLES;"
# 编辑 MySQL 配置文件
vi /opt/homebrew/etc/mysql/my.cnf
# 添加优化配置:
[mysqld]
# 字符集配置
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
# InnoDB 配置
innodb_buffer_pool_size = 256M
innodb_log_file_size = 64M
# 连接配置
max_connections = 100
wait_timeout = 28800
# 日志配置
slow_query_log = 1
slow_query_log_file = /opt/homebrew/var/log/mysql/slow.log
long_query_time = 2
# 安装 Nginx
brew install nginx
# 启动 Nginx 服务
brew services start nginx
# 验证 Nginx 运行
brew services list | grep nginx
# 测试配置语法
nginx -t
# 创建主项目目录
mkdir -p ~/Sites/localhost
mkdir -p ~/Sites/logs/{php,nginx}
# 设置权限
chmod 755 ~/Sites
# 创建配置文件
vi /opt/homebrew/etc/nginx/servers/local.dev.conf
完整配置内容:
server {
listen 80;
server_name local.test;
# 网站根目录
root /Users/你的用户名/Sites/localhost;
index index.php index.html index.htm;
# 日志配置
access_log /Users/你的用户名/Sites/logs/nginx/local.test.access.log;
error_log /Users/你的用户名/Sites/logs/nginx/local.test.error.log;
# PHP 处理
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 300;
}
# URL 重写(支持 Laravel 等框架)
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# 隐藏文件保护
location ~ /\. {
deny all;
}
# 静态文件缓存
location ~* \.(js|css|png|jpg|jpeg|gif|ico|woff|woff2)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}
# 创建多项目目录
mkdir -p ~/Sites/projects/{blog,shop,admin,api}
# 设置权限
chmod 755 ~/Sites
# 创建多项目配置
vi /opt/homebrew/etc/nginx/servers/multi_test.conf
# 博客项目
server {
listen 80;
server_name blog.test;
root /Users/你的用户名/Sites/projects/blog;
index index.php index.html;
access_log /Users/你的用户名/Sites/logs/nginx/blog.test.access.log;
error_log /Users/你的用户名/Sites/logs/nginx/blog.test.error.log;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
# 商城项目
server {
listen 80;
server_name shop.test;
root /Users/你的用户名/Sites/projects/shop;
index index.php index.html;
access_log /Users/你的用户名/Sites/logs/nginx/shop.test.access.log;
error_log /Users/你的用户名/Sites/logs/nginx/shop.test.error.log;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
# 管理后台
server {
listen 80;
server_name admin.test;
root /Users/你的用户名/Sites/projects/admin;
index index.php index.html;
access_log /Users/你的用户名/Sites/logs/nginx/admin.test.access.log;
error_log /Users/你的用户名/Sites/logs/nginx/admin.test.error.log;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
# 测试配置语法
nginx -t
# 重启服务
brew services restart nginx
# 查看服务状态
brew services list
# 安装 Redis
brew install redis
# 启动 Redis 服务
brew services start redis
# 验证 Redis 运行
brew services list | grep redis
# 测试 Redis 连接
redis-cli ping
# 编辑 Redis 配置文件
vi /opt/homebrew/etc/redis.conf
# 常用配置:
bind 127.0.0.1
port 6379
daemonize no
# 内存限制
maxmemory 256mb
maxmemory-policy allkeys-lru
# 日志配置
loglevel notice
logfile /opt/homebrew/var/log/redis.log
# RDB 持久化配置
save 900 1
save 300 10
save 60 10000
本阶段将安装和配置与 Redis 相关的 PHP 扩展,包括 igbinary 序列化加速和 LZF 压缩扩展。
# 确保 Homebrew 已更新
brew update
# 安装编译工具(如未安装)
brew install autoconf automake libtool
igbinary 是一个高性能的二进制序列化扩展,比 PHP 标准序列化快 30-50%,用于提升 Redis 数据序列化的性能。
# 安装 igbinary 扩展
/opt/homebrew/opt/[email protected]/bin/pecl install igbinary
安装说明:
LZF 是一个轻量级的压缩算法,用于 Redis 数据压缩,可以显著减少内存占用。
# 安装 LZF 扩展
/opt/homebrew/opt/[email protected]/bin/pecl install lzf
安装说明:
Redis 扩展 是 PHP 连接 Redis 服务器的客户端库,支持所有 Redis 命令。
# 安装 Redis 扩展
/opt/homebrew/opt/[email protected]/bin/pecl install redis
安装过程中的配置选择:
enable igbinary serializer support? [yes] : yes
enable lzf compression support? [yes] : yes
enable zstd compression support? [no] : no
enable msgpack serializer support? [no] : no
enable lz4 compression support? [no] : no
配置选项说明:
| 选项 | 推荐 | 说明 |
|---|---|---|
| igbinary | yes | 二进制序列化,比标准序列化快 30-50% |
| LZF | yes | 轻量级压缩,CPU 开销小,适合缓存数据 |
| Zstd | no | 高压缩率算法,但增加复杂度,开发环境不需要 |
| MessagePack | no | 跨语言序列化,纯 PHP 项目不需要 |
| LZ4 | no | 极速压缩,已有 LZF 足够 |
# 检查扩展是否正确加载
php -m | grep -E "(redis|igbinary|lzf)"
# 应该显示:
# igbinary
# lzf
# redis
# 编辑 PHP 配置文件
vi /opt/homebrew/etc/php/7.4/php.ini
# 关键配置:
display_errors = On
error_reporting = E_ALL
log_errors = On
error_log = /Users/你的用户名/Sites/logs/php/php_errors.log
memory_limit = 256M
max_execution_time = 300
upload_max_filesize = 64M
post_max_size = 64M
扩展配置(通常自动添加,无需手动配置):
extension=igbinary.so
extension=lzf.so
extension=redis.so
# 编辑 PHP-FPM 配置
vi /opt/homebrew/etc/php/7.4/php-fpm.d/www.conf
# 配置内容:
[www]
user = 你的用户名
group = staff
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 50
pm.start_servers = 5
pm.min_spare_servers = 2
pm.max_spare_servers = 8
php_admin_value[error_log]= /Users/你的用户名/Sites/logs/php/php-fpm.error.log
php_admin_flag[log_errors]= on
# 重启 PHP-FPM 服务
brew services restart shivammathur/php/[email protected]
重要提醒:不要使用 .dev 域名!
Chrome 浏览器从 2021 年开始对所有 .dev 域名实施 HSTS(HTTP 严格传输安全)策略:
推荐使用 .test 域名:
# 编辑 hosts 文件
sudo vi /etc/hosts
# 添加以下内容:
127.0.0.1 local.test
127.0.0.1 blog.test
127.0.0.1 shop.test
127.0.0.1 admin.test
127.0.0.1 api.test
# 测试域名解析
ping local.test # 应该返回:PING local.test (127.0.0.1)
# 测试 HTTP 访问
curl -I http://local.test # 应该返回:HTTP/1.1 200 OK
# 查看服务状态
brew services list
# 检查端口占用
lsof -i :80,9000,3306,6379
<?php
// ~/Sites/localhost/phpinfo.php
phpinfo();
<?php
// ~/Sites/localhost/db_test.php
echo "<h1>数据库连接测试</h1>";
try {
$pdo = new PDO("mysql:host=localhost;dbname=dev_database", "dev_user", "你的密码");
echo "✅ MySQL 连接成功<br>";
$stmt = $pdo->query("SELECT VERSION() as version");
$row = $stmt->fetch(PDO::FETCH_ASSOC);
echo "MySQL 版本:" . $row['version'] . "<br>";
} catch (PDOException $e) {
echo "❌ MySQL 连接失败:" . $e->getMessage() . "<br>";
}
<?php
// ~/Sites/localhost/redis_test.php
echo "<h1>Redis 连接测试</h1>";
try {
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
echo "✅ Redis 连接成功<br>";
$redis->set('test_key', 'Hello Redis!');
$value = $redis->get('test_key');
echo "Redis 读写测试:$value<br>";
// 测试 igbinary 序列化
if (extension_loaded('igbinary')) {
$data = ['test' => 'data'];
$serialized = igbinary_serialize($data);
$redis->set('igbinary_test', $serialized);
$result = igbinary_unserialize($redis->get('igbinary_test'));
echo "igbinary 序列化:" . ($data === $result ? "✅ 成功" : "❌ 失败") . "<br>";
}
} catch (Exception $e) {
echo "❌ Redis 连接失败:" . $e->getMessage() . "<br>";
}
<?php
// ~/Sites/localhost/final_verification.php
echo "<h1>🎉 PHP 7.4 开发环境完整验证</h1>";
// PHP 版本
echo "<h2>PHP 版本:" . phpversion() . "</h2>";
// 扩展检查
$extensions = ['pdo_mysql', 'mysqli', 'redis', 'curl', 'gd', 'mbstring', 'openssl', 'igbinary', 'lzf'];
echo "<h3>扩展状态:</h3>";
foreach ($extensions as $ext) {
$status = extension_loaded($ext) ? "✅" : "❌";
echo "$status$ext<br>";
}
// 服务端口检查
echo "<h3>服务状态:</h3>";
$ports = [80 => 'Nginx', 9000 => 'PHP-FPM', 3306 => 'MySQL', 6379 => 'Redis'];
foreach ($ports as $port => $service) {
$fp = @fsockopen('127.0.0.1', $port, $errno, $errstr, 1);
$status = $fp ? "✅" : "❌";
echo "$status$service (端口 $port)<br>";
if ($fp) fclose($fp);
}
// 数据库连接
echo "<h3>数据库连接:</h3>";
try {
$pdo = new PDO("mysql:host=localhost;dbname=dev_database", "dev_user", "你的密码");
echo "✅ MySQL 连接成功<br>";
} catch (PDOException $e) {
echo "❌ MySQL 连接失败<br>";
}
// Redis 连接
echo "<h3>Redis 连接:</h3>";
try {
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
echo "✅ Redis 连接成功<br>";
} catch (Exception $e) {
echo "❌ Redis 连接失败<br>";
}
配置完成后,在浏览器中访问:
# 主环境验证
http://local.test/final_verification.php
# PHP 信息
http://local.test/phpinfo.php
# 数据库测试
http://local.test/db_test.php
# Redis 测试
http://local.test/redis_test.php
# 多项目
http://blog.test
http://shop.test
http://admin.test
# 启动服务
brew services start nginx
brew services start [email protected]
brew services start [email protected]
brew services start redis
# 停止服务
brew services stop nginx
brew services stop [email protected]
brew services stop [email protected]
brew services stop redis
# 重启服务
brew services restart nginx
brew services restart [email protected]
brew services restart [email protected]
brew services restart redis
# 查看所有服务状态
brew services list
# 检查特定端口
lsof -i :80 # Nginx
lsof -i :9000 # PHP-FPM
lsof -i :3306 # MySQL
lsof -i :6379 # Redis
# PHP 版本
php --version
# 已加载的扩展
php -m
# PHP 配置信息
php -i
# 查找 php.ini 位置
php --ini
# 特定扩展版本
php -r "echo phpversion('redis');"
# 连接 MySQL
mysql -u root -p
mysql -u dev_user -p
# 查看数据库
SHOW DATABASES;
# 选择数据库
USE dev_database;
# 查看表
SHOW TABLES;
# MySQL 版本
mysql -V
# 重启 MySQL
brew services restart [email protected]
# 测试连接
redis-cli ping
# Redis 命令行
redis-cli
# 基本操作
redis-cli SET key value
redis-cli GET key
redis-cli KEYS *
redis-cli DEL key
# 查看 Redis 信息
redis-cli INFO
# 清空所有数据
redis-cli FLUSHALL
# 测试配置语法
nginx -t
# 重载配置
nginx -s reload
# 停止 Nginx
nginx -s stop
# 查看 Nginx 版本
nginx -v
# 检查配置
nginx -T
# 实时查看日志
tail -f ~/Sites/logs/php/php_errors.log
tail -f ~/Sites/logs/nginx/local.test.error.log
# 查看错误日志
tail -50 ~/Sites/logs/php/php-fpm.error.log
tail -50 ~/Sites/logs/nginx/local.test.error.log
# Nginx 访问日志
tail -50 ~/Sites/logs/nginx/local.test.access.log
错误信息:
nginx: [emerg] unknown "user" variable
解决方法:
# 检查并修复 Nginx 配置
nginx -t
# 查看详细错误
tail -f /opt/homebrew/var/log/nginx/error.log
# 确保使用实际用户名而非变量
# 错误示例:root /Users/$USER/Sites/localhost;
# 正确示例:root /Users/你的用户名/Sites/localhost;
错误信息:
PHP Fatal error: Uncaught Error: Class 'Redis' not found
解决方法:
# 检查扩展是否安装
php -m | grep redis
# 检查 php.ini 配置
php -i | grep extension_dir
# 确认扩展文件存在
ls /opt/homebrew/Cellar/[email protected]/*/pecl/*/redis.so
# 重启 PHP-FPM
brew services restart shivammathur/php/[email protected]
错误信息:
SQLSTATE[HY000] [1045] Access denied for user
解决方法:
# 检查 MySQL 服务状态
brew services list | grep mysql
# 重启 MySQL
brew services restart [email protected]
# 检查 MySQL 错误日志
tail -f /opt/homebrew/var/mysql/*.err
# 验证用户名密码
mysql -u dev_user -p
问题原因: Chrome 对 .dev 域名实施了 HSTS 策略
解决方法: 使用 .test 域名替代:
# hosts 文件中使用.test 后缀
127.0.0.1 local.test
127.0.0.1 blog.test
错误信息:
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
解决方法:
# 查找占用端口的进程
lsof -i :80
# 终止占用进程
kill -9 PID
# 或使用其他端口
# 修改 Nginx 配置:listen 8080;
解决方法:
# 检查 PHP-FPM 服务
brew services list | grep php
# 手动启动
brew services start shivammathur/php/[email protected]
# 检查错误日志
tail -f ~/Sites/logs/php/php-fpm.error.log
# 测试 PHP-FPM 配置
/opt/homebrew/opt/[email protected]/sbin/php-fpm -t
错误信息:
RedisException: Redis server went away
解决方法:
# 检查 Redis 服务状态
brew services list | grep redis
# 启动 Redis
brew services start redis
# 测试连接
redis-cli ping
# 检查 Redis 日志
tail -f /opt/homebrew/var/log/redis.log
# 每周检查服务状态
brew services list
# 定期查看日志
tail -f ~/Sites/logs/php/*.log
tail -f ~/Sites/logs/nginx/*.log
# 定期清理过期日志
find ~/Sites/logs -name "*.log" -mtime +7 -delete
# php.ini
opcache.enable = 1
opcache.memory_consumption = 256
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 10000
opcache.validate_timestamps = 1
opcache.revalidate_freq = 2
# my.cnf
innodb_buffer_pool_size = 512M
innodb_log_file_size = 128M
max_connections = 200
query_cache_size = 64M
# redis.conf
maxmemory 512mb
maxmemory-policy allkeys-lru
appendonly yes
appendfsync everysec
-- 使用强密码
CREATE USER 'user'@'localhost' IDENTIFIED BY 'StrongP@ssw0rd!';
-- 定期备份数据库
mysqldump -u root -p dev_database > backup_$(date+%Y%m%d).sql
# 项目目录权限
chmod 755 ~/Sites/localhost
chmod 644 ~/Sites/localhost/*.php
# 日志目录权限
chmod 755 ~/Sites/logs
chmod 644 ~/Sites/logs/**/*.log
# 禁止 Web 访问敏感文件
# 在 nginx 配置中添加:
location ~ /\. {
deny all;
}
# 1. 启动所有服务
brew services start nginx [email protected] [email protected] redis
# 2. 验证服务状态
brew services list
# 3. 测试开发环境
curl http://local.test/final_verification.php
# 4. 开始开发...
# 1. 检查配置语法
nginx -t
/opt/homebrew/opt/[email protected]/sbin/php-fpm -t
# 2. 重启所有服务
brew services restart nginx [email protected] [email protected] redis
# 3. 全面测试
curl -I http://local.test
curl http://local.test/db_test.php
curl http://local.test/redis_test.php
# 完整备份
mysqldump -u root -p --all-databases > full_backup_$(date +%Y%m%d).sql
# 单个数据库备份
mysqldump -u root -p dev_database > dev_database_backup_$(date +%Y%m%d).sql
# 恢复数据库
mysql -u root -p < backup_file.sql
# 备份所有配置
cp -r /opt/homebrew/etc/nginx ~/backup/nginx_config_$(date +%Y%m%d)
cp -r /opt/homebrew/etc/php/7.4 ~/backup/php_config_$(date +%Y%m%d)
cp -r /opt/homebrew/etc/mysql ~/backup/mysql_config_$(date +%Y%m%d)
# 安装包
brew install <package_name>
# 卸载包
brew uninstall <package_name>
# 搜索包
brew search <package_name>
# 查看已安装的包
brew list
# 更新包
brew upgrade <package_name>
# 清理旧版本
brew cleanup
# 查看信息
brew info <package_name>
| 用途 | 路径 |
|---|---|
| PHP 配置 | /opt/homebrew/etc/php/7.4/php.ini |
| PHP-FPM 配置 | /opt/homebrew/etc/php/7.4/php-fpm.d/www.conf |
| Nginx 配置 | /opt/homebrew/etc/nginx/nginx.conf |
| Nginx 虚拟主机 | /opt/homebrew/etc/nginx/servers/ |
| MySQL 配置 | /opt/homebrew/etc/mysql/my.cnf |
| Redis 配置 | /opt/homebrew/etc/redis.conf |
| PHP 错误日志 | ~/Sites/logs/php/php_errors.log |
| Nginx 访问日志 | ~/Sites/logs/nginx/*.access.log |
| 项目根目录 | ~/Sites/ |
恭喜!你已经成功在 macOS 上配置了完整的 PHP 7.4 开发环境,包括:
✅ PHP 7.4.33 - 完整的 PHP 开发环境 ✅ MySQL 8.4.x - 关系型数据库 ✅ Redis 8.4.x - 高性能缓存系统 ✅ Nginx 1.29.x - Web 服务器 ✅ igbinary - 二进制序列化加速 ✅ LZF - 轻量级压缩 ✅ .test 域名 - 专业的本地开发域名
祝你开发愉快!🚀

微信公众号「极客日志」,在微信中扫描左侧二维码关注。展示文案:极客日志 zeeklog
解析常见 curl 参数并生成 fetch、axios、PHP curl 或 Python requests 示例代码。 在线工具,curl 转代码在线工具,online
将字符串编码和解码为其 Base64 格式表示形式即可。 在线工具,Base64 字符串编码/解码在线工具,online
将字符串、文件或图像转换为其 Base64 表示形式。 在线工具,Base64 文件转换器在线工具,online
将 Markdown(GFM)转为 HTML 片段,浏览器内 marked 解析;与 HTML转Markdown 互为补充。 在线工具,Markdown转HTML在线工具,online
将 HTML 片段转为 GitHub Flavored Markdown,支持标题、列表、链接、代码块与表格等;浏览器内处理,可链接预填。 在线工具,HTML转Markdown在线工具,online
通过删除不必要的空白来缩小和压缩JSON。 在线工具,JSON 压缩在线工具,online