CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
mod_perl collisions versus PHP


New User

May 13, 2009, 9:23 AM

Post #1 of 2 (1423 views)
mod_perl collisions versus PHP Can't Post

I understand that one can use mod_perl with Apache to run Perl scripts in a web environment much faster than regular CGI where you have to load the Perl interpreter eachtime the script gets called. But I also understand that this can cause some name collisions between modules or functions.

I am more used to using PHP and I'm wondering is there any equivalent in PHP? When I develop PHP scripts to run under Apache, I just place my whatever.php files in a directory under the fileroot for the web server, then just access the page through my browser and it runs. Does this mean that my PHP script is running as a CGI script and the PHP interpreter is being loaded each time? Or, does PHP have something like mod_perl (mod_php?) built in? Are there similar problems with namespace collisions under PHP?

This is sort of a PHP question as much as Perl question, but I'm hoping someone out there knows nboth environments well.



May 13, 2009, 9:49 AM

Post #2 of 2 (1421 views)
Re: [zortag] mod_perl collisions versus PHP [In reply to] Can't Post

I've coded mod_perl now for the better part of 8 years and never once have I had a problem with name spaces. If you use strict and know that if you don't understand local stay the hell away from it you should have no issue.

You will most likely get a pretty big perl is > then PHP (which it is) hit here on perl forums. As much as I like perl I'm not a fan boy that thinks perl is the answer for everything. So here are my thought on PHP (and yes there is mod_php ) vs doing sites with mod_perl.

Every bench test I have ever run mod_perl is not only faster but much lighter on your memory. The main reason for these kind of things are that PHP was built so that just about anyone could code it. The problem with things like that is the easier it is for you to understand the harder it has to work most of the time to get the computer to use it.

Yeah that is a general rule is is not always true but it is in this case. PHP has come a long way from when it first started out but to me is still kind of a show that the internet is leaning more and more towards the lowest common denominator then what is really good but hey what isn't these days right haha.

Now that I've ranted a bit lets answer your question. Any code when coded wrong will not work. If you are having name space collisions you are coding wrong. Weather it is PHP or Perl this should not happen if you know what you are doing. In your case if you already know what you are doing with PHP and don't have the time to learn something new or don't have the desire then go with what you know.

The last thing I will say is that yes there is a mod_php but it is not an official Apache project and mod_perl is. Hope my ranting input helps someone haha.



Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives