this is a plead to extend the dev-lang/php package to make use of the embed SAPI currently only cli , cgi and apache2 SAPI is supported the ./configure options are as follows: shared object --enable-embed static object --enable-embed=static after installation symlink to lib dir additional USE-Flags ? embed embedstatic | embedsapi embedsapistatic produces libphp5.so (or 4 for that matter) or libphp5.a Reproducible: Always Steps to Reproduce: emerge dev-lang/php Actual Results: * Enabled SAPI: cli * Enabled SAPI: cgi * Disabled SAPI: apache2 no option to enable the embed SAPI Expected Results: * Enabled SAPI: cli * Enabled SAPI: cgi * Disabled SAPI: apache2 * Enabled SAPI: embed If would submit an ebuild if i knew anything about writing ebuilds
I don't see absolutely any interest for this among users, the less among maintainers. I'd definitely rather not complicate things even further and this one is rather intrusive. Use EXTRA_ECONF="--enable-embed=foo" or whatnot if you want this. hoffie?
i see to understand why EXTRA_ECONF="--enable-embed=foo" wouldn't be adequate you would need to understand how php is built up. afaik the current state of the php ebuild compiles php once each time for each SAPI used. The process of compiling the embed SAPI is about the same as for cli. stuff could be just copy/pasted and edited. i don't know about the documentation/bureaucratic effort or the changes in the underlying python library code. Also, if you don't see absolutely any interest among users, perhaps thats because not many even know it exists or that is it possible to integrate php into c/c++ programs. Has gentoo become a mainstream distribution now? What about www-apps/Embperl? Thats the same just for perl instead of php and thats in portage. I bet if more people knew about this more people would also make use of it. But if it's too much effort, fine i won't do it because it would take me far too long to learn the ebuild system whereas you already know about it and know how much effort it would be. Well if it doesn't make it in this version perhaps you could consider adding it in PHP6.
I didn't even know there is a generic embed SAPI (I do know that there are several other mod_php things similar to apache2, but mostly for web servers which we don't even ship). I have no objections to adding it if users want it, but it's certainly not a high-priority thing. I'll have a look at it once I have time... BTW, according to configure this is still considered 'EXPERIMENTAL', so defering this one a bit certainly doesn't hurt. =)
Thank you hoffie :) sure take your time. yes i agree it's quite low priority for the reasons you wrote. There is also close to no documentation about it, except a book called "Extending And Embedding PHP" from 2006. http://www.zend.com/php/internals/ had a reference online which sadly is no longer available, and the online php manual states that it's on the todo list.
This enhancement proposal seems to have been all but forgotten. Unfortunately for me, this means that I have to fiddle with the ebuild myself in order to get the PHP::Interpreter perl module to work. Getting support the PHP embed SAPI with the official ebuild instead would be much appreciated. :-)
Hi, I tried to put it using $ EXTRA_ECONF=" --enable-embed " && emerge -av php but it didn't work issuing $ php -i | grep "Configure Command" it didn't show in the configure command :( is there other way to do it, as I need it for the phpembed (http://developers.facebook.com/phpembed/) package. Thank you
hoffie: It did used to be included in the much older PHP4 eclasses way back in the sands of time (during an earlier incarnation of the embed SAPI). Add it, there shouldn't be any problems with it.
Created attachment 178878 [details, diff] Quick hack for embed USE flag This is a diff against php-5.2.8-r2.ebuild to add the embed USE flag. It's a quick hack missing several things like static embed libraries, something about MySQL charset detection, and I'm sure many other things I've missed, but I have successfully used it to build phc (http://www.phpcompiler.org). I would also prefer to have support for this in the official ebuild, but in the meantime this works for me.
I also would like to use PHP::Interpreter for a program. :/
Count me in. I seem to need this also for the PHP::Interpreter module.
Will be in >=php-5.3.1.
(In reply to comment #11) > Will be in >=php-5.3.1. > Nice, tyvm.
Now in php-5.3.2 on a mirror near you. Note I usually don't test with USE="embed", so beware of sharp edges. Please report any issues you find.