需要 php-config shell 脚本


php-config shell script needed

我想在Windows下编译PHP的扩展,我需要运行这样的命令:

g++ `php-config --includes` -fPIC -c some_script.cpp

但是当我运行此命令时,我收到一个错误:

g++: error: `php-config: No such file or directory
g++: error: unrecognized option '--includes`'

我在哪里可以获得php-config shell脚本而无需重新编译PHP(在Windows下)

问题不在于你没有脚本,而在于 Windows shell 不知道你想做什么,因为它不支持反引号。 该命令想要运行php-config脚本并将输出包含在命令中,但g++ ' php-config as the first argument, and --include'' 作为第二个参数传递,这不是 GCC 的有效参数。

您不能在 Windows 中运行 UNIX shell 命令。要么使用 UNIX 风格的 shell(例如通过 Cygwin 或 Mingw32),要么只是使用不同的命令,例如找出必要的包含标志是什么并使用它们:

g++ -I/some/path -fPIC -c some_script.cpp