473,395 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 1577
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.