Wednesday, May 30, 2007

Fatal error installing symfony using PEAR

A memory error occurred when I was trying to install symfony using the "pear install" command:

root@cam-desktop:/home/cam# pear install symfony/symfony-beta
downloading symfony-1.0.2.tgz ...
Starting to download symfony-1.0.2.tgz (1,903,264 bytes)
......................................................................................................................................................................................................................................................................................................................................................................................done: 1,903,264 bytes

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 8192 bytes) in /usr/share/php/PEAR/Installer.php on line 518


The solution was to increase the memory to allocate for php to 32Mb:


root@cam-desktop:/home/cam# PHP_PEAR_PHP_BIN='/usr/bin/php5 -d memory_limit=32M export PHP_PEAR_PHP_BIN

root@cam# export PHP_PEAR_PHP_BIN
root@cam# pear install symfony/symfony-betadownloading symfony-1.0.2.tgz ...
Starting to download symfony-1.0.2.tgz (1,903,264 bytes)
......................................................................................................................................................................................................................................................................................................................................................................................done: 1,903,264 bytes
install ok: channel://pear.symfony-project.com/symfony-1.0.2

Sunday, May 27, 2007

Enable vim syntax color highlightning in Ubuntu

Syntax color highlighting enables parts of text (tags, functions, etc) to be shown in a different color to ease the visualization of the text file, this is done based on the file extension (.php,.sql,.html,etc).

To enable this function in Ubuntu or other distros edit or create the file .vimrc which must be located in the user home directory:


vi /root/.vimrc


add this line:

:syntax enable


That's it.

Saturday, May 26, 2007

Ubuntu Feisty doesn't support php4 anymore

Ubuntu Feisty Fawn (7.04) release, doesn't include php4 in their repositories, php5 is the default version for php. If you want to use php4 applications you better install Ubuntu Dapper Drake (6.06).

Firefox keybord shortcuts for urls

Here are some useful firefox keyboard shorcuts for urls:


Ctrl + enter : to complete a .com url . You can type "google" in the url bar and then ctrl + enter to complete the "www.google.com".

Ctrl + shift + enter : to complete a .org url . You can type "mysql" in the url bar and then ctrl + shift + enter to complete the "www.mysql.org".

F6: to select or move the cursor to the address in the url bar.

Ctrl + k : to move the cursor to the search box.