Giter VIP home page Giter VIP logo

Comments (11)

crazywhalecc avatar crazywhalecc commented on June 1, 2024 1

When I try to run ./spc build ffi,mbstring,sodium --build-micro -I "ffi.enable=true" I get the following error:

  • Download all sources command (with different PHP version): ./spc download --all --with-php=8.3
  • Download sources for extensions and dependencies: ./spc download --for-extensions=ffi,mbstring,sodium

I tried to use the GitHub Actions built micro, but I get the following error when trying to execute:

Now Linux is purely statically compiled, and it cannot support methods such as ffi/dl and other dynamic linking methods for other libraries. If you are using macOS micro, you can use ffi and dl.

By the way, Linux can actually support standalone PHP binary that are not fully statically linked and can use ffi/dl, but currently the main branch does not provide an option (because of glibc).

I assume it's because ffi.enable needs to be true instead of preload

The -I parameter to specify the required ini config when compiling or combining micro.sfx. (Docs)

I tryied cloning the repository into source folder

I just noticed this problem too. It seems that the freedesktop.org website is down. I have copied a previous source code archive to dl.static-php.dev, I'm working on #64 right now and will merge it soon, which contains the address to modify the pkgconfig download.

If you need to compile now, you can use ./spc download --all -U pkg-config:https://dl.static-php.dev/static-php-cli/deps/pkg-config/pkg-config-0.29.2.tar.gz command to temporarily replace the download link of pkgconfig.

from static-php-cli.

crazywhalecc avatar crazywhalecc commented on June 1, 2024 1

The documentation will be updated. static-php/static-php-cli-docs#7

from static-php-cli.

CViniciusSDias avatar CViniciusSDias commented on June 1, 2024

Now Linux is purely statically compiled, and it cannot support methods such as ffi/dl and other dynamic linking methods for other libraries. If you are using macOS micro, you can use ffi and dl.

I don't think I understood this correctly.

If I can't correctly use FFI, should it be "yes" here?

from static-php-cli.

CViniciusSDias avatar CViniciusSDias commented on June 1, 2024

I was able to build and create the standalone file, but I got into the FFI error you mentioned:

Fatal error: Uncaught FFI\Exception: Failed loading 'libtcl8.6.so' (Dynamic loading not supported)

Is there a way around it? 😳

from static-php-cli.

crazywhalecc avatar crazywhalecc commented on June 1, 2024

If I can't correctly use FFI, should it be "yes" here?

You didn't mention what type of operating system you are using (Linux or macOS), so I explained the different features of different systems.

To put it simply, currently only static-php under macOS can use ffi/dl, and Linux cannot.

from static-php-cli.

CViniciusSDias avatar CViniciusSDias commented on June 1, 2024

You didn't mention what type of operating system you are using

I'm sorry. It's Linux.

To put it simply, currently only static-php under macOS can use ffi/dl, and Linux cannot.

So this should say "no" on the ffi line for Linux column, right?

from static-php-cli.

crazywhalecc avatar crazywhalecc commented on June 1, 2024

So this should say "no" on the ffi line for Linux column, right?

For linux, no.

from static-php-cli.

CViniciusSDias avatar CViniciusSDias commented on June 1, 2024

For linux, no.

"no" as in it should not say "no"? Even though you just mentioned it doesn't work? 🤔

from static-php-cli.

crazywhalecc avatar crazywhalecc commented on June 1, 2024

"no" as in it should not say "no"? Even though you just mentioned it doesn't work? 🤔

With the current main branch and project structure, we cannot directly build a php that can use ffi. So for your requirement it is no.

It is possible to use ffi on Linux, but it will not be considered at this time.

from static-php-cli.

CViniciusSDias avatar CViniciusSDias commented on June 1, 2024

That's my point: The doc should say that FFI for Linux isn't supported, right?

from static-php-cli.

crazywhalecc avatar crazywhalecc commented on June 1, 2024

To be precise, it doesn't work, but it can be supported. Because ffi itself can be compiled inline into PHP, it means that it is supported, but it is another matter that it cannot be used. This has something to do with the limitations of the Linux kernel and has nothing to do with PHP.

But you're right, I shouldn't describe linux ffi as yes without any comments inside the documentation.

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.