You are invited to Log in or Register a free Frihost Account!

Java vs PHP


I would like to know wich is better, PHP or Java.

What do you think ?
It depends on what you wanna do.

PHP is more of a server side scripting language to make more interactive web pages whilst Java is a whole other set of boots.

Most Java programmers, as far as I know, work on utility program projects for companies.

There's money to be made in both but my understanding it that:
- with Java you will more likely land a company job. Very good money, lots of opportunities.
- with PHP it's possible to do a lot of freelance work. Less money but more freedom to travel.

I guess it really depends on what you wanna do. I've been learning Java for a year and I have to say, it's quite easy and newbie friendly and pretty damn powerful.
I think both are important but its depends upon your requirements.
I can't deny Java is always more acceptable in universities as well as some companies. But I love PHP far more than Java. Perhaps that's because I started to learn PHP earlier, and, I was somehow forced to learn Java.

It's not easy to tell which is better. PHP is quite limited to web developments though PHPers have been trying to apply it to other fields. Its performance in web are quite satisfying.
While Java remains the most widely-used programming language in the past few years. I'm not really into it, yet I believe it's powerful enough.
it depends in you need.
I always use both.
For my new Dynamic Website i used both.
I got my first SUN Java certification in 2000 an a further certification in 2004 I got a lot of experience but dropped it when I found PHP
Using Google I can pretty much look anything up and Addapt it for the PHP solution I am after
C# is supposed to be a simplified Java but it's much easier to do in PHP
Having said that, companies are looking hard for Java experts so you can earn money with it
Remember though you are using Legacy code JAVA IS THE NEW COBOL.
Java is a powerful language, it powers a lot of content on the web but also provides a lot of desktop application environments. It's definitely the language to learn and go with as it has a lot of great programming concepts that you can learn and easily build upon.

PHP is still somewhat new and has a lot of security vulnerabilities (being a new language and all) it can support a good amount and the OOP design in it is decent enough. Definitely easy to learn as well and making dynamic websites but definitely not considered one that is a must know language.

But it all depends on what you plan on doing in the future, PHP as others have mentioned is good for freelance or web development whereas Java is just a good overall language that you can use to base your learning off of for other languages that are utilized in the field.

Or even consider Python!
I always think this way.
PHP = Web
Java = Local
Correct me if I'm wrong?
Cosmoslayer wrote:
I always think this way.
PHP = Web
Java = Local
Correct me if I'm wrong?

Incorrect. Java can be used for web applications as well but not in the sense like PHP. There are various forms of this but the most popular is JavaEE (
I doubt PHP can be taken as a new language. Both langauges Appeared in 17 years ago. (I'm sure you can check this from wiki and other places)

I don't try to compare these 2 languages since both has their good points and bad points. Java is a high level programming language which better suited for enterprise level applications. But For web applications PHP is the best choice.

So If you wanted to be a web developer I think PHP is the best path you can take. For example if you take any of most popular open source scripts you can find on web like all most popular free and commercial forums scripts, Blog scripts and various other open source web applications are coded in PHP. There are plenty of reasons for that.

Almost all web servers use a PHP engine by default. Mainly because this is the most economical way to run a web server. Just check how many web hosting service providers offer Java on their budget packages.

Another thing is PHP is a language very easy to learn. also there are huge free knowledge base you can find around net for this. Goto any programmers or web master forum and throw a question about PHP you will able to get an answer most of the time. You won't get that many answers for things about Java.

Both languages have security vulnerabilities depending on what for you are using it. Also there is the speed factor. JSP is NOT as quick as PHP. This is one big reason why PHP is lot more popular for web applications. A power of language only can be demonstrated by a someone who has a depth knowledge about it.

Well my Java skills are below average. Used the language only for those degree exams and project. But as for PHP I have used it for last 10 years.
To me Java is optimized for creating desktop applications because using it for web based application makes your application not really cross browser compatible. Your users may need to install extra applications for your application to work if they don't have the Java runtime environment. So if you plan to Java, make sure your users will not experience this problem.

If you can do this, then go for Java. If not then PHP is a better option as it is server side application and does not need the user to install anything. Also most web hosts these days, even free web host offer php hosting.

Hope this helps a little.
My impressions of PHP is you use it when you need to work with databases. You use it to input data from an HTML form into a database (like phpMyAdmin MySQL databases). Java and PHP seem to overlap in some areas (like error checking) but I find Java can make things look a lot nicer. But I can't say much more on the topic as I know very little on the subject of Java and I only use PHP for error checking and connecting with databases.
i want to know which one is better a tank or a submarine?

that's what you are asking...
It depends of course, if you want to build a webapp, I would go with neither!
Pretty much everything has been said already. They are both very different languages that are used to fulfill different kinds of tasks. It just depends on what you wish to create and, if you are considering to learn one of them, in which you are the most interested.
pruebasftpph wrote:


I would like to know wich is better, PHP or Java.

What do you think ?

Do you think toward web programming?, if that, PHP and Java, all good for your job, and note that Java language is more difficult then PHP.
Really they shouldn't be compared. PHP is for server-side web programming, or maybe some light-weight scripting (but then you should probably be using Perl). Java can be used for server-side, or it could be used for client-side, or for many, many non-web applications. You want to develop an application fairly rapidly, and have it be cross-platform? Java is probably the way to go.
It is not easy to make just comparisons.
Related topics
Learning Java
Java vs. C++
Ruby(on rails) vs PHP
J2ee vs PHP
Java Servlets vs PHP
Javascript vs PHP (or python?) - unicode text file search
HTML vs PHP pages?
.html vs .php
Where should I start? C++ vs. JAVA
Online test
HELP in deciding over php and java for online test!
Reply to topic    Frihost Forum Index -> Lifestyle and News -> Jobs and Learning

© 2005-2011 Frihost, forums powered by phpBB.