[PHP] Re: PHP Extensions as Shared Objects?

2008-06-02 Thread Colin Guthrie

mike wrote:

On 5/29/08, Weston C [EMAIL PROTECTED] wrote:


Fortunately, I'll have full control of the hosting environment in the
context this matters. :)

dl is  definitely interesting, but I'm worried that runtime invocation
might mean performance hits. Is there a way to do load/startup time
inclusion?


you could put it in your php ini file

extension = foo.so

then I believe the impact will be on the first instance for that php
engine. so in fastcgi mode, you'd only have the hit once every
PHP_FCGI_MAX_REQUESTS when the child restarts...



Have a look at a standard Mandriva or Fedora/CentOS PHP install. You'll 
see that the various parts of the PHP engine are all very modular with 
several PECL modules pre-built for your convenience.


The php.ini file is split into files in /etc/php.d/*.ini so that the 
packages can put their own little config systems into the php.ini file 
without dicking around with automated editing.


When using PHP as a module the impact is pretty low, only once per 
restart. As Mike wrote the low impact is also apparent in FCGI mode too 
(but it's a bit more obvious where the extra load it creates is manifested).


Personally, the convenience of modularity sells this approach for me. I 
do generally roll my own RPMs to keep things up to day and patched, but 
again I just use that format/deployment method as it's convenient.


Col


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: php extensions

2001-09-21 Thread Richard Lynch

I think you need to create a .so file, not .o and .la...

There are some sample screen shots at http://conf.php.net in Rasmus' more
recent talks

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: CristóVãO Dalla Costa [EMAIL PROTECTED]
Newsgroups: php.general
To: [EMAIL PROTECTED]
Sent: Thursday, September 20, 2001 12:06 AM
Subject: php extensions


 I'm trying to create an extension to PHP to provide an access interface to
 the proprietary database server my company uses. However, I cannot seem to
 suceed even at the simplest module, the one provided by ext_skel. I run
 buildconf, configure and compile the module, however dl() won't load the
 resulting .o, libmodule.la saying the file format is invalid. If I
manually
 link the object file to a shared library, dl() will tell me the library is
 invalid.

 So I'm stuck. If someone could help me that would be gratly appreciated.
I'm
 using FreeBSD 4.3 and the (patched) PHP sources from the ports tree.

 Thanks.

 Cristovao Dalla Costa




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]