Comments (2)
The main reason is that I'm not very good at Windows OS build and Visual Studio and currently I mainly update Linux and macOS. Windows maintenance will be slower. For embed SAPI on Windows, it would be great if someone could initiate a PR or guidance for us to start.
from static-php-cli.
可以借助 MSYS2 环境 和 CMD 环境 进行构建
- MSYS2 环境 用于下载软件 (msys2 集成了 Mingw 和 Cygwin ,同时还提供了包管理工具
pacman
) - CMD 环境 安装Visual Studio
- CMD 环境 执行编译
msys2 环境下载软件
-
下载 msys2 msys2
浏览器打开,自动给下载 msys2: https://mirror.msys2.org/distrib/x86_64/msys2-x86_64-20240507.exe
-
安装 msys2
双击
msys2-x86_64-20240507.exe
进行安装 -
msys2安装软件
pacman -Syy --noconfirm git curl
-
msys2 环境下使用curl 下载软件
# 下载 vs2022 # 方式一 curl -Lo VisualStudioSetup.exe 'https://c2rsetup.officeapps.live.com/c2r/downloadVS.aspx?sku=community&channel=Release&version=VS2022' # 方式二 curl -Lo VisualStudioSetup.exe 'https://aka.ms/vs/17/release/vs_community.exe'
# 下载 php 源码 git clone -b php-8.3.6 --depth=1 https://github.com/php/php-src.git # 下载 php-sdk for windows # git clone -b php-sdk-2.2.0 --depth=1 https://github.com/php/php-sdk-binary-tools.git git clone -b master --depth=1 https://github.com/php/php-sdk-binary-tools.git
CMD 环境 安装VisualStudio
使用命令行快速安装 VisualStudio 组件
cd c:\msys64\home\Administrator\
VisualStudioSetup.exe ^
--locale en-US ^
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 ^
--add Microsoft.Component.MSBuild ^
--add Microsoft.VisualStudio.Component.Roslyn.Compiler ^
--add Microsoft.Component.MSBuild ^
--add Microsoft.VisualStudio.Component.CoreBuildTools ^
--add Microsoft.VisualStudio.Workload.MSBuildTools ^
--add Microsoft.VisualStudio.Component.Windows11SDK.22000 ^
--add Microsoft.VisualStudio.Component.Windows10SDK.20348 ^
--add Microsoft.VisualStudio.Component.Windows10SDK ^
--passive --force --norestart
CMD 环境 编译构建
cd c:\msys64\home\Administrator\php-sdk-binary-tools
phpsdk-vs17-x64.bat
cd c:\msys64\home\Administrator\php-src
buildconf
configure --help
configure --disable-all --enable-cli --enable-static=yes --enable-shared=no
nmake
x64\Release_TS\php.exe -v
x64\Release_TS\php.exe -m
参考文档
- 通过命令行使用 MSVC 工具集
- 通过命令行使用 MSBuild
- Windows SDK
- windows 环境下 构建 php 步骤
- VisualStudio 导入或导出安装配置
- Visual Studio 2019 版本 16.11 发行说明
- Visual Studio 2022 版本 17.9 发行说明
from static-php-cli.
Related Issues (20)
- xz dependency unavailable HOT 1
- win版中构建的micro.sfx HOT 1
- Build error with Postgres because of libxml2 HOT 3
- libuuid fails to build on linux HOT 1
- FreeBSD Support Not Working - "Current OS is not supported" HOT 10
- bug: Linux x86_64 build failed HOT 6
- Compiled Windows executable isn't running HOT 1
- Windows Defender SmartScreen HOT 4
- SSL operation failed with code 5 HOT 10
- In extreme cases micro.sfx using `--with-upx-pack` will build the wrong binary
- Extension request: `gd` on Windows
- postgresql: Failed to get pkg-config information HOT 3
- ncurses 6.5 not working with libreadline
- xz build failed on Linux and macOS
- download bug: for-extensions=redis does not download zstd
- Extension request: `intl` on Windows HOT 2
- `intl` ICU build errors HOT 2
- Add the parallel extension HOT 3
- Doc: remove `untested` type for extension list
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from static-php-cli.