Giter Club home page Giter Club logo

Comments (9)

jingjingxyk avatar jingjingxyk commented on May 20, 2024

关键就是修改这个文件 https://github.com/crazywhalecc/static-php-cli/blob/main/config/ext.json

修改 lib-depends 项 或者 lib-suggests 项

例子:

    "gd": {
        "type": "builtin",
        "arg-type": "custom",
        "arg-type-windows": "with",
        "lib-depends": [
            "zlib",
            "libpng"
        ],
        "ext-depends": [
            "zlib"
        ],
        "lib-suggests": [
            "libavif",
            "libwebp",
            "libjpeg",
            "freetype"
        ]
    },

from static-php-cli.

Endy-c avatar Endy-c commented on May 20, 2024

我指的是这样的编译选项:CFLAGS='' CC='x86_64-linux-musl-gcc -static -idirafter /software/spc/buildroot/include -idirafter /usr/include/ -idirafter /usr/include/x86_64-linux-gnu/ ' ./Configure no-shared zlib --prefix=/ --libdir=lib -static --with-zlib-include=/software/spc/buildroot/include --with-zlib-lib=/software/spc/buildroot/lib no-legacy linux-x86_64

from static-php-cli.

Endy-c avatar Endy-c commented on May 20, 2024

[15:27:06] [INFO] enabling gd without library libavif
[15:27:06] [INFO] enabling gd without library libwebp
[15:27:06] [INFO] enabling gd without library libjpeg
[15:27:06] [INFO] enabling gd without library freetype
指定了--with-libs=libwebp,但enable-gd的时候仍然是without library libwebp
这个编译选项没有找到在什么地方修改

from static-php-cli.

crazywhalecc avatar crazywhalecc commented on May 20, 2024

指定了--with-libs=libwebp,但enable-gd的时候仍然是without library libwebp

只要编译 gd 扩展时包含了 --with-libs=libwebp,就会启用 webp 支持。我刚才试了下是这样的。不过你上面提到的 log 中显示 without library libwebp 确实是个问题,但仅限于显示,后面我会修复显示问题。

from static-php-cli.

Endy-c avatar Endy-c commented on May 20, 2024

指定了--with-libs=libwebp,但enable-gd的时候仍然是without library libwebp

只要编译 gd 扩展时包含了 --with-libs=libwebp,就会启用 webp 支持。我刚才试了下是这样的。不过你上面提到的 log 中显示 without library libwebp 确实是个问题,但仅限于显示,后面我会修复显示问题。

我检查了日志里面EXEC里的./configure,编译选项里的确没有--with-webp,但是编出来的cli文件的确-i里有webp,很奇怪。另外把configure命令重新到php-src里执行,不能检测通过libevent_core

checking PHP version... PHP 8.x
checking for include/event2/event.h... found in /software/spc/buildroot
checking for libevent version... ok
checking for event_free in -levent_core... no
configure: error: event_free not found in event_core library, or the library is not installed

from static-php-cli.

Endy-c avatar Endy-c commented on May 20, 2024

指定了--with-libs=libwebp,但enable-gd的时候仍然是without library libwebp

只要编译 gd 扩展时包含了 --with-libs=libwebp,就会启用 webp 支持。我刚才试了下是这样的。不过你上面提到的 log 中显示 without library libwebp 确实是个问题,但仅限于显示,后面我会修复显示问题。

我检查了日志里面EXEC里的./configure,编译选项里的确没有--with-webp,但是编出来的cli文件的确-i里有webp,很奇怪。另外把configure命令重新到php-src里执行,不能检测通过libevent_core

checking PHP version... PHP 8.x
checking for include/event2/event.h... found in /software/spc/buildroot
checking for libevent version... ok
checking for event_free in -levent_core... no
configure: error: event_free not found in event_core library, or the library is not installed

这个问题解决了,原因是putenv设置的环境变量没有用export等效设置到shell当中。
现在在shell下靠手动加了--with-webp编译选项,额外添加了libwebp.a lib libsharpyuv.a,成功编译了自己需要的静态cli和fpm。但是对项目结构还不熟悉,不知道在什么地方修改,没法提PR

from static-php-cli.

crazywhalecc avatar crazywhalecc commented on May 20, 2024

我刚才试了下这个 log 提示的问题,似乎最新的分支没有这个问题。而且目前除了还没有关闭的几个 Issue 涉及的扩展外,其他扩展应该都可以正常使用,不需要修改任何代码。

image

from static-php-cli.

Endy-c avatar Endy-c commented on May 20, 2024

from static-php-cli.

crazywhalecc avatar crazywhalecc commented on May 20, 2024

试了很多次 spc 二进制,似乎也都没有你提到的问题。

另外,关于这个 Issue 的标题,你可以参考刚才提交的对于 uv 扩展的支持和 redis 额外特性的支持修改了哪些文件,这是典型的扩展和依赖库添加的改动。#296 #295

from static-php-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.