why php is being popular when it is not as safe as java,y som compnis sh\witching from java platform to php ?

4 Answers

Relevance
  • NC
    Lv 7
    1 decade ago
    Favorite Answer

    First of all, what do you mean when you say "Java"? Is it Tomcat, JBOSS, PowerTier, WebLogic, WebSphere, something else?

    Second, PHP is just as safe as any other Web application development language. Security is most often compromised by programmers writing bad code, not by PHP or JSP themselves. Since PHP is much easier to learn, there are more inexperienced programmers working with it, hence, security issues in some PHP applications.

    Third, why do some companies switch from Java to PHP? Cost and performance. Consider Friendster. The company started on Apache / Tomcat / MySQL platform, but quickly ran into severe performance issues. The fault lay somewhere between Tomcat and MySQL JDBC driver; somehow, at high loads, the two didn't want to play nicely with each other. So the options were:

    1. To replace Tomcat with a more powerful JSP server, which will be somewhat expensive and may or may not work better with MySQL.

    2. To replace MySQL with a more powerful database server (most likely, Oracle, which has a great track record of working with JSP servers), but that may or may not resolve issues with Tomcat cracking under pressure and will definitely be expensive.

    3. Do 1 and 2 simultaneously, but this is going to be even more expensive than 2 alone.

    4. Rewrite the front end in a more MySQL-friendly language, such as PHP.

    Friendster chose option 4 and did not regret it.

    Fourth, PHP is not the only alternative for those dissatisfied with Java's poor performance. Python is becoming increasingly popular as well...

  • 1 decade ago

    Who said php is not safe. In a server side scripting language we can do any thing as we like in php. Another one Important thing is the PHP and the tools for developing the PHP pages are all free of cost. So it may popular

  • 1 decade ago

    And PHP is not insecure; it just allows you to be. However, if you are an experienced PHP developer your applications can be just as safe as anything else.

  • Anonymous
    1 decade ago

    Because it's an entirely different technology - it does a different job.

    Why don't people use screwdrivers to hammer in nails? Because it's the wrong tool for the job. The same principle applies here.

Still have questions? Get your answers by asking now.