PHP 5 Beta 1 398
Sterling Hughes writes "The PHP development community is proud to announce the release of PHP 5 Beta 1. Downloads are available in both source and binary form (for Windows users). A full list of changes is available in the ChangeLog. Some of the new features include much improved OO support, completely revamped XML support, and the default inclusion of SQLite."
They pulled MySQL out! (Score:5, Interesting)
Re:They pulled MySQL out! (Score:5, Informative)
Check this thread [google.com] on Google groups.
Re:They pulled MySQL out! (Score:5, Insightful)
Re:They pulled MySQL out! (Score:2, Informative)
In FreeBSD Ports, it compiled the MySQL client package and uses it instead.
Re:They pulled MySQL out! (Score:3, Interesting)
The thread mentions somebody at mysql is working on a exception to their license to all PHP to continue to bundle the mysql library extension or whatever. I would hope it gets resolved by the final PHP5 and even if not, most distros like Redhat will probably have the RPMs set so this isnt an issue anyways.
Pining for the Fjords! (Score:3, Funny)
Re:They pulled MySQL out! (Score:3, Informative)
maybe this will get them to included a bundled version of postgres
But how? (Score:3, Insightful)
what's so difficult about using your own mysql installation?
How do I tell binary PHP to use the installed binary MySQL?
Please read this comment [slashdot.org] before replying with such an answer along the lines of "compile it yourself".
Re: Just use ODBC (Score:3, Insightful)
Problem solved.
Its better software engineering wise to use layer with ODBC or something similiar to access your database. Changes to your database will not require whole rewrites. Also you can host the database on a different server other then your web one.
I consider myself an amuture database programmer so feel free to correct me if I am wrong regarding something like ODBC to connect to a remote server. I think Oracle has some proprietary
Re: Just use PEAR/DB (Score:5, Informative)
I've been using PHP's built-in (until now) MySQL functions, because they're faster than pear/db, but this licensing dust-up has convinced me that portability among database vendors is worth a performance hit. And the pear/db module is getting increasing attention and is likely to get faster.
Improved OO! (Score:4, Funny)
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];slee p rand(2)if/\S/;print }
Turning into Java? (Score:5, Interesting)
Re:Turning into Java? (Score:2)
Re:Turning into Java? (Score:2)
Re:Turning into Java? (Score:3, Insightful)
Re:Turning into Java? (Score:2)
final, etc.
Re:Turning into Java? (Score:2, Interesting)
Re:Turning into Java? (Score:2, Interesting)
Re:Turning into Java? (Score:2)
Problems with newer versions (Score:5, Insightful)
The PHP people need to provide ways that people can upgrade the versions of PHP on their system such that they can be reasonably sure that existing users aren't suddenly going to find their sites don't work.
Re:Problems with newer versions (Score:3, Insightful)
There's no problem running different versions of php on the same webserver. We're running php 3 and php 4 here, without any problems.
Re:Problems with newer versions (Score:2)
Re:Problems with newer versions (Score:5, Informative)
If you're doing a non-trivial php site, and trying to make it work with different versions of php (osCommerce [sourceforge.net], for example), you end up having to rewrite many functions yourself to make sure they work consistently.
I like PHP, but it suffers from an "incrementalism" design approach. Some stuff really needs to be rethought, and I think PHP 5 is on the right track to doing that.
Re:Problems with newer versions (Score:5, Insightful)
Someone involved in PHP needs to take a cold hard look at this issue and figure out how to tackle it head-on, or they will find that with each new version, people take longer and longer to take advantage of new features which will cause PHP to stagnate.
With Java, at least I know for a fact that some Java 1.1 code will work with Java 1.4 and as a result most ISPs keep their Java versions quite up-to-date.
Until the PHP team treat lack of backward compatability as a bug, this problem will persist.
Re:Problems with newer versions (Score:2)
php422.cgi php433RC1.cgi php500B.cgi
you get the idea
Kinda kludgey (Score:3, Informative)
If there was some way that you could allow the user to have multiple PHP versions all being used as Apache modules where the user could select the one they want using their .htaccess file, that would be a possible solution.
Of course, the real solution is for the PHP development team to take the issue of backward-compatability more seriously then they clearly do at the moment.
Re:Kinda kludgey (Score:4, Insightful)
To my knowledge this is easily doable, and often done. Although I've never properly looked into it (I keep as far away as possible from virtual hosted environments where this would make sense), I believe the idea would be to compile apache modules for each different version of php you wanted to support, LoadModule each one in in your httpd.conf, then bind each one to a specific file extension (.php3,
Re:Problems with newer versions (Score:3, Informative)
Both PHP and ASP are compiled and linked directly to the webserver daemon. CGI uses an interface and the engine is not loaded directly with the web server. This makes it alot slower and you lose all the benefits of what php has to offer.
Re:Problems with newer versions (Score:5, Interesting)
To the best of my recollection, there isn't much else that's not backwards-compatible. Even where functions have been renamed (e.g. socket_get_status), the old function names still work, and while deprecated, they don't seem to be going anywhere soon. I have no trouble digging up stuff I wrote back in '99 or 2000 and getting it to work under PHP 4.3; though I do have to enable register_globals in those cases.
Only problem I ever ran into with PHP where stuff quit working after an upgrade was on a test Apache2 server. It turned out to be a bug related to posted form data. I wouldn't use Apache2/PHP on a production server yet anyway, though; and 1.3.27 still gets the job done. I haven't had time to play with PHP5 yet, so I'm not sure what the differences are in that version.
I agree at the surprising number of hosts who simply haven't updated, though. There are a lot of hosts still running 4.1x, and even (yikes) 4.06, who just won't upgrade for whatever reason. I do most of my coding these days on 4.2 or 4.3, and have run into plenty of belligerent hosts who refuse to upgrade from a two-year-old release. Typically I just have my clients move to a better host; the providers who don't stay reasonably with the times will eventually figure out that it's hurting their bottom line.
Re:Problems with newer versions (Score:2)
OO support (Score:2, Funny)
Yeah Yeah... (Score:3, Interesting)
It's still made by a for-profit company who hobble the product in order to not cut into their profit margins too much (Hello? Zend Cache? Optimiser? Compiler? Everything's free in PHP-Land, for a small fee in PHP-Land...)
I don't mind so much the fact that you can't have servlet-like objects which handle entire sections of your URLspace (as opposed to one URL -- how very un-spider-friendly. Most choke on a ? in a URL and rightly so) and remain persistent (allowing you to do funky stuff like
But come on. Fellas. PHP: Hypertext Preprocessor is the name. Not PHP: Application Server. If those first two issues were fixed it might actually make a seriously powerful hypertext preprocessor. That's something it's reasonably good at. But at the moment it's some sort of bastard preprocessing language run amok that people use to write whole web applications with and other stuff Nature never intended. Perl's got an awful syntax and a total lack of convention (and mod_perl is really byzantine), and I really really really really
I'm not even sure what my point is anymore. But, I think what I was trying to say was this isn't much. Same stuff is true of PHP as has always been true of it... wake me up when they get round to PHP6. An earlier rant I made comparing Perl to PHP (I think I preferred Perl back then) is here [slashdot.org]. The extended comment history is pretty much the only reason I got a subscription and to be fair I think it's worth the money.
Re:Yeah Yeah... (Score:2)
APC was committed to PECL (Score:2)
You are brilliant. (was Re: Yeah yeah...) (Score:2)
Re:Yeah Yeah... (Score:3, Informative)
You can! Use a PHP file instead of a directory for your DocumentRoot in apache.
I.e DocumentRoot
Now all requests are handled by servlet.php.
Re:Yeah Yeah... (Score:2, Informative)
A more flexable approach I use for the same effect is a
This means if you request /page.html and page.html exists it serves it. If it doesn't exist the
Re:Yeah Yeah... (Score:4, Informative)
<VirtualHost *>
ServerName www.myhost.com
DocumentRoot
Alias
</VirtualHost>
Recompile for PDF support? (Score:2)
Re:Yeah Yeah... (Score:3, Interesting)
I urge that man to rtfm a bit more before posting nonsense like that. Without even testing i can tell him that mod_rewrite is 100% more elegant way to archive what he was after than any of his 3 choises combined.
Think about these rules for example (Not verified to work but im sure someone who knows apache syntax knows what i mean)
rewriterule ^/article/(.+)
Re:Yeah Yeah... (Score:4, Informative)
Psychic abilities will be added to PHP as of version 6.6.6. From here on you will be able to simply think of the configuration you want and it will be set in php.ini. No longer will you have to read the extremely comprehensive online docs [php.net] including the manual [php.net] and especially not the ENTIRE SECTION [php.net] dedicated to error reporting and logging that tells you extremely clearly how to do what you have just complained is impossible. You would not need to read that page and find the two links within the 1st side that show very clearly information on the display errors [php.net], error_log [php.net] for custom logs and of course log errors [php.net] to put the errors in the apache logfile.
Your biggest complaint is that you are too lazy to read the manual and you expect everything to be done for you. No programming language can help you with this.
i'm... (Score:2)
The obligatory predictions... (Score:5, Funny)
Re:The obligatory predictions... (Score:5, Funny)
WTF is "PERL" anyway? PHP sucks, Perl rules.
Re:The obligatory predictions... (Score:2)
*looks at his own PHP scripts* ...
You might want to decide to take that back... PHP readability is simply horrid... :\
Re:The obligatory predictions... (Score:3, Funny)
7. OOP sucks, there is no proof it is better, it is only a personal choice that maps to some people's head better but not all and the reuse claim is so 80's because up-to-date OO'ers don't claim that anymore.
If you are gonna put a troll out of business, do it right
Re:The obligatory predictions... (Score:4, Funny)
The word "loose" was used correctly in a Slashdot comment! Quick, take a picture!
Still re-coding for register_global_variables... (Score:2, Interesting)
I'm half-way through re-writing our website to remove our dependance on the depreciated register_global_variables stuff which I learned to live with and then was told was a stupid idea.
I'm hoping they don't break too many other things 'cause being a php beginner, the whole process is a bit of a nightmare.
Re:Still re-coding for register_global_variables.. (Score:2)
Just like for any other piece of software: if you don't see something new worth any potential upgrade fee or hassle in converting your stuff, don't do it.
Re:Still re-coding for register_global_variables.. (Score:5, Informative)
extract($_POST);
extract($_GET);
extract($_CO
?
Destructors! Hooray! (Score:2, Insightful)
Final version (Score:3, Informative)
I'm currently developing a PHP project with lots of OO code and it's about as plesant as removing your eyes with a rusty spoon (some control structures implicitly copy objects, they don't know how to return references, you can't write $a->getB()->doSth();
Improved OO support in PHP5 would be really nice riht now.
Yawn (Score:3, Interesting)
Truly, what more can you add to PHP? Why do most software packages continue to add features without actualy providing a subjective goal to strive for?
For example, in the world of Microsoft(R) Windows we see the same operating system have plastered above it "Where do you want to go tomorrow" and above all "n% faster than previous, more stable, etc." When will the goal of a products feature-list finally be met?
I know Perl5 accomplished its goals, and then they had an {ap-if-in-ee} to add the RegEx in yet another release of Perl titled Perl6. When will they ever make a product that has a goal? I don't call this competition...I call it beating a dead horse from its grave, like how Intel puts rocket boosters on its crumy brick CPU architecture (Pentium Pro) and adds some more features.
Look at netBSD; it isn't dying, it's still working on its number-one goal: security.
Linux is the same way; it stated from an original design and now is being extended. Am I sounding like I expect a new feature to be a new product? I don't think so... GNU/HURD, of which I know many people are skeptics unto, is builind upon its goals of being a Micro Kernel and add some. What if Linux all-of-a-sudden wanted to become a Micro Kernel? What if Microsoft(R) Windows(TM) all-of-a-sudden wanted to become a Micro Kernel?
The software names, after huge changes to extend their capabilites, are becoming misleading! If you take out a RedHat Linux 5.2 system and compare it with RedHat Linux 8.x, you can't say they are both similar Linux; they are completly different! Sure, it's like comparing apples with oranges on the old and new RedHat, but Kernel-wise the latest Linux Kernel may look completly different and have completly different goals and features than what was hoped for in the verry early Linux kernels. Shouldn't to cause less confusion and more inspiration, they leave the Linux name behind with the old design and all the new stuff that would completly change Linux's software (mechanical?) appearance become known as the new project Herring(TM). I anticipate most of you will reply with "That's why we have VERSION NUMBERS", but hey? You're missing the point.
Microsoft(R)'s Windows(TM) name isn't describing the project's code name, yet the product's retail names are somthing like 95, 98, NT, 2000, XP. Well, it is honest to say that the NT and 2000 products are similar, 95 and 98 products are similar, and the XP product isn't quite similar to 95 and 98 and 2000, but then there was the fiasco that all the 9x users went out to buy product Windows(TM) 2000 and found they had been tricked by Microsoft that 2000 would be like a 95 or 98. Anyone see my point?
As for PHP, and perhaps Perl... Does anyone think they should continue calling those products by their initial names AFTER the programming syntax and methodology becomes completly different or non-compatible than they were first designed?
I'm looking forward to some intelligent answers. Thanks and I'll be a PHP and Perl programmer for a long time to come. d:-)
Re:Yawn (Score:2)
I think that would be portability. OpenBSD's goal is security.
You make some fair points. I would have to say that you can't very well expect software to change it's name just because it's evolved. I'm not the same person I was twenty years ago by a long shot but I'm not about to call myself Roger Keith. I don't expect to be exactly the same person in twenty years by I will still be recognisable. Probably.
Re:Yawn (Score:3, Insightful)
Well, never.
Software design is unlike most every other discipline in the world. Your job is never finished until the product is dead. There are always bugs to fix, inconsistencies to remedy. Even the action of fixing bugs will create or uncover new ones. The fact is, if you release version 1.0, by definition you will also have to release version x.y for the entire life-cycle of the product. This also implies that versions ma
Re:Yawn (Score:4, Insightful)
You're new here, aren't you?
Re:Yawn (Score:4, Insightful)
Have you even READ anything about Perl6? Any of the apocolypses or exegises? After lots of incremental crud got added in the (very successful) Perl5 series, they are stepping back, rethinking, refactoring, and reimplementing with a very clear and concise goal of optimizing the syntax for the most used cases, as well as fixing known warts. Additionally they are doing this on top of a generic reusable virtual machine, instead of an ad-hoc specific-use interpreter. I don't even like Perl and I realize that Perl 6 is a Good Thing.
JSP (Score:3, Interesting)
The will be an interesting battle. JSP and PHP are now broadly identical in syntax and OO implementation. Who'll win? PHP is OS, but JSP has a huge amount of support from corporations.
I'm betting on JSP
Re:JSP (Score:2)
Both (Score:3, Informative)
The latest news from Sun is that J2EE 1.5 will support scripting languages. And the reference implementation will be done in PHP.
If you don't believe, check some of the news site reporting on JavaOne 2003.
Advice & Observation (Score:2, Informative)
Advice: .dll (Depending on which webserver you're using - php4apache.dll for Apache, php4isapi.dll for IIS)
The default method of configuring PHP is with the CGI SAPI module (i.e., php.exe); A much better choice (imo) is to configure the CLI SAPI module - all you have to do is build the CLI SAPI
(Also, many websites refer to the two config methods as CGI and SAPI; This is not really correct since CGI *is* a server API. What they really mean is CGI SAPI & CLI SAPI)
So, why go through the trouble t
Re:Advice & Observation (Score:2, Informative)
Regarding the DLL, you are referring to SAPI modules, not CLI. And yes, using them is preferred (although depends on who you ask
XML transformation pipeline (Score:3, Interesting)
Anyone wanna help me build it?
Re:XML transformation pipeline (Score:3, Informative)
Re:XML transformation pipeline (Score:3, Informative)
You can also use PHP as a generator in Cocon.
Breaking MySQL support - what *sses (Score:4, Interesting)
I'm not saying I can't take the trouble to link in MySQL libraries, just that there's no good excuse for the PHP folks to make me - and thousands of others - go to this trouble. They could, if nothing else, distribute their nonGPL PHP, plus a GPL kit that adds MySQL support, if they're too scared that the GPL will give them cooties.
Re:Breaking MySQL support - what *sses (Score:2)
Stop being so dramatic.
Re:Breaking MySQL support - what *sses (Score:3, Interesting)
Its would mean breaking MySQL's GPL license if PHP bundled current version of MySQL client libraries.
This because FSF claims that Apache and PHP licenses are not GPL compatible, thus linking against those is not premitted. It does not help that MySQL AB has chosen to change their client library license from LGPL to GPL after release 4.0 of MySQL
Nothing to do with the PHP development team really.
FREE!! -- PHP Encoder and Cacheing -- FREE!!! (Score:5, Informative)
MMcache - http://www.turcksoft.com/en/e_mmc.htm
It's only a split second
I'm too damn good to you people! ; )
PS: PHP makes programming fun again. Thats why people like to use it. Simple really.
PHP 5 Documentation update (Score:4, Informative)
Faq: Where can I get more information about PHP5? [faqts.com]
Enjoy!
PHP fragmentation, lack of cohesion (Score:5, Insightful)
Most people accepted the changes from PHP3 to PHP4 without complaining as PHP4 brought simple session support and other needed features. Thousands of developers wrote scripts for small pages and uses, and those scripts got placed on help sites etc all across the web.
The changes above 4.06 where register_globals got turned off by default and -from a simple beginners point of view- to 4.2 where a stunning array of new arrays were added for sessions, post and get variables. Those things broke almost everybodies scripts, and all those thousands of scripts across the web no longer worked as is. Due to this a lot of ISP's no longer upgraded regularly.
At the same time PHP started jumping on the "web application" gravy train, something for which PHP with it's awkward OO support (no automatic calling of parent constructors etc), lack of stateful session support etc was not designed to do. The makers of Zend decided to go the whole hog and redo OO support, add hundreds of seldom used features but ignore problems with backward compatibility and language simplicity.
Congratulations. Now we have a language that is slowly matching JSP in complexity (as all the 1337 "application developers are saying"), is nowhere nearly as well integrated in in true web applications as JSP is (great, it can support Java classes, how many will simply use Java then?) and is leaving the roots of it's enormous success behind.
Take a lesson from Perl's "failure" in web site popularity. Don't keep on adding features for the love of it.
Re:mysql? (Score:5, Informative)
bundled being the key word
Requires Microsoft Visual C++ (Score:5, Interesting)
MySQL isn't bundled with it, but you can easily add it yourself when compiling.
Compiling?
Compiling PHP for Windows requires the Microsoft Visual C++ compiler version 6.0 or later.
The Microsoft Visual C++ optimizing compiler version 6.0 or later is available only from Microsoft as part of Microsoft Visual Studio .NET, which costs $1,079 for one non-academic seat. (Microsoft no longer sells a Visual C++ optimizing compiler separately.)
Some people are bound to bring up the $109 Microsoft Visual C++ Learning Edition, but 1. the EULA attached to its library probably does not permit distribution of generated binaries nor public performance (i.e. use on a public web site) of generated binaries, and 2. because it does not have an optimizer, the speed of generated binaries is closer to that of an interpreted program than to that of a compiled program.
If I had any spare time, I'd fix this by porting the build to MinGW.
Re:Requires Microsoft Visual C++ (Score:2)
Re:Requires Microsoft Visual C++ (Score:3, Informative)
Compiling?
Compiling PHP for Windows requires the Microsoft Visual C++ compiler version 6.0 or later.
Exactly version 6.0, not "later" (because you can't compile/link with GPL stuff with the 7.0/.NET compiler due to licensing restrictions).
Re:Requires Microsoft Visual C++ (Score:3, Interesting)
I stand to be corrected, but I believe this is no longer true. On the other hand, it may be possible to work with the Intel C++ compiler. It seems to play with MS Visual C++ stuff quite well in most cases.
Re:Don't mod me down... (Score:2, Interesting)
Re:Don't mod me down... (Score:2, Informative)
Re:Speed --- Enterprise ready? (Score:2)
But, then it is from a servlet container vendor.
Here's the word (Score:3, Informative)
> I apologies if this is the wrong place for asking. Is non-experimental
> Apache2 support planned for PHP 5?
Nope. Until someone sits down and goes through every 3rd-party library that can be linked into PHP on every platform and identifies whether or not they are threadsafe and under which conditions they remain threadsafe, using PHP in a threaded web server on UNIX is going to remain experimental.
You can of course stick with non-threaded prefork mode
Re:What about apache2? (Score:3, Informative)
You can find it on sourceforge.
Its basically apache2, perl 5.6, tlc/tk, python 2.2, mysql, and php 4.2 installed as one package. I think their is a Unix version as well but I do not use it.
Re:Windows Users (Score:4, Insightful)
But since Windows doesn't come with a compiler, there is a binary provided for Windows.
So what's your point?
Re:Windows Users (Score:2)
Re:Windows Users (Score:2, Informative)
Nothing works! At least, nothing using PHP4's OO features. And I used a lot of PHP4's OO features!
I'm going to spend the rest of the day tearing out my hair. Especially because I'll have to rewrite 1000+ lines of PHP code....
Re:Windows Users (Score:3, Funny)
"But since Windows doesn't come with a compiler,"
Looks kinda crippled there, wouldn't you say?
Re:Windows Users (Score:4, Insightful)
Re:Does it really matter? (Score:2)
Re:Does it really matter? (Score:4, Insightful)
Re:Does it really matter? (Score:4, Insightful)
Re:Exactly (Score:2, Interesting)
Re:Kiss and say goodbye to Java language!! (Score:2)
Re:Kiss and say goodbye to Java language!! (Score:3, Informative)
> Forget Java man and go to PHP!
>
> PHP is 4 times faster than Java technology 'JSP' (Java server
> pages).
Substantiate that statement. What benchmark, what workload, etc.
> This tallies because compiled "C" program is 4 times faster than
> Java.
PHP scripts are re-interpreted, at runtime, *for every page hit*.
They're not C.
> Moreover, PHP is getting the object oriented features of Java
> language.
Yeah, *finally*. Partially.
Hehe. You've been trolled! (Score:2)
Yes my friend, you have been caught feeding the trolls.
Re:Kiss and say goodbye to Java language!! (Score:5, Interesting)
Hey HeadDown. You're right to take the guy to task, s/he made some crazy comments. But I can at least partially substantiate speed issues. Back in 2000, I worked with Sabeer Bhatia (the Hotmail guy) on a startup called Arzoo. Our product (a Web site similar to epinions) was almost 100% Java, except for a bit of Perl for screen-scraping and searches. But anyway, it was slow -- first with Tomcat, then with JRun. At one point, we gave a private preview to 1,000 journalists. They didn't even visit the site all at once, they trickled in over the course of 3 days or so. Just that was enough to hammer the site. We ended up running cron jobs that would reboot the farm, round-robin, just to solve memory issues and instability.
Now, you can say, well, that was 2000! Try it now! OK. At SST, we have a team that is using Tomcat now. Although the instability is gone, the speed is still an issue -- they have wait screens as you click through the app. My team is working with PHP, and has no wait screens, and no need for them (with 1 exception). Our pages are actually more computationally stressful than the Java stuff, yet PHP is delivering the result to the browser faster.
As a final point, you might suggest that the teams I've worked with do not understand Java or how to run it well. It's no skin off my back if you make that argument -- it's not me doing this stuff, so no blow to my ego. But I think working with 2 different teams over the course of 3 years says something. Perhaps, at the very least, if Java really can handle a bigger load, it is so difficult to tune that mere mortals would do better with PHP.
Re:Kiss and say goodbye to Java language!! (Score:4, Informative)
It's interesting that people like to make comparisons to JSP and ASP all the time but don't remark on what platform they run on. Obviously JSP running on tomcat/apache through with mod_jk will be slower than with just plain Resin.
And open should note that a statement like ' Kiss and say goodbye to Java language!!' almost sounds like a troll, when you consider Java is used for a great deal more than web applications, indeed the servlet functionality that JSP relies on is a *very* small portion of the overall tools that Java supplies to developers.
But whatever, use the right tool for the job and try to remember it's technology, not religion. The more options the better IMO.....
Re:Kiss and say goodbye to Java language!! (Score:5, Insightful)
The raw speeds of execution between JSP and PHP may be similar (though I suspect that JSP ends up being much faster once the JIT has kicked in and optimized it, after a few executions). Additionally, there are many different JSP runners (Tomcat is only the reference implementation) and the performance between them can be very large (I recommend the JSP runner by Caucho for performance-critical systems. Besides this, PHP and JSP have a very, very large difference between them:
PHP is usually run as a apache mod or sometimes, as a cgi. Because of this, it cannot store session state or cache inside of its process (since the process is either apache httpd, or the cgi, which terminates at the end of a page run). To get around this, any session variables get serialized and stored to disk at the end of each run, then un-serialized at the beginning of the request. This also means you can have no application-level caches of database information, since there is no place to put these. This is fine for small stateful sites or large stateless sites, but for any serious, large web application that has to maintain a lot of state, this ends up being a big performance disadvantage.
JSP, on the other hand, is run from a servlet runner in a persistent process outside of the apache process. At the beginning of the request httpd makes a socket connection (usually a local unix socket, very fast) to the servlet runner and sends the request there. This is slightly more overhead than everything running in-process, but gives you the huge advantage of being able to cache whatever data you wish to inside the servlet runner's process. This means database lookups can be cached, sessions don't need to be stored in disk, timers for maintenance functions can be set, all within the servlet runner's process. This is great for large, complicated web applications but obviously not great for small, stateless systems, since it requires the overhead of a running JVM at all times you want the application to be available.
Two different types of systems, two different purposes. I happen to use both in my professional web development, but use only java servlets and JSP for serious projects.
Re:Kiss and say goodbye to Java language!! (Score:2)
I am a PHP programmer and have programmed some Java some years ago. I do PHP almost exclusively now, but I always liked Java and I am thinking that maybe JSPs may be worth a look.
So although I currently don't feel an urgent need to switch and will definitely have to maintain PHP code for the rest of my life (probably ;-), I'd like to play a bit with JSP, especially because Java is so universal (runs on servers, browsers, desktops and embedded systems)
What tools do you use/recommend? (What servlet e
Re:Kiss and say goodbye to Java language!! (Score:2)
Re:Kiss and say goodbye to Java language!! (Score:2)
Re:No Function overloading? (Score:3, Informative)
Once inside the function you can test the passed in variable and take appropriate action.
You can also do other crazy things like declare functions without parameters and pass parameters into them.
You can declare methods that act as "default" method handlers.
You can add methods to objects at runtime!.
Hell you can even define classes