Cogito, ergo sum

Here's hoping my musings can help you out!

Archive for July, 2009

Setting up Zend Studio (Linux/Ubuntu)

Posted by mnshankar on July 9, 2009

Zend Studio, as you all must be aware, is a full featured PHP IDE. It does require a little setup so your Run/Debug experience is painless (after all, that is the true reason for using an IDE!).

The following assumptions are made:

1. You are running a linux OS
2. You already have a (working) LAMP setup on your workstation (http://localhost takes you to the homepage)

Here’s the process I used to setup zend studio on my system:

1. Download Zend Core. This is REQUIRED for setting breakpoints and debugging web pages. Select “Zend Core V2.5(Win/Linux)”.. Be sure to select either 32 bit or 64 bit depending on the version of OS/apache2 installed.

Install the software (I prefer to be in “su” mode for all install operations).. Copy the downloaded tar file to the /opt directory. Then, run the following commands to install it..

root@ubuntu:/opt# tar -zxvf ZendCore-2.5.2-linux-glibc23-amd64.tar.gz
root@ubuntu:/opt# cd ZendCore-2.5.2-linux-glibc23-amd64
root@ubuntu:/opt/ZendCore-2.5.2-linux-glibc23-amd64# ./install -g

the “-g” option does a graphic install.. Please refer to the instructions (pdf) in the downloaded file. I selected the “Modify apache” option only. You do not require any other components installed.
You will  be prompted for the location of apache on your computer. For some reason, the installer could not autodetect my main web folder (/var/www).. I entered it into the text field provided. A new directory /usr/local/Zend will be setup with appropriate directives in the apache2.conf file.

2. Download and Install Zend Optimizer. Be sure to select the 32/64 bit version depending on your OS. Zend Optimizer enhances the running speed of php apps. The ZendCore front-end requires this to be installed. Since it is free, we do not complain!

Copy the download file over to the /opt directory
Uncompress/extract the file (tar -zxvf same as in step 1)
Navigate into the directory that is created
Run the install script by using “sudo ./install”
You will be prompted for the location of apache, php.ini file etc (it is a graphic installer).. finally it comes back with a confirmation that the setup is complete.

Now, you should be able to navigate to http://localhost/ZendCore and view your server in GUI goodness. Running phpinfo() should display the Zend Optimizer as being installed like so:

3. Now, onto the task of actually setting up Zend Studio. By default, the ZS sets up a default workspace in your home directory:
/home/username/Zend/workspaces/DefaultWorkspace

Projects that you create will be created in subfolders under this directory. Now, open up Zend Studio and create a new php project (file->new->PHP project). Give the project a name (phptest) and accept the default workspace.

Create a new php file inside the project (right click on project, New->php file).. Name it index.php
Put the following lines in index.php.. It simply displays the php setup on our system:
<?php
phpinfo();
?>

We are ready to test/run/debug our sample application. Before we can do that, we need to make the directory accessible from the web directory. The easiest way to do that is to open the file browser by typing “sudo nautilus” on the console window, navigating to the phptest folder, right clicking and selecting the “Make link” like so:

This action will create a symbolic link to this folder in the same subdirectory. Go ahead and copy this folder link to the /var/www folder (this is the default web folder setup once apache is installed. Rename the sym link to “phptest“.

Thats it! Now, we are ready to run our php file within the Zend framework.. Click on the “Run” button.. Select “PHP web page”
Next, you will be prompted for the Launch URL which in this case is http://localhost/phptest. You should now be able to run any php web app (including Zend Framework applications), set breakpoints, watch variables etc..

Posted in Linux | Tagged: , , , , , | Leave a Comment »

Chrome browser on Ubuntu (Jaunty/9.04)

Posted by mnshankar on July 3, 2009

Everyone can now try the chrome web browser on Ubuntu/Linux thanks to the chromium opensource project. The browser is in beta state (and is not even recognized by Yahoo! mail) so it could be a secondary browser at best (for now). It is a really fast and functional browser, and holds great promise.

It is available only in the 32bit flavour.. so for folks running 64bit Ubuntu, it automatically uses the 32 bit libraries. Of course, you can directly install the deb package on your system.. but then you will need to do it everytime there is an update (and trust me, it happens quite regularly). If you add the daily builds url to the sources list on your computer, it takes the guesswork out of updating and uninstalling. Here’s how you can do that

1. Click on “System”=>”Administration”=>”Software Sources”. Then click on the “Third party software” tab.. Enter the following:


and hit the OK button. Your “sources” should now look like :

2. The next step is to get the daily build public key.. Go to this URL:
http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0×5A9BF3BB4E5E17B5

Then copy and paste everything except the header (including –begin PGP— and –end pgp–) into a text editor and save it on your desktop.
Now, reopen the “Software Sources” dialog box, and click on the “Authentication” Tab. Click on the “Import Key file” button at the bottom and open the file containing the public key you just saved on your desktop.

Close when you are done. It will ask you to reload your sources, go ahead and accept.

3. Open “Synaptic package manager” from “System”=>”Administration”=>”Synaptic..”. On the “Quick search” box, type in “Chromium”.. From the list below, select “Chromium browser” (If you are on 64 bit, it will automatically add the 32 bit libraries). Hit the “Apply” button.

Voila.. Chromium gets installed on your system! You can access it from “Applications”=>”Internet”->”Chromium”

Posted in Linux | Tagged: , , , , | Leave a Comment »