Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 211536 - dev-lang/php extend ebuild to include embed SAPI
Summary: dev-lang/php extend ebuild to include embed SAPI
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Lowest enhancement with 2 votes (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 264727 274512
  Show dependency tree
 
Reported: 2008-02-26 16:23 UTC by Darko Luketic
Modified: 2010-06-08 22:18 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Quick hack for embed USE flag (php-5.2.8-r2.ebuild-with-embed.diff,3.92 KB, patch)
2009-01-18 13:08 UTC, Anna Gabutero
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darko Luketic 2008-02-26 16:23:20 UTC
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
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2008-02-26 16:42:46 UTC
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?
Comment 2 Darko Luketic 2008-02-26 19:50:09 UTC
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.
Comment 3 Christian Hoffmann (RETIRED) gentoo-dev 2008-02-27 20:53:32 UTC
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. =)
Comment 4 Darko Luketic 2008-02-29 10:34:28 UTC
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.
Comment 5 Jens Maier 2009-01-12 13:31:40 UTC
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. :-)
Comment 6 Ala'a Ibrahim 2009-01-17 15:05:22 UTC
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
Comment 7 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2009-01-17 22:09:44 UTC
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.
Comment 8 Anna Gabutero 2009-01-18 13:08:11 UTC
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.
Comment 9 Luke-Jr 2009-06-28 03:33:00 UTC
I also would like to use PHP::Interpreter for a program. :/
Comment 10 Mark David Dumlao 2009-08-06 20:07:44 UTC
Count me in. I seem to need this also for the PHP::Interpreter module.
Comment 11 Christian Hoffmann (RETIRED) gentoo-dev 2009-12-17 16:35:03 UTC
Will be in >=php-5.3.1.
Comment 12 Darko Luketic 2009-12-18 15:06:35 UTC
(In reply to comment #11)
> Will be in >=php-5.3.1.
> 

Nice, tyvm.
Comment 13 Matti Bickel (RETIRED) gentoo-dev 2010-06-08 22:18:28 UTC
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.