A new version of popular server-side scripting lanaguage PHP was released today. Stephen Smith writes “PHP 4.3 includes bug fixes from PHP 4.2.3, as well as enhanced command line mode for non-web scripting, a better GD library, and more.” Changelog can be found at php.net.
server side ? Beat java ?
Go read about what articles OSAlert can put on here, if you dont like it, dont read it, as simple as that.
Read the rules: http://www.osnews.com/rules.php
i was thinking about it, but i’d rather not. *mod_perl*
> i was thinking about it, but i’d rather not. *mod_perl*
Why not ?
Many parts of your code will be like C …
I am not an expert on perl or php, I don’t care or use much about booth, but php seems much more simple and light while perl gets (many times) complex for a simple jo6/task.
Improved php is good (os) news.
Do it with java
Apache 2 support in PHP 4.2 was ‘experimental’ .. anyone know the status of Apache 2 support in 4.3?
> perl gets (many times) complex
> for a simple jo6/task.
> Improved php is good (os) news.
Naah!, perl is pretty simple. Quoting from the perl book, off by hearth:
“In perl, simple remain simple, and difficult ones are made possible”.
I guess which language you choose depends on what you are doing or, more likely, what you know best.
Try it will make you love it. No more ‘chmod’ required
Server side? Hasn’t PHP _always_ been server side?
That was my submission.
Read -> http://www.php.net/release_4_3_0.php
Apache2 filter is improved, but is still considered experimental (use with PHP in prefork and not worker (thread) model since many extensions based on external libraries are not thread safe)
I guess, it’s still not ready.. But, a lot of other modules aren’t ready neither. :/
Why not ?
Many parts of your code will be like C …
I am not an expert on perl or php, I don’t care or use much about booth, but php seems much more simple and light while perl gets (many times) complex for a simple jo6/task.
Improved php is good (os) news.
Do it with java
The voice of ignorance speaks most often.
Perl is designed to be lightweight, designed to let the programmer choose how best to tackle a situation and not have it forced upon him/her by the languange.
The only issue with perl that prevents it ruling supreme is that it is not compiled into an efficient little binary but a scripting language, executed as and when it’s read… but the Parrot will have the last word on that one.
http://parrotcode.org
“Apache2 filter is improved, but is still considered experimental (use with PHP in prefork and not worker (thread) model since many extensions based on external libraries are not thread safe)”
AFAIK, most people use prefork mode anyway, at least on *nix OSes – there is little to no advantage to using threads on Linux currently, and *BSD’s threading is known to be crufty & slow. Maybe by the time Linux has the Native Posix Threading Library stabilized & included with major distros, all the libraries that PHP uses (which are NOT under the PHP developers’ control, BTW) will be made thread-safe.
The major OS to benefit from threading is Windows – and I feel sorry for them that Apache & friends aren’t ready for them yet, because IIS is such a sorry morass of terrible code.
Well, I’m not going to say too much about the merits of Perl vs PHP or anything else, although I personally think Perl is a much better language. I agree that PHP has certain advantages over traditional Perl use for server-side scripting … that is, until you bring the little-know Mason into the equation, which is designed to work best hand-in-hand with mod_perl. This blows PHP away IMHO and not just because it uses Perl:
http://www.masonhq.com
Any Perl web developer owes it to themselves to check this out.
” Server side? Hasn’t PHP _always_ been server side?
That was my submission. ”
Just try to say something not too off topic and still do a post first on the topic 8-)))))
M$ should distribute client side PHP as well so that
your P4/Athlon isn’t just an upgrade version of VT100
with the WEB option 8^)
Must people get into a holy war about PHP also ?
we can start a vi emacs war because vi is 100x better then emacs
“we can start a vi emacs war because vi is 100x better then emacs ”
Yeah, vi is so compact yet packed with features!!!
Congratulations to the PHP devel team. Good work.
I’m looking forward for ver. 5.0 with Zend 2.0 and Apache 2.0 support.
personally, I use both php and perl. And and one here that tries to put one over the other is just showing their ignorance in understanding using the right tool for the job.
perl is better for projects that requier off server functions and interfacing those functions from the web.
php on the web is faster than perl and easier for database access. and concidered by far the better option for web applications.
perl people who want to war over which is better are idiots.
in truth you perl people who never tried php, weather you know it or not, you know php. you will find the two langage diferences quite trivial in syntax.
Perl by far is better suited for more than web, CGI. While php is better on the web. although i’m finding commandline php rather fun. though I prefer perl in those areas.
I like PHP. The syntax is nice and it is quite fast for web applications. I think the commandline scripting abilities are a pretty nice new feature. I probably will continue to use Python or Perl for the things that PHP’s commandline capabilities would solve. Nonetheless, it is always great when a good tool gets better.
Must people get into a holy war about PHP also ?
That’s what people do. I cannot fathom it, but many people who use computers do so using the same couple of brain cells they use to pick a favorite football team.
Next Saturday on Monday Night Scriptball at Eight! See the PHP Hackers take on the Perl Monks in the OSAlert Bowl! Go Perl! Go! Go! Type damn you! PHP Sucks! Die PHP! Yay! Damn!
I hope that these same folks don’t laminate the same paradigm onto their choice of cooking utinsils. Just keep rubbing that spoon against the pot roast and it’ll cut through eventually. What? No, I don’t use knives. Spoons are better. Spoooooooooonnnnnnnn!!!
In voicing my preference for Perl I hadn’t meant to participate in any holy war. Just my preference and an an attempt to point out that Perl by itself doesn’t make for a valid comparision with PHP (whereas in conjuction with things like mod_perl & Mason etc, it does), a little OT admittedly. PHP is certainly a good system. I’m very pleased a well devised, open-source system for web-development has gained such a strong foothold whether it be PHP, Perl/CGI/mod_perl/Mason, Zope or anything else – and on that note, the new release is good news.
I know you weren’t replying to me directly, but I just want to let you know my comments were general in nature and not directed at you.
I didn’t knew about that Mason project. Might get back to it if I need some part of it.
I like PHP ok, and it’s fast and ubiquitous and nice. But it’s not Perl — the syntax is only superficially similar. Consider how much extra typing you have to do to accomplish a simple regex replacement. Perl:
s:<bodys*>(.*)</body>:$1:i;
But in PHP:
$somevar = preg_replace(“:<bodys*>(.*)</body>:i”, “$1”, $somevar);
Who wants to do all that typing?
Not to mention rich quoting methods: qw(), qq(), q(), here documents, etc. Real arrays, not just hashes with numeric keys. Closures.
Anyway, I don’t think anything bad about PHP because of this, but they’re definitely not the same.
Perl is a very general purpose language. it’s turned into something that can be used to write just about anything, and pretty easily. it’s also very very syntacticaly flexible. This both a strength, and a weakness.
PHP is highly tuned for web development. It is NOT a general language, tho it can be used for many things outside of web development, it kinda feels like a fish out of water.
Any general purpose language is going to be inherently inferior to a language tuned to whatever task you’re doing. That’s just the way of things. That being said, I think php is a complete mess. Perl is a much better thought out language than php IMHO.
The flexibility of perl can also work against it. It means you’ll rarely see the same problem solved in the same way when looking at examples. 2 solutions to a problem may vary so greatly that someone trying to understand them both will just end up more confused.
In short, I don’t think perl can be as good as php for web development, simply because that’s not what it’s focused on.
Perl is a very general purpose language. it’s turned into something that can be used to write just about anything, and pretty easily. it’s also very very syntacticaly flexible. This both a strength, and a weakness.
PHP is highly tuned for web development. It is NOT a general language, tho it can be used for many things outside of web development, it kinda feels like a fish out of water.
Any general purpose language is going to be inherently inferior to a language tuned to whatever task you’re doing. That’s just the way of things. That being said, I think php is a complete mess. Perl is a much better thought out language than php IMHO.
The flexibility of perl can also work against it. It means you’ll rarely see the same problem solved in the same way when looking at examples. 2 solutions to a problem may vary so greatly that someone trying to understand them both will just end up more confused.
In short, I don’t think perl can be as good as php for web development, simply because that’s not what it’s focused on.
tty said:
“M$ should distribute client side PHP as well so that
your P4/Athlon isn’t just an upgrade version of VT100
with the WEB option 8^)”
But that is exactly what Microsoft wants! They have their own server side language (ASP) which can do most if not all of the function of Perl and PHP (not saying it’s better, just said that if need-be, one could use it). Why would Microsoft support vastly superior languages? All it wants to do is push its own proprietary language (ASP). That way, if you wanted to do ASP scripting, you would have to have a Windows (NT, 2000, .net, etc.) box.
As for ASP, I like it a lot. In fact, I might use it over PHP, however it is only for NT machines, and most web servers only run on UNIX.
As for the Perl/PHP holy war, I would say that they have their places. I use PHP for web pages and for database interaction, mostly because of its simplicity. I don’t use Perl all that often because I don’t do a lot of UNIX scripting, but I’m sure that I would use it if I could. Frankly, PHP has a much better syntax as is far more readable, however Perl is arguably more powerful.
A company called Chilisoft (or something to do with spicy food) created a product that would allow you to do ASP on Unix machines. I think Sun or somebody like that recently bought them out.
I don’t particularly like ASP (preferring JSP, PHP, etc.), so I don’t follow it that closely, but I know such a product exists. ASP.NET is better than ASP, but I don’t think it is supported via this Chilisoft product; however, I really don’t know.
What I’m trying to say as I beat eternally around a very large bush is that you can do ASP on Unix machines if you really want to.
ASP isn’t a language. It’s merely a scripting module (ISAPI) used with IIS. The default language choices are VBScript and JavaScript, though I think there are others. I personally use JavaScript as my ASP language because of its support for try/catch exception semantics.
A company called Chilisoft (or something to do with spicy food) created a product that would allow you to do ASP on Unix machines. I think Sun or somebody like that recently bought them out.
I don’t particularly like ASP (preferring JSP, PHP, etc.), so I don’t follow it that closely, but I know such a product exists. ASP.NET is better than ASP, but I don’t think it is supported via this Chilisoft product; however, I really don’t know.
What I’m trying to say as I beat eternally around a very large bush is that you can do ASP on Unix machines if you really want to.
Actually, ASP with Apache is suck big time from what I compared to IIS. YOu have to write it in Perl for ASP on Apache rather than VBScript, JavaScript and etc.
Perl rocks. Perl is number one. PHP, I don’t care.
Microsoft should carry Perl with Windows, instead of Java. Perl is also competing with .net, seriously.
>As for ASP, I like it a lot. In fact, I might use it over PHP, however it is only for NT machines, and most web servers only run on UNIX.
PHP has an ASP compatibility mode. And most servers haven’t run UNIX for about the last 5 years.
haiqu
Sure! As it was my first post on this site, I didn’t want to get a reputation as a troll or a moron or anything …
My main contribution to the debate is that I respectfully disagree with this “Perl is a general programming language, PHP is designed for the web so it must be better” notion. I believe more detailed examination makes for comparisons of greater merit. For instance, one thing I do miss in PHP is that (and someone please correct me if I’m wrong) it seems you can’t follow a “HTML with programming constructs embedded where needed” sort of paradigm. You have to output HTML from within a PHP block using printing statements whereas HTML::Mason let’s you do the opposite, for example (excuse the incorrect but necessary use of curlies for the tags):
{html}{body}
{table}
% foreach $n ( 1 .. 10 ) {
{tr}{td}Iteration: {/td}{td}{% $n %}{/td}{/tr}
% }
{/table}
{/body}{/html}
Which is quite nice isn’t it? It makes more sense to me, anyway. You can concentrate on the design, and it’s a lot more friendly for HTML designers. You stick all the nasty stuff at the bottom in special blocks, init your variables and reference them where needed, using a minimum of programming constructs inside the HTML itself. Add to that things like dhandler, ahandlers, a re-usable component based approach, direct hooks to mod_perl vars, and way, way more and Perl in this instance begins to look very web-centric indeed. And it’s fast. So yes, PHP is great but PHP proponents should /also/ be aware of what is possible with Perl. OK, I’ve made my point so I’ll be quiet now!
Actually, ASP with Apache is suck big time from what I compared to IIS. YOu have to write it in Perl for ASP on Apache rather than VBScript, JavaScript and etc.
Actually, I believe ASP simply sucks all around regardless of the platform you’re running on. ASP.NET seems to be an improvement.
No offense to those who like it, but I think IIS is probably the worse web server I have ever worked with. I like Apache because it is light, fast and very configurable. It can be daunting to someone who likes simple GUI interfaces though. If I was going to use a non-free webserver, I think I’d rather choose something like WebSphere instead of IIS, in spite of the fact that its minimum system requirements are so maximum.
I never like IIS neither. Apache always rules the Internet. As for non-free webserver, I would choice Zeus Web Server over WebSphere.
observe(substituting {} for less than/greater than signs)
{html}
{body}
%
$Results=mysql_query(‘select * from foo’);
%
{table}
% for(;$Result=mysql_fetch_array($Results);){%
{tr}
{td}%=$Result[‘field1’]{/td}
{/tr}
%}%
{/table}
this code, given an extra line or two(to connect to database, etc), and substituting some characters, is PERFECTLY valid php.
Personally, my language of choice for web programming is JScript, a language available in IIS. Nice error handling, very powerful OO features, well thought out, and most importantly, used both client side and server side, thus reducing the # of languages I need to know by 1.
OK, my mistake, thanks for educating me on the embedding issue!
Chilisoft stops at ASP3.0 afaik, to use VBScript on linux you need a couple more things I think. Apache is most definitely not a light web server, or particularily speedy. ASP is very handy to code in if you are developing on the local host and want to check how results look on IE instantly. PHP is easy enough to learn, but still feels a little directionless. Perl is nice enough, but sometimes wanders off into the downright arcane. It would be good to see Perl/PHP caching compiled versions instead of interpreting/compiling on demand (Perhaps they already do, it’s been a while since I bothered to check). Strange how nobody’s started waving a little flag for Coldfusion yet…I’m not going to be the one.
Pick the tools that let YOU do the JOB. There’s very little point arguing that for web scripting Perl is the greatest thing since sliced bread if the only language someone knows is VBScript. If you’re doing something for the command line then why not use Perl? Most Linux distros carry it. For that matter why not use Python? Or C? Or Ada? Or Ruby? Or…
Just wanted to add my 2 cents into this discussion.
ASP: Good web programming enviroment if you plan on using Jscript or VBscript for web programming. ASP .NET improves greatly upon original ASP, and also offers you more langages (anything you can use in .NET, such as C#, J#, etc.) If you don’t like IIS4/5, then you can use SunONE Active Server Pages (used to be Chilisoft). It supports ASP 2.0, VBScript 3.2 and JScript 3.2. It works VERY well with Apache. We have several projects built using ASP and VBscript running on a Linux box, connecting to a Mysql database. Very FAST, very stable. The other alternative is Instant ASP (iasp). iASP fully supports ASP 3.0 and version 5.5 of VBscript/Jscript. It actually converts everything over to JAVA and executes the JAVA. Check it out for a more detailed explanation of the process.
As far as the IIS haters, IIS 6.0 will be a MAJOR difference. Still sucks it only runs on Windows, which is why I would give the nod to Apache 2.0. IIS 6 is be a serious web server unlike the piece of crap IIS4/5. That is why we use Linux/ASP combo, because I dislike IIS, but like to offer ASP for the Dreamweaver developers. It is not much work to move a ASP/Access project onto Linux/Mysql using this.
If you want ASP .NET on Windows, IIS 6.0 will be a good pick in the future. If everything works out, then if you want to run ASP .NET on Unix, then use Mono. The Mono project is VERY interesting indeed. Just have to see how it is when done.
Just wanted to add my 2 cents into this discussion.
Perl: You can do something with less code, in 50 different ways. That makes the language more powerful if your working on your own code. When you have 10 different people all writing perl in their own style, then it can be TOUGH to read and understand. I find PHP, by the use of more typing (like the example ealier with the regexp function use) and a more standard way to do things, easier to read and understand. For that reason I prefer PHP.
If you are a VERY skilled Perl coder, and can read short hand and long hand perl (joking), then it is very powerful. One thing I dislike about PHP is using databases. It becomes a pain if you move from Mysql, to Postgres for example. You have a bunch of database specific functions to change. I prefer the standard Perl DBI interface for database connections over PHP standard fucntion calls. Then again by having specific functions for each database, you can do certain things only available to that database.
So I wont say one is better then the other, but I personally find PHP easier to work with and read over perl. From tests connecting to a mysql database on a Linux box, I found PHP the fastest, with Perl CGI close behind (yes I know, use mod_perl), and VBscript Chilsoft ASP last (but not to far behind). I also find it easier to secure and change specific things in a PHP eviroment (edit the php.ini, turn on safe mode, etc).
Just my thoughts from my personal experience.