Skip to content

PHP vs. Ruby

by Jackson Miller on January 6th, 2006

It is not fair to compare PHP vs. Rails since one is a language and the other is a full stack application. I haven’t seen very many comparisons of PHP vs. Ruby, but I think I found an interesting way to do a comparison, installation.

Steps for installing Ruby

  1. ./configure
  2. make
  3. make install

Steps for installing PHP

  1. ./configure –help
  2. Write down necessary configuration options and run something like…
  3. ./configure –host=i386-redhat-linux –build=i386-redhat-linux –target=i386-redhat-linux-gnu –prefix=/usr –exec-prefix=/usr –bindir=/usr/bin –sbindir=/usr/sbin –sysconfdir=/etc –datadir=/usr/share –includedir=/usr/include –libdir=/usr/lib –libexecdir=/usr/libexec –localstatedir=/var –sharedstatedir=/usr/com –mandir=/usr/share/man –infodir=/usr/share/info –cache-file=../config.cache –with-config-file-path=/etc –with-config-file-scan-dir=/etc/php.d –enable-force-cgi-redirect –disable-debug –enable-pic –disable-rpath –enable-inline-optimization –with-bz2 –with-db4=/usr –with-curl –with-dom=/usr –with-exec-dir=/usr/bin –with-freetype-dir=/usr –with-png-dir=/usr –with-gd –enable-gd-native-ttf –with-ttf –with-gettext –with-ncurses –with-gmp –with-iconv –with-jpeg-dir=/usr –with-openssl –with-png –with-pspell –with-regex=system –with-xml –with-expat-dir=/usr –with-zlib –with-layout=GNU –enable-bcmath –enable-exif –enable-ftp –enable-magic-quotes –enable-safe-mode –enable-sockets –enable-sysvsem –enable-sysvshm –enable-discard-path –enable-track-vars –enable-trans-sid –enable-yp –enable-wddx –enable-mbstring –enable-mbstr-enc-trans –enable-mbregex –with-pear=/usr/share/pear –with-imap=shared –with-imap-ssl –with-kerberos=/usr/kerberos –with-ldap=shared –with-mysql=shared,/usr –with-pgsql=shared –enable-memory-limit –enable-bcmath –enable-shmop –enable-calendar –enable-dbx –enable-dio –enable-mcal –with-apxs2filter=/usr/sbin/apxs –with-xmlrpc –with-pdo-mysql –with-gettext –with-xmlreader –enable-sockets –with-zlib –with-readline –enable-pcntl –with-xml
  4. wait a long time
  5. if errors:
    1. decipher errors
    2. install dependencies
    3. verify filesystem paths to libraries
    4. GoTo 3
  6. make
  7. make install

This post is a little in jest, especially since you typically only install once or twice. Though install is one of my biggest gripes about PHP.

From → General

21 Comments
  1. One important difference between PHP and Ruby is the culture. Google “Chunky Bacon” to learn more.

  2. Or, if you’re using fedora:

    yum install php

    And, you’re done.

  3. PHP installation is more flexible and configurable, of course

  4. bas permalink

    Ruby – for silly people(whos hands growing out of their ass) ,
    who cant install php propertly.

  5. SpongeBob permalink

    Thats wierd. I installed PHP by double-clicking on the “exe” file. Thats like 2 mouse clicks versus your 27 key presses. God Ruby takes so much work! PHP wins yet again.

  6. Shoaib Meenai permalink

    I recently installed both Apache 2.0.55 and PHP 5.1.2 on my Windows XP Pentium 4. Someone had told me installing both things was hard, but it turned out to be as easy as winking. For Apache, I just had to open the msi file, name the server and I was done. For PHP, I just had to unzip the necessary files and point Apache to those. It was quite easy … I don’t know why you want to issue long commands in a command prompt to install PHP.

  7. CPSCSam permalink

    Seems like PHP is winning because people aren’t smart enough to install Ruby. I don’t use PHP or Ruby, so I’m unbiased.

  8. Dave permalink

    For those of you talking about double clicking this install was most likely done on linux. Ruby, also, has an executable installer for Windows.

    Seriously, why do people never bother using the filter between their brains and their mouths.

  9. Having worked with Java since 1995, .Net since 2000 and PHP since 2003 I find:

    1 – Ruby the language is eary to learn and does not include extensions per se so you dont have to say ‘No, I have not worked with RGL’ and hear ‘Oh so you are not updated on the latest Ruby version’

    2 – The GEM installer has nice features allowing for easy installation of extensions so you dont have to
    struggle with jar files and the GAC

    3 – The RAILS extension produces the dir structure and plumbing to get a web appliation up in a jiffy without
    the need for config.xml or server .xml

    4 – Any toolkit like FOX or QT or TK etc. can be used to make a Ruby fat client application

    5 – Ruby can also be used in place of PERL or SHELLSCRIPT

  10. away and no new traffic should be forwarded cherokee indian language hould generate a removal query. [url=http://stocking8nude.spycams777.com/words.html]cherokee indian language[/url]

  11. Xth-0utlaw permalink

    Installing PHP is hard :(

  12. from that post up there it looks like this site doesn’t properly sanitize input from users.

    Remove all HTML and SQL code from the form before storing its data.

  13. Erik Allik permalink

    Can’t really compare Ruby and PHP either — Ruby is a well-thought-out general purpose programming language/platform with support for anything from shell scripting and web applications to distributed computing, games programming, 3D and domain specific languages/metaprogramming. PHP is just a web application framework/language which is not even good in that (just OK). Some people just try to use it in areas it was not supposed to fit for.

  14. nickesh permalink

    When it comes to installing PHP, I usually do it in a couple of minutes. I also try to install Ruby and RedRails for it – for 2 weeks…

    I agree, that comparing those two languages is senseless. PHP is destinated for web development only and it has realy huge arsenal of librarys, classes and rady-made scripts. In my opinion it’s more flexible and the fact it has C-like syntax is very comfortable for me.
    Ruby has been used much extensively. Web solutions definitely arent’t the only Ruby’s destination, so it is realy hard to compare… Don’t you think, this discussion leads to nowhere?

  15. nickesh permalink

    When it comes to installing PHP, I usually do it in a couple of minutes. I also try to install Ruby and RedRails for it – for 2 weeks…

    I agree, that comparing those two languages is senseless. PHP is destinated for web development only and it has realy huge arsenal of librarys, classes and rady-made scripts. In my opinion it’s more flexible and the fact it has C-like syntax is very comfortable for me.
    Ruby has been used much extensively. Web solutions definitely arent’t the only Ruby’s destination, so it is realy hard to compare… Don’t you think, this discussion leads to nowhere?

  16. nickesh permalink

    When it comes to installing PHP, I usually do it in a couple of minutes. I also try to install Ruby and RedRails for it – for 2 weeks…

    I agree, that comparing those two languages is senseless. PHP is destinated for web development only and it has realy huge arsenal of librarys, classes and rady-made scripts. In my opinion it’s more flexible and the fact it has C-like syntax is very comfortable for me.
    Ruby has been used much extensively. Web solutions definitely arent’t the only Ruby’s destination, so it is realy hard to compare… Don’t you think, this discussion leads to nowhere?

    (http://phplens.com/phpeverywhere/?q=node/view/222)

  17. nickesh permalink

    hey, implement flood preventing on this site.
    I’m sorry, repeting my previous post was an accident…

  18. c.blondel@ewerk.com permalink

    Quoting ‘SpongeBob’ :

    “Thats wierd. I installed PHP by double-clicking on the “exe” file. Thats like 2 mouse clicks versus your 27 key presses. God Ruby takes so much work! PHP wins yet again.”

    Being the admin responsible for running the webservers in a small IT company, I regrettably cannot share your experience…installing or upgrading PHP is a constant pain in the @$$ for me, because our programmers happen to be fond of many extensions. YaST has all the necessary modules in its repository, but well…it’s SuSE :( Otoh the only Unix-like OS that served my needs PHP-wise, without having to compile it by hand is FreeBSD. On non-SuSE Linuces there’s always this or that module that’s not in the repository…..in comparison, with ruby/rails it’s

    * install ruby
    * Set the RUBYOPT envvar to ‘rubygems’ (if it’s not already set bythe installer)
    * gem install rails
    * et voila.

    I compiled both PHP and Ruby by hand several times, and there Ruby is my big winner too. I remember with love (sarcasm added) the day I spent 5 hours trying to find out why the GD extension didn’t activate JPEG support, even though there were no errors and all libraries were installed, only to find out that you need to explicitly set ‘–with-jpeg-dir=/usr/lib” _before_ you set –with-gd…..and that’s not the only oddity I encountered in PHP-installation…..

    And why on earth does PHP4 insist on librpm-devel although php.net says that rpm support is only included in version 5 and then even probably only in CVS ???? Beats me.

    Oh, and on top of that PHP is PHP, and I simply don’t like the language. Ruby is -next to LISP- the only language which is _beautiful_ in addition to being very powerful. Contrast that with the loads of horribly ugly code that abounds in php resources….but ok, there we get into subjective territory ;)

    Take care, Constantijn Blondel, Leipzig DE

  19. Wogu permalink

    First how you can compare Ruby with PHP, its like comparing a PC with HDD, the one is a compleat set of components and the other only a component.
    Second its true that installing upgrading from one version of PHP to another is hard, but the upgrade from one ruby version to another is not an easy yob too.
    When we take PHP + Apache + Smary + PEAR we get something like Ruby on Rails.
    When I compare them 2, i can say only, when i get a problem in my PHP project i can seperate the problem, but whe it is in ruby….its a compeate desaster

  20. cute_gutsy2000 permalink

    Why you always compare between PHP and Ruby … They are both excellent in Web programming. It is up to you guys which is the two web programming language you like and comfortable most. Thanks ….

  21. new_boy permalink

    I find that you can create customise solutions with PHP to different types of applications apart form the standard shopping cart, blog, forums, forms etc… that are provided by most MVCs like Rails, some can even write accounting tools with PHP, such complexity can only be achieved with people with experience in their fields who calls for customised applications that cannot be modified from off the shelf MVCs, it is simply too overwhleming for any MVC tools to provide solution for everything, if the latter being possible, I suppose the person who creates the MVC need to be a GURU in every field :)

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS

Real Time Web Analytics