Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How does micro.sfx plus php file not display terminal? #359

Open
KingBes opened this issue Mar 1, 2024 · 2 comments
Open

How does micro.sfx plus php file not display terminal? #359

KingBes opened this issue Mar 1, 2024 · 2 comments
Labels
kind/php-src Issues related to php source os/windows Things only for Windows question Further information is requested

Comments

@KingBes
Copy link

KingBes commented Mar 1, 2024

micro.sfx + php文件生成的exe中,如何不显示终端呢?
就像php-win.exe那样

php-win.exe  文件.php
@crazywhalecc crazywhalecc added bug Something isn't working kind/php-src Issues related to php source os/windows Things only for Windows labels Mar 1, 2024
@crazywhalecc
Copy link
Owner

crazywhalecc commented Mar 1, 2024

micro 的 win32 构建模式好像有点问题,我之前尝试过。可能后面有时间再看看了。理论上说编译 micro 的时候加上 --enable-micro-win32=yes 就行,但是不知道为何这个 flag 不生效,可能需要 dixyes 或者其他更了解 win32 API 的人来解答了。

@crazywhalecc crazywhalecc added question Further information is requested and removed bug Something isn't working labels Mar 1, 2024
@KingBes
Copy link
Author

KingBes commented Apr 23, 2024

虽然我不会win32 API,但经过我的的研究已经解决了这个问题!

新建文件 micro_win32.c

#define PHP_MICRO_WIN32_NO_CONSOLE 1  // 设置这个变量是关键
#include "php_micro.c"

修改 config.w32

注释前面的SAPI('micro', 'php_micro.c php_micro_fileinfo.c php_micro_helper.c php_micro_hooks.c', 'micro.exe', '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');

if (PHP_MICRO_WIN32 == "yes") {
	SAPI('micro', 'micro_win32.c php_micro_fileinfo.c php_micro_helper.c php_micro_hooks.c', 'micro.exe', '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
	ADD_FLAG("CFLAGS_MICRO", "/D PHP_MICRO_WIN32_NO_CONSOLE");
}else{
	SAPI('micro', 'php_micro.c php_micro_fileinfo.c php_micro_helper.c php_micro_hooks.c', 'micro.exe', '/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1');
}

@crazywhalecc crazywhalecc reopened this Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/php-src Issues related to php source os/windows Things only for Windows question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants