August, 2008


11
Aug 08

Why implement PHP in Java?

First of all, why not? Everything else can run on the jvm (yes… even c#), so why not php? Well… I certainly don’t see why not… Java is a fairly robust language with a pile of different libraries and (as you saw if you clicked on any of those links) languages that can run on it. It is ideal!

Don’t like php’s random function? Why not use Java’s? Not your cup of tea? Use ruby’s instead, or python’s, orĀ  write one in COBOL if you are really brave.

It also means that you can implement the functionality in Java, the database transactions in Ruby, then write all of the presentation in PHP, no clearer MVC separation than that eh? Admitedly it might get a bit confusing and I may be over exaggerating about the possibility of these implementation’s cross communication abilities… but it would be great if you could (I might test it later…).

http://www.caucho.com/resin-3.0/quercus/index.xtp

Go check it out!


8
Aug 08

Twitter Updates for 2008-08-08

  • Now that I moved almost everything of Hanah’s from one place to another, and she didn’t want me to move the rest… now she figures I can… #

6
Aug 08

Xampp Virtual Hosts

One of the tools in my tool box is xampp, which seems to work better than trying to install everything bit by bit (at least it did at work). One thing I never considered was setting up virtual hosts for each project, I always worked from a folder so that to access the site I went to:


http://localhost/sitename

That is fine, but what happens when you are working with a site that needs to be the root site (ie: it has links like /page_name.php which bounce you out to the root)? In that case you need to set up a virtual server. In xampp they have separated the files out to ‘make it easier’ on a user to find what they want. Sometimes this is not the case… so here is how to setup a virtual server (at least it worked for me) on Windows Vista (and XP, and with some small modifications Linux and Mac as well).

Find the httpd-vhosts.conf file, it should be:

    C:\xampp\apache\conf\extra\http-vhosts.conf

if you installed it in the default location.

Then go to the bottom of that file and add:

<VirtualHost *:80>
  ServerName http://sitename.127.ca
  DocumentRoot C:\xampp\htdocs\sitename
</VirtualHost>

if that doesnt work, then there might be something in the http.conf files that is stopping access to that folder, in that case, add

 <Directory C:\xampp\htdocs\sitename>
    IndexOptions +FancyIndexing NameWidth=*
    Options Includes FollowSymLinks Indexes
    AllowOverride All
    Order allow,deny
    Allow from all
 </Directory>

So, you have:

<VirtualHost *:80>
  ServerName http://sitename.127.ca
  DocumentRoot C:\xampp\htdocs\sitename
  <Directory C:\xampp\htdocs\sitename>
    IndexOptions +FancyIndexing NameWidth=*
    Options Includes FollowSymLinks Indexes
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

While you can probably put the site in any folder on your computer, it makes sense organizationally to keep them all in the htdocs folder (at least it does to me…), so that is why the example uses the path

    c:\xampp\htdocs

You should now be able to access your site by going to:


http://sitename.127.ca

For why 127.ca see this site.


5
Aug 08

Twitter Updates for 2008-08-05

  • Traffic is squishy. #

4
Aug 08

Twitter Updates for 2008-08-04

  • Mmm… Liquid Candy #
  • Ummm… NBC really just wanted to show some ass I think…
    http://tinyurl.com/5q69a4 #
  • Cleverly the gallery was called “Cracking the code” #
  • It is amazing that there are 2,098 view on one of my blog posts, but no comments… not even a “This is shit” comment… #