Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: Php: Basic Oop

(486 views • 29 replies)

This topic is 1 page long.

<< < > >>
None

different

Reply To Post Reply & Quote

Posted at: 6/10/07 06:41 PM

different DARK LEVEL 33

Sign-Up: 07/08/04

Posts: 3,746

PHP Main: It's like Christmas come early.

PHP 5 is best for OO.

This is NOT a beginner's tutorial, I expect you should have a strong working knowledge of PHP. I'd say intermediate as I'm only touching on basic OOP functionality. Put all the class code into a file called 'classes.php' and the rest can go in another php file in the same directory.

What is OOP and why should I care?

Ironically this was me a few months back. I was generally confused by OOP, what it was, why the code looked huge, etc. But I gave it a try, and now I'm loving it. It's very much part of my workflow.

So what is it? OOP basically is object orientated, that is to say, you can have multiple instances of the same code in 'objects'. Why is this useful? Well, it makes code extremely reusable.

For example, the app I'm writing has a file with three lines of code in it (I don't count the <?php ?> tags):

<?php
require('classes.php');
$init = new Init();
$init->runApp();
?>

What does this mean? Well, here we're hooking into a class called Init, then calling a function after it, called runApp();

The basic OOP structure for this would be: (note, do NOT copy and paste this, the hyphens are there for a tab replacement)

class Init
{
---function runApp()
---{
------echo "Application successfully ran at " . date("H:m:s");
---}
}

So, there we have a base class. We can obviously add functions to it, and arguments work as normal. Nothing particularly special as of yet, I mean if you removed the class around that code you'd have a basic PHP function.

What's good about OOP is we can have a child class of our initial class, which will inherit/extend our base class. For instance:

class Action extends Init
{
---var $view;
/* In OO it is good practice to define variables that you will use */
---function runApp()
---{
------echo "App is running fine!";
---}
---function viewWin($view)
---{
------echo "Viewing... $view";
---}
}

PHP code:

<?php
require('classes.php');
$action = new Action();
$action->runApp();
$action->viewWin('Programming Forum');
?>

You can imagine this could be useful for an rpg - have the base player class, then define extensions for different species/abilities. PHP will overwrite the base class functions with the function defined in the extension - but if you don't want to overwrite then just don't define the function in the extension.

OO is useful in that functions of a class can call each other, by using the $this-> prefix. For example:

class Operation
{
---var $clean;
---function getWindow()
---{
------$clean = $this->isClean();
------if ($clean == true)
------{
---------echo "Wade hands you a ten dollar bill. 'Good job, friend!'";
------}
------else
------{
---------echo "Wade punches you in the face. 'Get cleaning that window!'";
------}
---}
---function isClean()
---{
------if ($_POST['input'] == "I cleaned the window!")
------{
---------return true;
------}
------else
------{
---------return false;
------}
---}
}
<?php
$op = new Operation();
if (!empty($_POST['input'])) { $op->getWindow(); }
?>

Whew! So this will check whether you've cleaned Wade's window properly (you BETTER have) and attack you if you haven't. :-)

The nice thing here is that I could adapt this script for multiple users - add Tom in to the mix for example, and do the isClean(); function - but have a different getWindow function that would output something else.

OO is also good for turning routine copy/pasting or including into functions you can use more often. For example, you could easily make a database class and use that instead of doing the usual mysql_connect, mysql_query etc.

I suggest you get stuck in and read the more advanced topics in the PHP manual. OO is a much neater, cleaner, more reusable method of coding applications - go for it!

----------

No rabbits were harmed during the making of this. No code has been tested so this is all off the top of my head... :-)

simple & minimal, that's my style.
thoughts on ux, usability & design


None

Mister-Mind

Reply To Post Reply & Quote

Posted at: 6/10/07 06:58 PM

Mister-Mind EVIL LEVEL 07

Sign-Up: 07/01/06

Posts: 2,214

Very interesting and well written tutorial. Congradulations. =)


None

Jon-86

Reply To Post Reply & Quote

Posted at: 6/10/07 07:26 PM

Jon-86 NEUTRAL LEVEL 12

Sign-Up: 01/30/07

Posts: 1,326

Not bad now you just need to extend it and talk about polymorphism a bit.
But if you talk about how to properly test extended classes then that might be more valuble.

Just a though.

It can be annoying trying to debug an extended class when you dont realise you misspelt something and you trying to use functions that dont exist.

PHP Main
BLOGS..! "For people who want to whine, when theirs nobody there to listen"

BBS Signature

None

different

Reply To Post Reply & Quote

Posted at: 6/10/07 07:28 PM

different DARK LEVEL 33

Sign-Up: 07/08/04

Posts: 3,746

Debugging anything with spelling errors is annoying. That's why I proof read code to make sure. :-)

I just wanted this tutorial to be on some of the basics of OO. I hope people will have a go, it's insanely powerful stuff. :-)

simple & minimal, that's my style.
thoughts on ux, usability & design


None

Jon-86

Reply To Post Reply & Quote

Posted at: 6/10/07 07:33 PM

Jon-86 NEUTRAL LEVEL 12

Sign-Up: 01/30/07

Posts: 1,326

Yeah fortunatley for me my spelling mistakes are consistant.
But hes not wrong folks :)

OOP useful stuff and as such, since PHP 5.0 is gathering pace its worth while going back and replacing some procedural code with an object.

PHP Main
BLOGS..! "For people who want to whine, when theirs nobody there to listen"

BBS Signature

None

DFox

Reply To Post Reply & Quote

Posted at: 6/10/07 07:34 PM

DFox LIGHT LEVEL 30

Sign-Up: 08/09/03

Posts: 9,211

I think it's a good tutorial.

I would have really liked to see you talk about things like constructors, destructors, and methods to actually explain more what was going on, being that the title is "Basic Oop"

But yeah, I think it's definitely good for what you actually taught, but could have included more. Nice job though.


None

RPGBandit

Reply To Post Reply & Quote

Posted at: 6/10/07 09:24 PM

RPGBandit EVIL LEVEL 10

Sign-Up: 11/23/06

Posts: 626

Thanks different, that's an awesome tutorial :D.

You've finally inspired me to start doing a good bit more OOP now, so yea, I'm gonna go for it!

Thanks again, awesome tutorial, very explanatory =D


None

Craige

Reply To Post Reply & Quote

Posted at: 6/10/07 11:22 PM

Craige LIGHT LEVEL 08

Sign-Up: 07/17/04

Posts: 3,071

I only ready about half of this tutorial, but to tell you the truth, I didn't like it. It was poorly written.

Take for example:

So what is it? OOP basically is object orientated, that is to say, you can have multiple instances of the same code in 'objects'. Why is this useful? Well, it makes code extremely reusable.

You can't use 'object oriented' in the definition of 'object oriented programming'. And how would anybody who doesn't already know OOP really know what you mean by 'multiple instance of the same code in 'objects'".

I think you should have spent more time on this tutorial. It was very brief, and as already said, poorly written.

Sorry.


None

henke37

Reply To Post Reply & Quote

Posted at: 6/11/07 02:28 AM

henke37 NEUTRAL LEVEL 15

Sign-Up: 09/10/04

Posts: 2,433

For those who want to see a real live world OO php project, check out my irc bot library.

I used to recommend my article about php security, but my server is down, so all I say is: ActionScript version 2 sucks big time! Go learn ActionScript version 3 already!


None

different

Reply To Post Reply & Quote

Posted at: 6/11/07 05:06 AM

different DARK LEVEL 33

Sign-Up: 07/08/04

Posts: 3,746

Okay, I'll revise the tutorial and post here when it's done.

Might be a little while.

simple & minimal, that's my style.
thoughts on ux, usability & design


None

CronoMan

Reply To Post Reply & Quote

Posted at: 6/12/07 05:35 AM

CronoMan EVIL LEVEL 06

Sign-Up: 07/19/04

Posts: 2,456

Meh, what's the use of teaching people OOP PHP, if you want your web application to be OOP, you should consider using another engine, like ASP.NET or Java Server Pages. Much more dynamic, flexible, and the development tools are better.

Trust me ;)

but anyways, a decent tutorial

"no sound in ass"


None

Craige

Reply To Post Reply & Quote

Posted at: 6/12/07 12:21 PM

Craige LIGHT LEVEL 08

Sign-Up: 07/17/04

Posts: 3,071

At 6/12/07 05:35 AM, CronoMan wrote: Meh, what's the use of teaching people OOP PHP, if you want your web application to be OOP, you should consider using another engine, like ASP.NET or Java Server Pages. Much more dynamic, flexible, and the development tools are better.

Trust me ;)

People like the languages they like. I myself am a PHP man, and I use OOP PHP 5 all the time.

You make a language as good as it is by how you use it. No language is designed to be bad, you just have to use them right, and accept their limits. In PHP 4, OOP was horrible, but it has also improved in PHP 5 - to the point where it no more a limit but an option.


None

CronoMan

Reply To Post Reply & Quote

Posted at: 6/13/07 07:47 AM

CronoMan EVIL LEVEL 06

Sign-Up: 07/19/04

Posts: 2,456

At 6/12/07 12:21 PM, Craige wrote: People like the languages they like. I myself am a PHP man, and I use OOP PHP 5 all the time.

I personally prefer C#/ASP.NET to PHP, it's alot more robust, alot faster and you're not limited in any way. Besides, there is no development environment that come close to the functionality and comfort of Visual Studio... Especially the debugger. You can even debug javascripts if you use IE to test the site (and by debug, I don't mean that it just tells you where the error is (heh, a functionality that has escaped JSP) but also all the debug information you could ever need... variables, objects, post/get data etc.). On big projects, the right tools are extremely essential, so you won't use several minutes just figuring out why you get an error in the first place.
Most people here are "PHP-men", and my guess is that it's because most of the people here haven't ever touched anything else in their entire lifespan, correct me if I'm wrong :P It's kind of hard to know the benefits of another language if you've never actually touched it.
I use PHP all the time, but not for big stuff... only small simple stuff. ASP.NET has so infinately much more functionality. Comparing those two would be like comparing javascript to C++ :)

"no sound in ass"


None

elbekko

Reply To Post Reply & Quote

Posted at: 6/13/07 07:51 AM

elbekko EVIL LEVEL 16

Sign-Up: 07/23/04

Posts: 6,213

PHP can be used however you damn well like really. Want to write a huge application? No problem, just take into consideration that it's interpreted and you'll have to do some low-level stuff yourself.

I prefer PHP for web development, although I must admit I've never really touched the ASP side of C#. Biggest reason for that is that it isn't free. And can only run on Windows servers.

"My software never has bugs. It just develops random features. " - Unknown

[ PHP: Main | Omigod, a blog ]

BBS Signature

None

Momo-the-Monkey

Reply To Post Reply & Quote

Posted at: 6/13/07 08:05 AM

Momo-the-Monkey EVIL LEVEL 28

Sign-Up: 10/15/05

Posts: 3,096

As for what Crono-Man said:
Yes, I did happen to start myself with HTML and ASP.NET. But before I sunk to deep, I was afraid I was getting confused to easily. So I did a bit of research, and found that PHP was simpler to understand, because that their are fewer words.

I haven't gotten back into ASP or ASP.NET because I want to learn each language to it's fullest extent, and not a million languages that I can code half an app in and say I can't do more. I know it will take an extraordinarily long amount of time to learn these, but if I just stick to learning a couple (ASP(.NET), C++, C#, PHP, and maybe a few more) I can learn them with intensive care, instead of quick paced wanting to move on to the next one....

Not to say any other language is by far "downgraded" and that php is better, I just found it was MUCH easier to learn for someone who has never touched the stuff before. Now because of my previous experiences with php, I know all about functions, if-else, for-loops, while-loops, foreach, ect...

OK!! Back on topic:
I do agree more things should have been added to the tutorial, but this got me going and motivated on starting to finally learn OOP. Tried it once, but the tutorial(s) I found weren't too great. :/

You should see Gir's Soundboard...
{ PHP: Main | | Java: Main }
Every Villian Is Lemons

BBS Signature

None

CronoMan

Reply To Post Reply & Quote

Posted at: 6/14/07 03:09 PM

CronoMan EVIL LEVEL 06

Sign-Up: 07/19/04

Posts: 2,456

At 6/13/07 07:51 AM, elbekko wrote: I prefer PHP for web development, although I must admit I've never really touched the ASP side of C#. Biggest reason for that is that it isn't free. And can only run on Windows servers.

Aha ha! you're wrong, ASP is completely free ;) so is IIS
The great thing about windows servers is that you only pay for the operating system licenses. Nothing else. .NET is completely free, and so is the web server. You can even use a free version of MSSQL on your webserver for personal use.
I'm guessing you have Windows XP... have you ever looked at the "Add windows component" in add/remove programs? You might find some interesting stuff there ;)

"no sound in ass"


None

DFox

Reply To Post Reply & Quote

Posted at: 6/14/07 03:50 PM

DFox LIGHT LEVEL 30

Sign-Up: 08/09/03

Posts: 9,211

At 6/14/07 03:09 PM, CronoMan wrote: Aha ha! you're wrong, ASP is completely free ;) so is IIS

No they aren't and you said it yourself. You must buy the operating system to use ASP/ASP.NET. That's not free. They are simply included in the cost of the operating system. PHP is free because I pay the PHP project $0 to use it. If I want to use ASP I pay Microsoft $x to buy their operating system, which comes with ASP. So yeah, I think your definition of free is pretty off-base.

At 6/13/07 07:47 AM, CronoMan wrote: I personally prefer C#/ASP.NET to PHP, it's alot more robust, alot faster and you're not limited in any way.

You clearly don't know what you're saying. How in the world are you LIMITED with PHP? There are TONS more libraries available for PHP including tons of open source scripts, classes, and everything. Also, I don't buy the ASP.NET is faster argument. Show me asp.net in a production environment against PHP in a production environment and let's see the speed difference. Doesn't seem like PHP is having performance problems on Newgrounds, Digg, Youtube, etc.

ASP.NET has so infinately much more functionality.

Again, when you stay stuff like that it's clear you don't know what you're talking about. Name ONE thing you can do with ASP.NET that you can't achieve with PHP. And stuff like form controls =/= functionality. Features are not functionality. Functionality is the end result.


None

elbekko

Reply To Post Reply & Quote

Posted at: 6/14/07 03:56 PM

elbekko EVIL LEVEL 16

Sign-Up: 07/23/04

Posts: 6,213

At 6/14/07 03:09 PM, CronoMan wrote:
At 6/13/07 07:51 AM, elbekko wrote: I prefer PHP for web development, although I must admit I've never really touched the ASP side of C#. Biggest reason for that is that it isn't free. And can only run on Windows servers.
Aha ha! you're wrong, ASP is completely free ;) so is IIS
The great thing about windows servers is that you only pay for the operating system licenses. Nothing else.

Yes, and how much is that then? Please do tell me the cost of a Windows Server license for say a company with 100 servers. Now tell me the same but with Apache and PHP on Linux/Unix.

.NET is completely free, and so is the web server. You can even use a free version of MSSQL on your webserver for personal use.

Could very well be. IIS is a pain to use when you want to run PHP too, and I bet it won't like running alongside Apache.

I'm guessing you have Windows XP... have you ever looked at the "Add windows component" in add/remove programs? You might find some interesting stuff there ;)

I've seen it. Actually, I tried setting up IIS when I first started with PHP, but it didn't quite work out. I might try again someday, if I decide to look into ASP (might want to have some knowledge of that when going to look for a job).

"My software never has bugs. It just develops random features. " - Unknown

[ PHP: Main | Omigod, a blog ]

BBS Signature

None

CronoMan

Reply To Post Reply & Quote

Posted at: 6/14/07 04:14 PM

CronoMan EVIL LEVEL 06

Sign-Up: 07/19/04

Posts: 2,456

At 6/14/07 03:56 PM, elbekko wrote:
At 6/14/07 03:09 PM, CronoMan wrote:
At 6/13/07 07:51 AM, elbekko wrote: I prefer PHP for web development, although I must admit I've never really touched the ASP side of C#. Biggest reason for that is that it isn't free. And can only run on Windows servers.
Aha ha! you're wrong, ASP is completely free ;) so is IIS
The great thing about windows servers is that you only pay for the operating system licenses. Nothing else.
Yes, and how much is that then? Please do tell me the cost of a Windows Server license for say a company with 100 servers. Now tell me the same but with Apache and PHP on Linux/Unix.

All in all, a company won't benefit from free software like Linux, basically because you need "special people" to set it up and manage it. Which is fucking expensive. And setting up Linux and Apache, takes alot longer than setting up a Windows Server 2003 with IIS
so all in all, a company will probably lose money on setting up a Linux webserver, contra a windows server. You see, any douchebag can manage Windows 2003 and IIS. The same is not true for linux and apache. At least not set it up well.

.NET is completely free, and so is the web server. You can even use a free version of MSSQL on your webserver for personal use.
Could very well be. IIS is a pain to use when you want to run PHP too, and I bet it won't like running alongside Apache.

You can't bind two listening sockets to the same port, so yes :P
Regarding PHP and pain; installation of PHP on IIS is just double-clicking the setup-file.
If this doesn't work, just add a filter for .PHP, which uses either php-isap.dll, or php-cgi-exe.
it's easy as hell, people just tend to skip right to apache, even though there will be less pain associated with IIS if you just take 5 seconds getting into it :P
And did you install the gui for it? iis.msc? without the guii, it's as retarded as apache :P

I'm guessing you have Windows XP... have you ever looked at the "Add windows component" in add/remove programs? You might find some interesting stuff there ;)
I've seen it. Actually, I tried setting up IIS when I first started with PHP, but it didn't quite work out. I might try again someday, if I decide to look into ASP (might want to have some knowledge of that when going to look for a job).

IIS is alot simpler to install, configure and manage than Apache, no doubt about it. I don't know why Apache is so popular even on windows platforms, where there is an obvious superior solution :P
In professional businesses, they tend to use either ASP.NET or JSP. You won't see many big businesses using PHP, so getting into ASP.NET and JSP could be a wise career choice :) at least it was for me :)

"no sound in ass"


None

phyconinja

Reply To Post Reply & Quote

Posted at: 6/14/07 04:54 PM

phyconinja EVIL LEVEL 25

Sign-Up: 09/18/04

Posts: 2,835

nice tutorial. I think maybe I should use this in my current project.

At 6/12/07 12:21 PM, Craige wrote: No language is designed to be bad, you just have to use them right, and accept their limits.

Not brainfuck. Its designed for confusing programmers.
=P


None

elbekko

Reply To Post Reply & Quote

Posted at: 6/14/07 04:57 PM

elbekko EVIL LEVEL 16

Sign-Up: 07/23/04

Posts: 6,213

At 6/14/07 04:54 PM, phyconinja wrote: Not brainfuck. Its designed for confusing programmers.
=P

I think brainfuck was designed to see how far they could take having as less operators as possible for a Turing-complete language.

"My software never has bugs. It just develops random features. " - Unknown

[ PHP: Main | Omigod, a blog ]

BBS Signature

None

Pilot-Doofy

Reply To Post Reply & Quote

Posted at: 6/14/07 11:32 PM

Pilot-Doofy LIGHT LEVEL 37

Sign-Up: 09/13/03

Posts: 12,298

At 6/10/07 07:34 PM, DFox wrote: I would have really liked to see you talk about things like constructors, destructors, and methods to actually explain more what was going on, being that the title is "Basic Oop"

I agree. I wish you had also touched on public, private, and protected prefixes. I don't think that's an advanced concept, and they're pretty common.

I personally think OOP is something that is learned best by experience. I never found anyone who sufficiently describes OOP with words.

holy jesus what are these goddamn animals


None

VigilanteNighthawk

Reply To Post Reply & Quote

Posted at: 6/15/07 01:55 AM

VigilanteNighthawk LIGHT LEVEL 03

Sign-Up: 02/13/03

Posts: 1,129

At 6/14/07 04:14 PM, CronoMan wrote:
At 6/14/07 03:56 PM, elbekko wrote:
At 6/14/07 03:09 PM, CronoMan wrote:
At 6/13/07 07:51 AM, elbekko wrote:
All in all, a company won't benefit from free software like Linux, basically because you need "special people" to set it up and manage it. Which is fucking expensive. And setting up Linux and Apache, takes alot longer than setting up a Windows Server 2003 with IIS
so all in all, a company will probably lose money on setting up a Linux webserver, contra a windows server. You see, any douchebag can manage Windows 2003 and IIS. The same is not true for linux and apache. At least not set it up well.

Bull. I installed a LAMP on my box preconfigured by clicking on the necessary Apache, Mysql, and PHP in Synaptic in Ubuntu. I could have installed it on my headless samba box right off the server installation cd.

As for the cost of IT staff, do you really think any idiot is going to be able to manage a server farm? It's going to take "special people" no matter the OS/software. It's one thing to host a site off a box at home, but it's entirely different to manage an array of servers, especially if you are running other services on the network. It's also going to take "special people" to make sure that everything is secure. Don't tell me you just magically pop in the install cd, and then everything is hacker proof. I wouldn't even give such credit to netBsd or Linux, let alone a windows box. It takes those "special people" to make sure that the servers are secure and that they aren't opening any holes to other services on the network as well. The majority of these "special people" will also be fairly versed with some sort of *nix system anyway.

::

Regarding PHP and pain; installation of PHP on IIS is just double-clicking the setup-file.

Wow, check a box and automatic download and install.

If this doesn't work, just add a filter for .PHP, which uses either php-isap.dll, or php-cgi-exe.

Already configured.

it's easy as hell, people just tend to skip right to apache, even though there will be less pain associated with IIS if you just take 5 seconds getting into it :P
And did you install the gui for it? iis.msc? without the guii, it's as retarded as apache :P

Wow, like I said before, clicked three packages in Synaptic, and I was ready to go. That said, any IT person is going to be able to handle the command line and config files, and there are also web admin panels for apache configuration as well, as well as a gui for mysql administration. Still, most sys admins won't have a problem with the command line, and many prefer it because GUI's use resources! Yes, that's right, that blessed GUI you worship so much takes resources that could be used for actual processes. That's why I chose to administer my samba box via openSSH and didn't bother installing freenx on it. Your typical sys admin should be able to handle this.

IIS is alot simpler to install, configure and manage than Apache, no doubt about it. I don't know why Apache is so popular even on windows platforms, where there is an obvious superior solution :P

Ok, then, pull up some benchmarks then. Just because something is easy to install DOESN'T automatically make it the best solution. Being easy to install and easy to maintain are two different things. Linux is harder to get setup, but its certainly easier to maintain (at least it is for me), than windows. I don't have to defrag. I don't have to worry about so many viruses. I get the safety of having a separate admin account without having to log out of my regular account just to change some settings or install some software. Also, how many platforms will ISS run on? How many processor architectures? Apache can run on just about any system since it can be compiled not only for windows but also any *nix system (which in turn can run a much broader array of hardware architectures).


None

CronoMan

Reply To Post Reply & Quote

Posted at: 6/15/07 02:54 AM

CronoMan EVIL LEVEL 06

Sign-Up: 07/19/04

Posts: 2,456

At 6/15/07 01:55 AM, VigilanteNighthawk wrote:
At 6/14/07 04:14 PM, CronoMan wrote:
At 6/14/07 03:56 PM, elbekko wrote:
At 6/14/07 03:09 PM, CronoMan wrote:
At 6/13/07 07:51 AM, elbekko wrote:
All in all, a company won't benefit from free software like Linux, basically because you need "special people" to set it up and manage it. Which is fucking expensive. And setting up Linux and Apache, takes alot longer than setting up a Windows Server 2003 with IIS
so all in all, a company will probably lose money on setting up a Linux webserver, contra a windows server. You see, any douchebag can manage Windows 2003 and IIS. The same is not true for linux and apache. At least not set it up well.
Bull. I installed a LAMP on my box preconfigured by clicking on the necessary Apache, Mysql, and PHP in Synaptic in Ubuntu. I could have installed it on my headless samba box right off the server installation cd.

As for the cost of IT staff, do you really think any idiot is going to be able to manage a server farm? It's going to take "special people" no matter the OS/software. It's one thing to host a site off a box at home, but it's entirely different to manage an array of servers, especially if you are running other services on the network. It's also going to take "special people" to make sure that everything is secure. Don't tell me you just magically pop in the install cd, and then everything is hacker proof. I wouldn't even give such credit to netBsd or Linux, let alone a windows box. It takes those "special people" to make sure that the servers are secure and that they aren't opening any holes to other services on the network as well. The majority of these "special people" will also be fairly versed with some sort of *nix system anyway.

If an idiot is able to manage a server farm? If it's an educated idiot; yes.
The company I currently work on, base all their stuff on Microsoft products.. mainly. You see, it's a business, they don't really care what systems they use. They want the most cost-efficient and reliable system. I mean, they're not idiots

Regarding PHP and pain; installation of PHP on IIS is just double-clicking the setup-file.
Wow, check a box and automatic download and install.

And if you need to add a module? You'll need to recompile or redownload PHP binaries, won't you?

If this doesn't work, just add a filter for .PHP, which uses either php-isap.dll, or php-cgi-exe.
Already configured.

Then what are you going on about? :P

it's easy as hell, people just tend to skip right to apache, even though there will be less pain associated with IIS if you just take 5 seconds getting into it :P
And did you install the gui for it? iis.msc? without the guii, it's as retarded as apache :P
Wow, like I said before, clicked three packages in Synaptic, and I was ready to go. That said, any IT person is going to be able to handle the command line and config files, and there are also web admin panels for apache configuration as well, as well as a gui for mysql administration. Still, most sys admins won't have a problem with the command line, and many prefer it because GUI's use resources! Yes, that's right, that blessed GUI you worship so much takes resources that could be used for actual processes. That's why I chose to administer my samba box via openSSH and didn't bother installing freenx on it. Your typical sys admin should be able to handle this.

Resources... GUI uses resources? How much? Check and see exactly how much resources a GUI application uses.. All in all it won't be of any significance at all. The web admin stuff you have for Apache and MySQL are mainly made by amateurs. Most (if not all) are incomplete and bug-ridden.
I chose to administer my server with Remote Desktop. Yippie, I can even play winamp remotely while administrating ;)
What you don't seem to get is that Linux is on its way out. Less people skip to linux and stay with Windows or MacOS. Why is this you think? Coincidence?
My dad started a company once, called Hatrix. They specialized in Linux. Problem was that they couldn't make it go around. Why not? Because things that took 1 day to set up in windows took three highly educated, well experienced engineers 5 days (And I mean; all three of them have masters in computer science, and they've been working with Unix and Windows for over 20 years). And they couldn't demand any more money than the leading brand, right?

IIS is alot simpler to install, configure and manage than Apache, no doubt about it. I don't know why Apache is so popular even on windows platforms, where there is an obvious superior solution :P
Ok, then, pull up some benchmarks then.

Verisign - Microsoft Windows Server 2003 with Internet Information Services (IIS) 6.0 vs. Linux Competitive Web Server Performance Comparison
Microsoft Windows Server vs. Red Hat Enterprise Linux: Cost of Acquisition and Support: A Comparison
Study: Win Server 2003 Has Fewer Vulnerabilities Over Time Than Two Leading Linux Enterprise Distributions
Tests Show Windows Server Environment More Reliable and Easier to Manage

Just because something is easy to install DOESN'T automatically make it the best solution. Being easy to install and easy to maintain are two different things. Linux is harder to get setup, but its certainly easier to maintain (at least it is for me), than windows. I don't have to defrag. I don't have to worry about so many viruses. I get the safety of having a separate admin account without having to log out of my regular account just to change some settings or install some software. Also, how many platforms will ISS run on? How many processor architectures? Apache can run on just about any system since it can be compiled not only for windows but also any *nix system (which in turn can run a much broader array of hardware architectures).

How many processor and hardware architectures do you think people use? Especially for webservers. Of course nobody will buy a computer server with specialized hardware, don't you see how stupid that would be? :P
And of course, IIS is made for Windows Server. Windows only runs on 386+ architecture.
But why would that matter? No web servers run on any other architecture anyway. And talking about hardware; windows supports an infinite bigger array of hardware than linux.

"no sound in ass"


None

VigilanteNighthawk

Reply To Post Reply & Quote

Posted at: 6/15/07 04:24 AM

VigilanteNighthawk LIGHT LEVEL 03

Sign-Up: 02/13/03

Posts: 1,129

At 6/15/07 02:54 AM, CronoMan wrote:
At 6/15/07 01:55 AM, VigilanteNighthawk wrote:
At 6/14/07 04:14 PM, CronoMan wrote:
At 6/14/07 03:56 PM, elbekko wrote:
At 6/14/07 03:09 PM, CronoMan wrote:
At 6/13/07 07:51 AM, elbekko wrote:
All in all, a company won't benefit from free software like Linux, basically because you need "special people" to set it up and manage it. Which is fucking expensive. And setting up Linux and Apache, takes alot longer than setting up a Windows Server 2003 with IIS
If an idiot is able to manage a server farm? If it's an educated idiot; yes.
The company I currently work on, base all their stuff on Microsoft products.. mainly. You see, it's a business, they don't really care what systems they use. They want the most cost-efficient and reliable system. I mean, they're not idiots

And there are a lot that are moving to linux. They don't really care either. The fact of the matter is that Linux can be customized to do things windows can't or won't allow. There are simply more options that don't have the licensing requirements. As for reliability, Windows servers need to be restarted after every updated, linux servers don't. They have longer uptimes. Their file systems don't need to be defragged.


Regarding PHP and pain; installation of PHP on IIS is just double-clicking the setup-file.
Wow, check a box and automatic download and install.
And if you need to add a module? You'll need to recompile or redownload PHP binaries, won't you?

No. At worst I'd have to add one line to a configuration file.


If this doesn't work, just add a filter for .PHP, which uses either php-isap.dll, or php-cgi-exe.
Already configured.
Then what are you going on about? :P

Just showing you how full of it you are about apache being so hard to configure anymore. I have no doubt that IIS is easy to install, but a LAMP can be running in 20 minutes if you don't set up a firewall.

What you don't seem to get is that Linux is on its way out. Less people skip to linux and stay with Windows or MacOS. Why is this you think? Coincidence?

First of all, we are talking about servers, not DESKTOPS. I'll agree that most people can't handle nor should they have to handle linux on the desktop. On the other hand, I wouldn't say linux on the desktop is going to simply disappear. There are more distros out there with more hardware support and increasingly simpler administration. I don't predict it will ever take down windows or mac, but its not going to vanish either. Just because you don't like it doesn't mean it's going to go anywhere.

My dad started a company once, called Hatrix. They specialized in Linux. Problem was that they couldn't make it go around. Why not? Because things that took 1 day to set up in windows took three highly educated, well experienced engineers 5 days (And I mean; all three of them have masters in computer science, and they've been working with Unix and Windows for over 20 years). And they couldn't demand any more money than the leading brand, right?

Ever hear of a company called RedHat? Your father's inability to turn a profit is no indication of the profitability of Linux. If we were to use this line of reasoning, then oil must not be profitable because George W. Bush sank an oil company.

With IBM, Novell, and HP backing it, I really doubt its on its way out. Yeah, stuff takes longer to configure, and then its up longer and is more secure. Guess what google is running their stuff on. Linux is hardly on its way out, and *nix systems definitely aren't. The market trends for the past five years at least indicate that it's well holding its own against MS in the server market (and yes, it's a totally different market) if not killing it. It's slaying in the embedded device market because manufacturers can alter the code if necessary as opposed to paying a king's ransom to peek at the MS code. It's also being deployed for use in clustering with the modified MOSIX cluster (where you can run any app clustered without modification. The kernel itself has been modified.), especially in Hollywood firms where resources are a must. I'm not going to make the idiotic claim that Windows is going anywhere, but you are really full of it here.

At any rate, how long ago was it that your father ran this company? Things have changed a lot in even the past year. Last year I couldn't get a damn distro to run on my dell. Now, I run Ubuntu almost exclusively. That is with wireless ethernet, webcam, and wacom tablet. I also set up a samba share on an old box for my home network. Linux isn't going anywhere. I hardly see it kicking Windows off the desktop any time soon, but I will safely predict that Linux will be here and still going strong five years from now.


IIS is alot simpler to install, configure and manage than Apache, no doubt about it. I don't know why Apache is so popular even on windows platforms, where there is an obvious superior solution :P
Ok, then, pull up some benchmarks then.
Verisign - Microsoft Windows Server 2003 with Internet Information Services (IIS) 6.0 vs. Linux Competitive Web Server Performance Comparison
Microsoft Windows Server vs. Red Hat Enterprise Linux: Cost of Acquisition and Support: A Comparison
Study: Win Server 2003 Has Fewer Vulnerabilities Over Time Than Two Leading Linux Enterprise Distributions
Tests Show Windows Server Environment More Reliable and Easier to Manage

Now try linking to a nonMS site. I willing to accept that windows could be faster, but don't take me for some sort of complete idiot here. If I pulled up a slew of studies commissioned by RedHat, would you honestly buy them?



How many processor and hardware architectures do you think people use? Especially for webservers. Of course nobody will buy a computer server with specialized hardware, don't you see how stupid that would be? :P

So I'm guessing Sun's wouldn't use their sparc processors (though they'd likely run solaris). Apple wouldn't consider using their processor set back in the day?

And of course, IIS is made for Windows Server. Windows only runs on 386+ architecture.
But why would that matter? No web servers run on any other architecture anyway. And talking about hardware; windows supports an infinite bigger array of hardware than linux.

Actually, their was an article at one point recommending Mac's with PowerPC processors to run a web server, but I digress. At any rate run Windows natively on PowerPPC and Sparc processors. Try it. It supports a much larger number of processor sets. Yeah, on the desktop Windows supports more PC hardware, but it doesn't support other processor specs.


None

DFox

Reply To Post Reply & Quote

Posted at: 6/15/07 10:48 AM

DFox LIGHT LEVEL 30

Sign-Up: 08/09/03

Posts: 9,211

At 6/15/07 02:54 AM, CronoMan wrote: If an idiot is able to manage a server farm? If it's an educated idiot; yes.
The company I currently work on, base all their stuff on Microsoft products.. mainly. You see, it's a business, they don't really care what systems they use. They want the most cost-efficient and reliable system. I mean, they're not idiots

Yeah, it was like that but it's moving away from it. I interned with a fortune 100 company (they are actually ranked #37 right now) 2 summers. When I first got there, they were using all Windows based servers and ASP was their standard. There were NO Linux based systems and using PHP there was simply unheard of and forbidden as it wasn't an approved technology. On my way out, about 2 years later, PHP was being fully tested and being researched because they were looking to switch to it. They were also looking at MySQL to replace or go along side their mssql standard. So maybe Microsoft products USED to be the most cost efficient and reliable choice, but now companies are thinking twice. And this company I'm talking about here isn't a technology company or in that related field. I'm talking about a company where people's lives hinder on how well their infrastructure functions. If you go into the tech companies such as Youtube, even more of those are making the switch.


None

CronoMan

Reply To Post Reply & Quote

Posted at: 6/19/07 10:15 AM

CronoMan EVIL LEVEL 06

Sign-Up: 07/19/04

Posts: 2,456

At 6/15/07 04:24 AM, VigilanteNighthawk wrote:
Ever hear of a company called RedHat? Your father's inability to turn a profit is no indication of the profitability of Linux. If we were to use this line of reasoning, then oil must not be profitable because George W. Bush sank an oil company.

With IBM, Novell, and HP backing it, I really doubt its on its way out. Yeah, stuff takes longer to configure, and then its up longer and is more secure. Guess what google is running their stuff on. Linux is hardly on its way out, and *nix systems definitely aren't. The market trends for the past five years at least indicate that it's well holding its own against MS in the server market (and yes, it's a totally different market) if not killing it. It's slaying in the embedded device market because manufacturers can alter the code if necessary as opposed to paying a king's ransom to peek at the MS code. It's also being deployed for use in clustering with the modified MOSIX cluster (where you can run any app clustered without modification. The kernel itself has been modified.), especially in Hollywood firms where resources are a must. I'm not going to make the idiotic claim that Windows is going anywhere, but you are really full of it here.

At any rate, how long ago was it that your father ran this company? Things have changed a lot in even the past year. Last year I couldn't get a damn distro to run on my dell. Now, I run Ubuntu almost exclusively. That is with wireless ethernet, webcam, and wacom tablet. I also set up a samba share on an old box for my home network. Linux isn't going anywhere. I hardly see it kicking Windows off the desktop any time soon, but I will safely predict that Linux will be here and still going strong five years from now.

It was some years ago, but as far as my experience goes, it's still a problem
Yesterday, I was to set up a linux mail gateway. Which seemed like a pretty forward task.
Problem was that I must have been running "the wrong distro" (even though it was recommended by Kaspersky labs). Actually, the installation of Kaspersky went smoothly, but one of their retard retailers went on holiday, so we didn't get the license "in time", so we changed to some pre-built hardware. But before we did that, I tried to install Spamassassin. Which was as close to impossible as it gets. Thing is, there is no such thing as a standard on linux. People use whatever the hell they want, and there is no such thing as backward compatibility, so some components you download might rely on a specific version of another component (in this case, a PERL library). I had 1.5.0.2 of some component, but the application had to have 1.5.0. So I renamed the library (which I thought "oh but this one is newer, I'll run with that one", which "obviously" was the wrong way.) which fucked up. So I thought to myself "let's download it". Which proved to be a big hassle.
1st problem : it was in cvs only on the original website. This is a server, I don't have cvs.
2nd problem : I found an alternative package, but it was in .tar.gz, I was using a Redhat distro, so I needed to use .rpm. The page says "If you need rpm, you can easily build the rpm with rpmbuild". Sounds easy enough? Well, no. As I said before, this is a server, I shouldn't need rpmbuild, so the person that installed the server hadn't included it, or it wasn't included in the distro or whatnot.
3rd problem : I guess I'll download rpmbuild then. Err, for some reason linux nerds think that it is EXTREMELY vital that people download the source and compile it. So, no binaries are available. But I could compile it? No I can't because I'm missing alot of the libraries. And trying to download manually the correct libraries is close to impossible, because all of those libraries depend on other libraries, and to make them work, you'll need more or less everything. And of course, I would need the correct version, not a newer one, or older one.

This is stuff that makes it close to impossible for normal users to manage a server. Even an advanced linux admin would encounter alot of problems and waste alot of the company's available resources, and of course the vital part: money.
I have about $20 an hour. I spent 7,5 hours finding out that this was a waste of time.
That single day cost the company (and earned me) $150.

IIS is alot simpler to install, configure and manage than Apache, no doubt about it. I don't know why Apache is so popular even on windows platforms, where there is an obvious superior solution :P
Ok, then, pull up some benchmarks then.
Verisign - Microsoft Windows Server 2003 with Internet Information Services (IIS) 6.0 vs. Linux Competitive Web Server Performance Comparison
Microsoft Windows Server vs. Red Hat Enterprise Linux: Cost of Acquisition and Support: A Comparison
Study: Win Server 2003 Has Fewer Vulnerabilities Over Time Than Two Leading Linux Enterprise Distributions
Tests Show Windows Server Environment More Reliable and Easier to Manage
Now try linking to a nonMS site. I willing to accept that windows could be faster, but don't take me for some sort of complete idiot here. If I pulled up a slew of studies commissioned by RedHat, would you honestly buy them?

I don't think that MS is allowed to lie about their operating system and web servers..
Think how many lawsuits and angry people that would make.
And all those benchmarks are made by 3rd party companies (like verisign)

I'd rather trust that than "the word on the street"



How many processor and hardware architectures do you think people use? Especially for webservers. Of course nobody will buy a computer server with specialized hardware, don't you see how stupid that would be? :P
So I'm guessing Sun's wouldn't use their sparc processors (though they'd likely run solaris). Apple wouldn't consider using their processor set back in the day?

I don't know any facts about the usage of SPARC processors, but I'm guessing the numbers are pretty low

And of course, IIS is made for Windows Server. Windows only runs on 386+ architecture.
But why would that matter? No web servers run on any other architecture anyway. And talking about hardware; windows supports an infinite bigger array of hardware than linux.
Actually, their was an article at one point recommending Mac's with PowerPC processors to run a web server, but I digress. At any rate run Windows natively on PowerPPC and Sparc processors. Try it. It supports a much larger number of processor sets. Yeah, on the desktop Windows supports more PC hardware, but it doesn't support other processor specs.

I'll reply more later, workday over :P have to drive home

"no sound in ass"


None

Pilot-Doofy

Reply To Post Reply & Quote

Posted at: 6/19/07 12:07 PM

Pilot-Doofy LIGHT LEVEL 37

Sign-Up: 09/13/03

Posts: 12,298

For the love of some deity high in the sky, start shortening the quotes.

holy jesus what are these goddamn animals


None

VigilanteNighthawk

Reply To Post Reply & Quote

Posted at: 6/19/07 12:39 PM

VigilanteNighthawk LIGHT LEVEL 03

Sign-Up: 02/13/03

Posts: 1,129

At 6/19/07 10:15 AM, CronoMan wrote:
At 6/15/07 04:24 AM, VigilanteNighthawk wrote:
It was some years ago, but as far as my experience goes, it's still a problem
Yesterday, I was to set up a linux mail gateway. Which seemed like a pretty forward task.
. But before we did that, I tried to install Spamassassin. Which was as close to impossible as it gets. Thing is, there is no such thing as a standard on linux. People use whatever the hell they want, and there is no such thing as backward compatibility, so some components you download might rely on a specific version of another component (in this case, a PERL library).

Ah, a fair point. There is the Linux Standard Base Project and the Portland Project that are trying to rectify the situation. Did you distro have a package management system? On my distro (Ubuntu), the majority of the programs I want are either in a repository, and many have a repository that I can add. Normally, the repository maintainers will take care of all dependency issues which are resolved via the package manager which automatically downloads and installs all of the dependencies. I've even had it work with .deb files that were built for Ubuntu where it downloaded the dependencies required by the .deb and installed them.

2nd problem : I found an alternative package, but it was in .tar.gz, I was using a Redhat distro, so I needed to use .rpm. The page says "If you need rpm, you can easily build the