Help - Search - Members - Calendar
Full Version: OT: PHP question
914World.com > The 914 Forums > 914World Garage
SirAndy
ok, here's a silly PHP question ...

any given time (with traffic on the BBS) i see between 6 and 15 instances of PHP.EXE in the task manager. they all eat up memory and ressources ...

is there a way to tell PHP to run through the IIS-API ???
that should channel it all through 1 thread, right? same as it does with ASP or CGI ...

does PHP have the ability to run as a IIS extension? and if so, how do i configure it for that?
idea.gif Andy
double-a
i'm not sure i understand the question, could you throw out some additional acronyms please? biggrin.gif

~a
Trekkor
WYSIWYG? ohmy.gif

sorry... dry.gif
lapuwali
Why on earth are you running under Windows, anyway? You LIKE applying security patches every 10 minutes?

I'd expect the Windows version of PHP was a straight, least-effort port of the Unix code, which would mean that it was designed to run in Apache 1.3, which isn't multi-threaded. So, running N processes isn't going to help you much. Unless Windows is far more broken than I believe it to be, all of the code memory should be shared between the processes. Only data memory isn't shared, and much of that would NOT be shared even in a multi-threaded environment unless the PHP engine itself was coded to be multi-threaded (which it wasn't). The Windows version is also going to be a red-haired stepchild in the PHP universe. The main PHP guys like Lerdorf all target Linux and FreeBSD as their dev platforms (and the latter primarily because several of them work at Yahoo, and Yahoo is a FreeBSD shop).

So, in short, while I don't KNOW for certain you can't get there, I'm 99% certain you can't.
SirAndy
QUOTE (lapuwali @ Feb 13 2005, 10:08 PM)
Why on earth are you running under Windows, anyway?

alright, so you don't know the answer to my question ...

next!
fiid
Ignoring all the comments I am actually making under my breath about windows...

Are you running PHP as a CGI script?

SirAndy
QUOTE (fiid @ Feb 13 2005, 10:21 PM)
Ignoring all the comments I am actually making under my breath about windows...
Are you running PHP as a CGI script?

nope, PHP.exe is referenced in the ISAPI mappings to be run for all .php files.

it works fine, but PHP.EXE is by default not build as an extension to IIS, unlike the ASP.DLL that handles ASP pages.
it is running multiple instances of PHP.EXE instead of one task hooked directly into the web-servers API.

my question is simple:

is there a (DLL) extension for IIS that runs PHP as a real plugin?

that would make the server run faster, eating up much less CPU time and ressources ...

and thanks for keeping your unix vs. windows bullshit to yourself.
i'm sooo tired of hearing that crap from people who don't know anything about both worlds ...
dry.gif Andy
McMark
AmigaOS FOREVER!!!! wink.gif
SirAndy
QUOTE (McMark @ Feb 13 2005, 10:34 PM)
AmigaOS FOREVER!!!! wink.gif

haha, did my first *real* game on a amiga.

sprite collision detection on a per pixel base rocks!
you even got your own interrupt for that type of collision ... aktion035.gif


oh, and btw. the C64 had that feature as well. still, the amiga was sooooo cool and i was soooo young ...
boldblue.gif Andy
fiid
I don't know what version of IIS you are running, but I think this is what you want:

http://www.peterguy.com/php/install_IIS6.html

Are you currently using the php5isapi.dll plugin? I think that's what you need.

SirAndy
QUOTE (fiid @ Feb 13 2005, 10:43 PM)
Are you currently using the php5isapi.dll plugin? I think that's what you need.

aha! no, as i said earlier, i'm just running php.exe, which is the default install.

but i knew that there had to be a better way!
aktion035.gif Andy
fiid
QUOTE
i'm sooo tired of hearing that crap from people who don't know anything about both worlds ...


Thanks for the faith. I've done plenty of work on windows, linux (redhat, debian, fedora and others), solaris, macos, hpux, freebsd and netbsd to be able to comment.






lapuwali
Doing a Google for PHP IIS also found several hits on installing a PHP4 DLL for IIS, in case you don't want to move to PHP5, yet.

(and I'm sooo sick of hearing people tell me I don't know about "both worlds" when I recommend against Windows...cause I spent far too much time admin'ing a Windows shop)
vortrex
why are you running windows?
SirAndy
i'm a computer guy, i work with all of them. whatever you have, put it in front of me and i'll make it work.

do i have personal preferences? sure. but not for one OS in particular. it depends on the intended use of the system.
want a high end gaming workstation? get a PC.
want a graphic/video workstation? get a MAC.
want a tricked out FTP server? get a linux box.

in my view, most of peoples frustration with windows is due to the lack of knowledge.
which is actually true for most of the frustration on *all* operating systems.
the lack is usually with the user, not the machine ...

i have run windows servers for years straight with only 1 or 2 harddrives burn up.
i have run linux servers for years straight with only 1 or 2 harddrives burn up.

what really pisses me off are stupid comments like "i don't know the answer to your question but you really should switch over to linux. it'll solve all your problems" ...
bs.gif

the server is running fine. php works under windows. mysql works under windows. cgi works under windows.
i was looking for a way to optimize the php performance and fiid pointed me in the right direction.
i don't need any of this "my computer is soooo much better than your computer" crap. leave it at home ...


i'm tired,
wacko.gif Andy
SirAndy
QUOTE (lapuwali @ Feb 14 2005, 09:13 AM)
Doing a Google for PHP IIS also found several hits on installing a PHP4 DLL for IIS, in case you don't want to move to PHP5, yet.

yeah, but without me asking the right question, would you even have known what to search for?

i think not ...
SirAndy
QUOTE (vortrex @ Feb 14 2005, 09:47 AM)
why are you running windows?

poke.gif


biggrin.gif
lapuwali
QUOTE (SirAndy @ Feb 14 2005, 09:52 AM)
QUOTE (lapuwali @ Feb 14 2005, 09:13 AM)
Doing a Google for PHP IIS also found several hits on installing a PHP4 DLL for IIS, in case you don't want to move to PHP5, yet.

yeah, but without me asking the right question, would you even have known what to search for?

i think not ...

So, why didn't you just Google yourself and save yourself all of this "why windows?" grief? biggrin.gif

In any case, good luck, but I still think you're not going to see a huge decrease in memory usage by switching to the DLL version, unless my understanding of PHP internals is drastically wrong. PHP doesn't play well with Apache 2.0, either (as in it isn't a full multi-threaded all-resources-shared thing, but just a PHP interpreter per thread), so it's not an IIS or Windows problem, but a PHP problem.
ThinAir
I'm a Windows system admin who is trying to find time to work on his MCSE and has a lot of interest in Linux, so there is a lot I don't know. I'm just curious about the criteria for deciding which OS in the beginning. I ask because my non-profit can't afford to stay on Windows for the long run and I've been eyeing Linux, but the bottom line is that there is a job to get done and that overrides any "theoretical advantage" for one OS over another.
SirAndy
QUOTE (ErnieDV @ Feb 14 2005, 08:59 PM)
I ask because my non-profit can't afford to stay on Windows for the long run

it entirely depends on what your non-profit wants to do with it ...

workstations? servers? what software needs do you have?
idea.gif Andy
ThinAir
This is for servers. We host the web site with an external ISP. Besides file & print services, internally I'm running Exchange 5.5 and need to be able to move to a "webmail" setup so that folks without regular workstatons can get email and calendar, plus those who travel need to be able to get to their mail so I need to set up something secure with a DMZ. Most of the servers for the webmail setup will be dual processor Pentium II systems. I've got a couple of software products that have to run on Windows servers so Windows wouldn't completely go away. The issue for me is that I won't have any funds for at least a year for new Windows licenses or for Exchange 2003 Enterprise Edition (which is needed for for newer versions of Outlook Web Access).
lapuwali
QUOTE (ErnieDV @ Feb 14 2005, 10:23 PM)
This is for servers. We host the web site with an external ISP. Besides file & print services, internally I'm running Exchange 5.5 and need to be able to move to a "webmail" setup so that folks without regular workstatons can get email and calendar, plus those who travel need to be able to get to their mail so I need to set up something secure with a DMZ. Most of the servers for the webmail setup will be dual processor Pentium II systems. I've got a couple of software products that have to run on Windows servers so Windows wouldn't completely go away. The issue for me is that I won't have any funds for at least a year for new Windows licenses or for Exchange 2003 Enterprise Edition (which is needed for for newer versions of Outlook Web Access).

Go with Windows front to back. Trying to mix systems increases the headaches, and just isn't worth it for a small shop. Trying to get Linux based mail systems to operate with Windows desktops is possible, but far from turn-key. As for the licensing issue, just keep adding as much memory as you can to the servers you have, and keep piling the stuff on. One cannot get fast AND cheap, so you're going for slow and cheap until you can afford fast. IMHO, it will ultimately cost more in time and labor to get a Linux-based email system for Windows working than it would to buy another Windows license. This really sucks, in my opinion, but there it is. There are some efforts in the Linux world to provide enough of Exchange to make Outlook happy, but as far as I know, none of it works 100%, yet.

One very cheap solution that might work for you w/o Exchance upgrades is simply to use some of the free or semi-free infrastructure available from places like Yahoo and Google for web-based email, calendaring, etc. Yahoo offers email using your domain for some small fee (like $35/year per account), and I presume Gmail and others do this, too. (Full disclosure: I work for Yahoo). This is hardly secure (depends on how much you trust the vendor), but it can't be beat for ease of setup and maintenance.



SirAndy
QUOTE (lapuwali @ Feb 15 2005, 07:36 AM)
As for the licensing issue

also (and i'm not supposed to tell you this) the License Loggin Service can be disabled ! wink.gif

that will buy you some time ...
cool.gif Andy

fiid
I am a little confused as to why we switched to linux and then back to windows, I have to say. Clearly we have switched back to windows so theres clearly nothing I can do to help or influence the situation. I object to being preemptively given shit for "windows bashing" when I am not actually guilty of it (this time). I thought that sort of behviour was reserved members of certain political parties.
fiid
Did you get the DLL going in the end, btw?
Rockaria
QUOTE (SirAndy @ Feb 15 2005, 11:43 AM)

also (and i'm not supposed to tell you this) the License Loggin Service can be disabled ! ...

Andy! You forgot to ask for the secret brotherhood of Windows Server Administrators Handshake first! cool_shades.gif
SirAndy
QUOTE (fiid @ Feb 15 2005, 09:55 AM)
Did you get the DLL going in the end, btw?

no time yet. i actually have a day-job ...

biggrin.gif Andy
SirAndy
QUOTE (fiid @ Feb 15 2005, 09:55 AM)
I thought that sort of behviour was reserved members of certain political parties.

first of all, dude, re-read my post! i wasn't even talking about you!

initially this BBS was run off one of my company production eComm servers. there was a conflict between the mySql (required by this BBS software) and the MS-SQL required by the eComm website. it would frequently crash the server and that's not very good for my biz.

so we went to a separate box just for this BBS that ran linux. that worked well for a while until we got so much traffic/users that the box was finally running at 90%-100% CPU load *constantly*. remember how slow the BBS was back then ???

at the time, i had a spare compaq DL380 sitting in my office collecting dust so i put some RAM in there (4 GB), 2 CPUs, added a few HDs (running raid) and windows 2000 Server.
that's what we're running today and besides the HD burn-up last week, the server hasn't had a single problem since i fired it up ...



now, what i would like to do when i get the time is to improve the performance of this BBS software, PHP and mySql as it seems that those 3 are the biggest bottleneck ...

any objections?
huh.gif Andy
fiid
QUOTE (SirAndy @ Feb 15 2005, 10:32 AM)
QUOTE (fiid @ Feb 15 2005, 09:55 AM)
I thought that sort of behviour was reserved members of certain political parties.

first of all, dude, re-read my post! i wasn't even talking about you!

sorry. bit overtired and overworked here too. (screaming baby doesn't help that much)

I think the main gain with php will be going to an in-process model - using the dll.

It might be worth looking at moving the db off onto another box too, and perhaps adding some caching to the php code. One advantage of getting the db off to another box is you could use two frontline webservers with a load balancer to divide the php load. (there are freeware solutions to the loadbalancing problem).

Anyways all stuff to think about. I'm happy to help if that's useful.



ThinAir
QUOTE (SirAndy @ Feb 15 2005, 10:43 AM)
QUOTE (lapuwali @ Feb 15 2005, 07:36 AM)
As for the licensing issue

also (and i'm not supposed to tell you this) the License Loggin Service can be disabled ! wink.gif

that will buy you some time ...
cool.gif Andy

Yup - I'm already there. There's still the ethical issue of paying for what you use, which is why I eventually want to ensure that I'm legal with whatever I'm using. In the meantime, I don't mind "borrowing". Unfortunately, that only takes care of my server OS needs. I don't have a way around getting Exchange 2003 Enterprise Edition.

I just want to say a big thank you to all for being willing to give me some advice on this. Sys Admins are always a busy bunch and there is never enough time to do things so for you all to take the time for this is really appreciated! pray.gif
Tom Perso
I monitor and administer close to 200 Windows 2000/2003 servers. Some of these boxes have been running out in the field for almost 4 years. Yes, there have been hardware failures and due to failed UPS's - some DC screw-ups (disjoin from the domain, add to a junk forest, disjoin again and rejoin to the real domain).

But, I can't see where Windoze is all that bad. Everything has it's pitfalls. I'm a Linux guy too since I support the free software thing...

Plus, we run all Compaq/HP servers, since I'm in the NOC and I monitor all of our servers, we get the beefy ones. Our main SQL server is a HP DL740 with quad (and HT'd) 3.0's, 4 gb RAM, and a MSA 1000 SAN with RAID 10 and 300gb.

Plus, I get to administer an EMC Symmetrix SAN array with 14 terabytes. Now, THAT is cool... wink.gif

Anyways, great job Andy for keeping this strange place up and running so these junkies (me included) can come and play...

Later,
Tom
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.