By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

Extension loading. Is it inefficient?

P: n/a
I am using Windows IIS with PHP5 CGI. When I want to use an extension
in PHP5 under Windows I enable the extension line in PHP.INI. (e.g.
extension=php_sqlite.dll).

Does PHP load all the extensions in the PHP.INI on every invocation of
a request? If I have 20 different extensions not all of them are used
on every page request. Is this inefficient?

Would using dl() be more efficient? And why is it being depracated
under 5?

Thanks

Jun 25 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
ImOk wrote:
I am using Windows IIS with PHP5 CGI. When I want to use an extension
in PHP5 under Windows I enable the extension line in PHP.INI. (e.g.
extension=php_sqlite.dll).

Does PHP load all the extensions in the PHP.INI on every invocation of
a request? If I have 20 different extensions not all of them are used
on every page request. Is this inefficient?
Yes, if you're using CGI. DLL loading is quite fast on Windows though.
Only a small portion of the file is loaded into memory initially, with
the actual code brought in from disk only when it's used.

One thing that you might want to do is toss out all the longish
comments in php.ini. Parsing all that extra text probably has a larger
impact on performance.
Would using dl() be more efficient? And why is it being depracated
under 5?


Because dl() doesn't work in a multithreaded situation. While it's
possible to get it to work with various locking and reference counting
mechanism so that one thread doesn't unload the code used by another,
you end up just replicating the service provided by the OS.

Jun 25 '06 #2

P: n/a
Sorry for the many questions. I am trying to understand the best way to
have a setup under Windows.

Is there a way to make PHP cache pages under Windows. ? Would it matter
if I used Apache or IIS?

Thanks

Chung Leong wrote:
.................................
Yes, if you're using CGI. DLL loading is quite fast on Windows though.
Only a small portion of the file is loaded into memory initially, with
the actual code brought in from disk only when it's used.

One thing that you might want to do is toss out all the longish
comments in php.ini. Parsing all that extra text probably has a larger
impact on performance.
Would using dl() be more efficient? And why is it being depracated
under 5?


Because dl() doesn't work in a multithreaded situation. While it's
possible to get it to work with various locking and reference counting
mechanism so that one thread doesn't unload the code used by another,
you end up just replicating the service provided by the OS.


Jun 26 '06 #3

P: n/a
ImOk wrote:
Sorry for the many questions. I am trying to understand the best way to
have a setup under Windows.

Is there a way to make PHP cache pages under Windows. ? Would it matter
if I used Apache or IIS?

Thanks

Chung Leong wrote:
.................................
Yes, if you're using CGI. DLL loading is quite fast on Windows though.
Only a small portion of the file is loaded into memory initially, with
the actual code brought in from disk only when it's used.

One thing that you might want to do is toss out all the longish
comments in php.ini. Parsing all that extra text probably has a larger
impact on performance.

Would using dl() be more efficient? And why is it being depracated
under 5?


Because dl() doesn't work in a multithreaded situation. While it's
possible to get it to work with various locking and reference counting
mechanism so that one thread doesn't unload the code used by another,
you end up just replicating the service provided by the OS.



PHP doesn't cache pages - the browser (and potentially routers between the
server and the client) cache pages. The only way you *may* be able to affect
caching is with the expires html header - but that may be ignored.

But personally I think you're worrying about a problem which doesn't exist. A
webserver (even Windows) on any decently performing hardware should be able to
run hundreds of hits per second.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 26 '06 #4

P: n/a
ImOk wrote:
Sorry for the many questions. I am trying to understand the best way to
have a setup under Windows.

Is there a way to make PHP cache pages under Windows. ? Would it matter
if I used Apache or IIS?


Instead of CGI, try to set up PHP as a module. The online manual has
all the information you need. Personally I recommend Apache 2 over IIS,
simply because it doesn't do goofy stuff behind your back.

Jun 26 '06 #5

P: n/a
Jerry Stuckle wrote:
ImOk wrote:
Sorry for the many questions. I am trying to understand the best way to
have a setup under Windows.

Is there a way to make PHP cache pages under Windows. ? Would it matter
if I used Apache or IIS?

Thanks

Chung Leong wrote:
.................................
Yes, if you're using CGI. DLL loading is quite fast on Windows though.
Only a small portion of the file is loaded into memory initially, with
the actual code brought in from disk only when it's used.

One thing that you might want to do is toss out all the longish
comments in php.ini. Parsing all that extra text probably has a larger
impact on performance.
Would using dl() be more efficient? And why is it being depracated
under 5?

Because dl() doesn't work in a multithreaded situation. While it's
possible to get it to work with various locking and reference counting
mechanism so that one thread doesn't unload the code used by another,
you end up just replicating the service provided by the OS.



PHP doesn't cache pages - the browser (and potentially routers between the
server and the client) cache pages. The only way you *may* be able to affect
caching is with the expires html header - but that may be ignored.

But personally I think you're worrying about a problem which doesn't exist. A
webserver (even Windows) on any decently performing hardware should be able to
run hundreds of hits per second.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Expanding on Jerry and ImOk:
Windows heavily caches DLLs, so DLL loading will be a non-issue.

There are packages out there to cache PHP pages, MMCache was one i read
saw recently. It should be noted that some have problems depending on
os, server, php version, etc, and may lead to instability.

There are also PHP accelerators, which compile PHP source code into PHP
byte code, but again, those have some issues with certain packages and
constructs (iirc, __overload, to name one).

Jun 26 '06 #6

P: n/a
NC
ImOk wrote:

I am trying to understand the best way to
have a setup under Windows.
Take a look at Zend Optimizer:

http://www.zend.com/products/zend_optimizer
Would it matter if I used Apache or IIS?


If you use Zend Optimizer, no.

Cheers,
NC

Jun 26 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.