472,973 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,973 software developers and data experts.

Extension loading. Is it inefficient?

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
6 1555
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: phpnube | last post by:
I used this php package to install on my system... PHP 5.0.0 installer - 26 July 2004 (CGI only, packaged as Windows installer to install and configure PHP, and automatically configure IIS, PWS...
2
by: luiscasanova | last post by:
Hello, I'vre written an extension module to accelarate some code i've made in python with numarray. Then i compiled an linke d it with swig, my problem is that when i make the import in my...
1
by: Andy G | last post by:
I hate to post just a general error like this but one of my clients that coded this system is getting an error when loading a page. I know that you can't point out the specific problem so forget...
1
by: snapcount | last post by:
Hi, I need some help with this. I've enabled php_gd2.dll and php_mbstring.dll in the php.ini file and they're loading ok but the php_mysql.dll is not getting loaded. Apache's error.log reports:...
1
by: tyler | last post by:
I've written a small python extension but I'm having difficulty loading it at runtime. The source for my extension is a module which is a member of a package is organized as follows. ...
1
by: Jarle Aase | last post by:
Hi, I wrote a multilanguage cms system a few years ago. Different languages are handled by loading php-files where each language-specific string is assigned to a normal php-variable ($LNG...
15
by: pdhb_1 | last post by:
I'm trying to run Apache2.2.6 with php. However, I keep getting a long list of error messages in the log file indicating that includes are failing. For example, "PHP Warning: PHP Startup:...
5
by: malkarouri | last post by:
Hi everyone, Is it possible to write a Python extension that uses the Boehm garbage collector? I have a C library written that makes use of boehm-gc for memory management. To use that, I have...
5
by: Chuck Anderson | last post by:
I run Apache 2.0.55, and Php (both 4.4.1 and 5.2.5) on my home PC (Windows XP). One of the scripts that I run daily needs to access a secure URL (https://..............). When I am running Php4,...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.