TypePHP 编译器 https://swoole.com/aot/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
韩天峰 4a2b2ef201 test(aot): 更新幂运算整数溢出测试的期望输出 3 months ago
bin feat(cli): 添加 AST 语法树导出工具和大整数示例 3 months ago
cases 更新 1 year ago
docs BitInt 支持位运算操作符 3 months ago
examples feat(compiler): 添加对 Big* 类型的字符串转换和数学函数优化支持 3 months ago
phpunit refactor(aot): 移除UnsafePtr类型支持并优化std容器实现 3 months ago
src feat(compiler): 添加对 bigint、bigfloat 和 decimal 类型的支持 3 months ago
tests test(aot): 更新幂运算整数溢出测试的期望输出 3 months ago
web fix 3 years ago
.clang-format update 8 months ago
.gitignore chore(build): 添加 Python 缓存目录到忽略列表 3 months ago
.php-cs-fixer.dist.php Revert "style(config): 更新PHP代码样式配置" 4 months ago
CLANG_TEST_GUIDE.md feat(compiler): 添加 Windows Clang 编译器支持 4 months ago
CLAUDE.md docs(project): 添加项目指导文档 CLAUDE.md 3 months ago
LICENSE.md docs(license): 更新版权信息归属 4 months ago
README.md fix(php): 修复代码格式化和常量定义问题 4 months ago
REFACTORING_README.md refactor(backend): 将调试配置选项从 debug_info 统一更改为 debug 4 months ago
REFACTORING_SUMMARY.md refactor(backend): 重构编译器架构为Platform+Backend双层抽象 4 months ago
ast.py 支持目录处理 8 months ago
cli.php feat(php): 添加 std::array 类型支持并优化编译器功能 4 months ago
composer.json chore(deps): 更新 swoole/phpx 依赖版本 4 months ago
composer.lock refactor(php): 重构 PHP 编译器基础类以使用 phpx 库 4 months ago
conv.php init 3 years ago
dump.py init 3 years ago
mv.php mv.php 移至根目录,非 compiler 工具 5 months ago
package-on-windows.php feat(build): 更新 Windows 打包脚本以支持新示例和配置文件 4 months ago
package.json feat(build): 添加 Windows 资源文件支持功能 4 months ago
package.sh feat(build): 更新打包脚本支持跨平台优化 4 months ago
patent.md docs: 添加两项专利申请技术交底书 3 months ago
phpunit.xml feat(compiler): 添加测试模式和静态变量重复检测功能 5 months ago
project.yml feat(build): 添加 Windows 资源文件支持功能 4 months ago
py2php.php op 3 years ago
rounds.txt update 8 months ago
run-tests.php feat(tests): 添加编译器路径配置选项支持 3 months ago
smaller test(backend): 添加后端编译器单元测试并修复编译选项构建功能 4 months ago
svg-to-ico.js feat(build): 添加 Windows 资源文件支持功能 4 months ago
swoole-logo.ico feat(build): 添加 Windows 资源文件支持功能 4 months ago
swoole-logo.svg feat(build): 添加 Windows 资源文件支持功能 4 months ago
version.txt chore(deps): 更新 swoole/phpx 依赖版本 4 months ago

README.md

依赖

  • 需要 PHP-8.2 以上版本
  • 需要 GCC-9 以上版本,支持 C++17 标准
  • 需要 CMake-3.24 以上版本

预览版目前仅支持 Linux 系统,建议使用 Ubuntu 22.04

PHP

必须包含 embed 模块

PHPX

可使用 composer install 安装依赖。 进入 vendor/swoole/phpx 目录,编译 phpx

cd vendor/swoole/phpx
cmake .
make -j32

动态链接库

sudo ldconfig -p | grep php

必须包含 libphp.solibphpx.so

若编译完成,但找不到动态链接库,需要修改

vim /etc/ld.so.conf.d/swoole.conf 

添加路径

/home/swoole/workspace/projects/phpx/lib
/opt/php-8.4/lib/