FFI is pain in the butt #143
Replies: 1 comment 6 replies
-
Hi @alexNecroJack, Thanks for trying php-vips 2.x! I'm sorry it didn't work out. I think the whole of pecl and pear is on life support. There was talk of removing all of it for php 8, but somehow it has lingered on. It's poorly maintained, and things like Windows support just aren't there. The php-vips-ext extension was annoying to maintain, and caused users a lot of trouble. I hoped php-ffi would fix all these problems: it should be installed for users (so we wouldn't have to do that), should work everywhere (even on windows!), and it would mean we could write the whole of php-vips in pure PHP. I would expect it to be slightly slower, but only very slightly. I think your PHP is probably built with ffi (it's the default). Maybe it just needs enabling? Do you use docker? Can you share a dockerfile that would help me understand your platform? I have some samples here: |
Beta Was this translation helpful? Give feedback.
-
Hello.
We are a small web development company and we decided to use LibVIPS and PHP Vips upon reading about it's famed performance.
We run on CloudLinux 7.9 (Boris Yegorov).
We have a WHM with EasyAppache4 installed, available software to install PECL and PEAR packages with one click,
MultiPHP ini editor, etc
We have installed LibVIPS, PHPVIPS(2.x), and were struggling, yes struggling, to make FFI play...
FFI is indeed a record in our phpinfo, but it only reports the creators, nothing more.
As php manual page informs,
Now, all the versions of PHP we can get is from EasyAppache4,
and they don't seem to be configured "--with-ffi"...
Also searching on "building PHP", I found it seems a rather abstract procedure, I didn't find very specific instructions,
with a quick search it seems that this process for a newcomer on building phps from source has a long learning time.
I can see of course how it makes the work of the one implementing the library easier and quicker,
but on the other hand, for anyone not having a PHP preconfigured with "--with-ffi", this is a dead-end.
Another concern is the one stated at a site, that with a c extension the performance is way better than using ffi...
Therefore I wander if it truly is a better option to use FFI, than a c extension.
If you still believe it's a good option (it doesn't concern me, or our company, it's your choice and understanding),
we would be grateful if you could suggest another way around.
Currently we changed our plan to switch back to PHP VIPS 1.x with the ext, hoping nothing will go wrong, we lost some tome already trying to make the project with libvips work..
Any kind of suggestion,
from page with instructions on building php 8 an easy way (without needing to rebuild appache),
or at least instructions in a more specific way on building php,
to instructions on how or where to actually find a php version prebuilt "--with-ffi" for our O.S.
(in order for us to throw it at the folders inside WHM),
would be greatly appreciated.
Thank you for your work,
it would be good for our company to actually reach the point to verify those performance tests :)
Have a good day.
Beta Was this translation helpful? Give feedback.
All reactions