Is PHP still slower than Perl?

@

@

A benchmark in 2002 showed PHP is much slower in shell or when Apache has
Mod_Perl.

With the new PHP kissing Java's ass, Perl is once again the #1 CGI choice.

Java is for a big team in short time to develope something slow.

ASP is a joke.

PHP is a kid.

Perl is around.

C. I don't know why it is not popular. It should be. Maybe those Web
inventors always thought in Linux so they never wanted to push something
binary so they selected Perl, a slower scripting.
 
D

Daniel Tryba

In comp.lang.php @ said:
A benchmark in 2002 showed PHP is much slower in shell or when Apache has
Mod_Perl.

With the new PHP kissing Java's ass, Perl is once again the #1 CGI choice.

If you want to troll, please put a little more effort in it.

Like make up some benchmarks to support your facts.
 
J

Joe Smith

@ said:
C. I don't know why it is not popular.

I'd say it is because C does not have strings as a native data type.
Other than initializing an array of char, the C compiler has no
string manipulation built in; it requires library functions to do that.
-Joe
 
J

Janwillem Borleffs

@ said:
With the new PHP kissing Java's ass, Perl is once again the #1 CGI
choice.

You mean this regarding PHP 5's OO model? You have never looked at Perl 6's
OO model, haven't you?


JW
 
J

John Bokma

@ said:
A benchmark in 2002 showed PHP is much slower in shell or when Apache
has Mod_Perl.

With the new PHP kissing Java's ass, Perl is once again the #1 CGI
choice.

For me Perl is #1 (if possible) because PHP is probably the worst designed
language ever. I am not sure if you can already prepare statements (MySQL),
something I used in Perl ages ago, or still have to use all those
whatsamacalled_quote_shebang garbage.
 
T

Tony Marston

John Bokma said:
For me Perl is #1 (if possible) because PHP is probably the worst designed
language ever. I am not sure if you can already prepare statements
(MySQL),

Yes you CAN use prepare statemetnts with MySQL. You should be aware that
this is a MySQL feature, not a PHP feature.
something I used in Perl ages ago, or still have to use all those
whatsamacalled_quote_shebang garbage.

If you don't like PHP then why are you posting to the PHP newsgroup?
 
D

Darin McBride

Janwillem said:
You mean this regarding PHP 5's OO model? You have never looked at Perl
6's OO model, haven't you?

First off, as Perl 6 doesn't really exist yet, the original flame^Wpost
must be comparing against Perl 5.

Second, Perl 6's OO model could yet do a few 180's.

Third, who said anyone would use Perl 6 for CGI?

Fourth, who said Perl 6's performance would suck?

Fifth, I'm not saying PHP 5's performance sucks - I'm just inferring it
from @'s flame^Wpost.
 
T

Tassilo v. Parseval

Also sprach Joe Smith:
I'd say it is because C does not have strings as a native data type.
Other than initializing an array of char, the C compiler has no
string manipulation built in; it requires library functions to do that.

That's a distinction in C that's moot. It has no built-in IO mechanisms
either. You have to include a header to get this functionality. But
nonestheless, it's still part of the language.

Tassilo
 
D

Daniel Tryba

In comp.lang.php @ said:
google with PHP PERL BENCHMARK, you will see the results.

That is not how it works: you make a claim, so you supply your proof. And
I'm more interested in perl/php vs. java.
That is the one
back from 2002.

2002 is so 2 years ago, that like ancient man.
 
J

John Bokma

Yes you CAN use prepare statemetnts with MySQL.
You should be aware
that this is a MySQL feature, not a PHP feature.

How can I use it from PHP?
If you don't like PHP then why are you posting to the PHP newsgroup?

Look at the headers, this has been crossed to a Perl group. Besides, I
hope the PHP group isn't only there for people who say it's a great
language? (which it isn't).
 
@

@

That is not how it works: you make a claim, so you supply your proof. And
I'm more interested in perl/php vs. java.


2002 is so 2 years ago, that like ancient man.

I personally did my own benchmark in late 2003. I am not an expert at
benchmarking softwares, but it is true Perl is much faster than PHP from my
result. I used PHP/Perl in web enviroment for printing one line per hit.
 
M

Michael Vilain

John Bokma said:
How can I use it from PHP?

Buy one of the many PHP books that mentions building sites and using
MySQL. O'Reilly has PROGRAMMING PHP, which I used to develop my site.
There are others, which I leave to you to investigate.

If you're to strapped for funds to buy something, there's

http://www.php.net/manual/en/
Look at the headers, this has been crossed to a Perl group. Besides, I
hope the PHP group isn't only there for people who say it's a great
language? (which it isn't).

One thing I'm unconvinced of is security. With database applications, I
have to put passwords to the database inside php scripts and they have
to be readable by the web server which runs under the nobody UID.
Instead, I chose to do parts of my site with Perl CGI and CGIwrap. This
allows me to protect the files from group or other access as these
scripts run as my account's UID.

I found recently that you can put such files outside of the server's
DOCUMENT ROOT and get access through the php include_path global, but
the web server still needs access to the file.

One thing I like about php is that each script is stored in the usual
place in the user's document directory. The files are executed and the
output is displayed without having to put everything in the ScriptAlias
directory (usually cgi-bin).

While php has PEAR, a depository for additional libraries written by
others, perl has CPAN which is at least 2 orders of magnitude larger and
more diverse. There's also lots of network and system-level things you
can do with perl and usually someone's already done it in a CPAN module.

This thread is about as enlightening as "which car is better". It all
depends on where and how you're trying to get there.
 
C

Chung Leong

Doug said:
Why don't you try assembly!!!! I bet you can get that to be running even
faster than C!!!

good luck,
-d

And I heard that you can get great performance by designing your own
silicon.
 
@

@

One thing I'm unconvinced of is security. With database applications, I
have to put passwords to the database inside php scripts and they have
to be readable by the web server which runs under the nobody UID.
Instead, I chose to do parts of my site with Perl CGI and CGIwrap. This
allows me to protect the files from group or other access as these
scripts run as my account's UID.

Could you tell me how others can read your files? If you set PHP as 604?

In perl's case, if I set it as 755, does it allow everyone to read the
script? Should I set it as 705?
 
@

@

One thing I'm unconvinced of is security. With database applications, I
Could you tell me how others can read your files? If you set PHP as 604?

In perl's case, if I set it as 755, does it allow everyone to read the
script? Should I set it as 705?

I think as long as the directory is set as 400 then nobody will be able to
get access to any of your files, regardless how they set mod on them
 
S

Shawn Corey

@ said:
I think as long as the directory is set as 400 then nobody will be able to
get access to any of your files, regardless how they set mod on them

The files should be set to o=r,go= (400) or u=rw,go= (600). The
directory they are in should be u=rx,go= (500) or u=rwx,go= (700).
Directories must be executable to read the inode. The inode stores,
among other things, the sectors where the file contents are.

Perl modules should be placed in a directory not accessible by the
server. Perl can access them by using 'use lib' to add the path to the
library directory list (see perldoc lib). The permission on the modules
should be u=rx,go= (500) and the first line:

#!/

This means if the server accesses the file, it will try to execute it
and fail, making it impossible for it to display the code. This is
important if you are under the obligation of not exposing the code to
the public.

--- Shawn
 
S

Sherm Pendley

@ said:
Could you tell me how others can read your files? If you set PHP as 604?

What is "set PHP as 604" supposed to mean? Are you referring to setting
the permissions on *.php files?

If that's what you mean, please read any basic introduction to UNIX. 604
makes a file readable and writable by its owner, and readable by any
other user.
In perl's case

File permissions are language-independent. A file that's readable for
Perl is readable for PHP, is readable for Java, is readable for C, etc.

Michael is referring to a server configuration that will run CGIs with
the permissions of the CGI's owner, instead of running them as "nobody".
That way, you don't have to make anything world readable - you can make
sensitive files 0600, and the CGI will be able to read them.
Should I set it as 705?

No. You should read a good basic introduction to UNIX, concentrating on
the section(s) about file permissions and ownership. That way you'll
know what these numbers mean, and you won't have to throw them around at
random.

sherm--
 
S

Shawn Corey

Sherm said:
If that's what you mean, please read any basic introduction to UNIX. 604
makes a file readable and writable by its owner, and readable by any
other user.

Not so, users in the same group cannot read, write or execute the files.
UNIX check only the user's permissions if you are the user, only the
group's permissions if you are in that group and only the other's
permissions if you are not the user or in the group. No cross sharing of
permissions.

--- Shawn
 
T

Tony Marston

John Bokma said:
How can I use it from PHP?
http://dev.mysql.com/tech-resources/articles/4.1/prepared-statements.html


Look at the headers, this has been crossed to a Perl group. Besides, I
hope the PHP group isn't only there for people who say it's a great
language? (which it isn't).

I don't waste my time posting to a Microsoft newsgroup saying that all MS
products suck (otherwise I'd never get anything done), so what makes you (or
anyone else) think that you can post such comments to this group without
getting an animated response.

You may think that Perl is better than PHP (what is your justification?) and
as it is still a free country (that is until President Blair finishes
screwing up the constitution) it is your God-given right to hold that
opinion. I think you are wrong, but it is still your right.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top