Friday, September 23, 2011

Cannot find codeigniter spark path at sparks

1st issue:
sparks not installed successfully.
reinstall sparks


    Steps:
  1. Via the shell, navigate to the root of your CodeIgniter application
  2. Copy and paste the following into the command line:
php -r "$(curl -fsSL http://getsparks.org/go-sparks)"
  1. Press enter. If all goes well, move on to Get Sparks. If not, try the normal installation below.



2nd issue:
if you use public folder for index.php, CI application cann't find sparks.


Steps:
go to the site_root/application/core/MY_Loader.php

Default constructor

function __construct() { 
   if(!defined('SPARKPATH')) 
   { 
      define('SPARKPATH', 'sparks/'); 
   } 
   parent::__construct(); 
}


modify highlighted row to

define('SPARKPATH', '../sparks/');


Friday, September 16, 2011

.htaccess not working on localhost.(LAMP)


if u want to check mod re-write enable
sudo a2enmod rewrite
view apache error log
tail -f /var/log/apache2/error.log
open default file
sudo gedit /etc/apache2/sites-available/default

replace AllowOverride None to AllowOverride All

restart apache

sudo apache2ctl restart

Thursday, September 15, 2011

How to enable curl support with PHP (for ubuntu)

Run following command in terminal
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl

Monday, September 12, 2011

How to install Eclipse 3.7 on Ubuntu 11.04

The Eclipse packages in Ubuntu are are very out of date. The latest version in the Ubuntu repos is 3.5.2 where as the latest version of Eclipse is 3.7. I’m posting this because Ubuntu 11.04 uses the new Unity desktop which uses overlay-scrollbars (scrolls bars that are hidden until you hover over them). For some reason Eclipse 5.3.2 doesn’t like to play nice with the overlay scrollbars, and I’d rather use the newest version anyways. With Eclipse, you can just download the tar.gz file from eclipse.org and run it no problem, but I like set things up in a cleaner fashion, so here’s how I did it.

 1) Download Eclipse. I got eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz
2) Extract it
tar xzf eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz
Or just be lazy and Right Click > Extract Here
3) Move to /opt/ folder
mv eclipse /opt/
sudo chown -R root:root eclipse
sudo chmod -R +r eclipse
4) Create an eclipse executable in your path
sudo touch /usr/bin/eclipse
sudo chmod 755 /usr/bin/eclipse
sudo nano /usr/bin/eclipse
copy this into nano
#!/bin/sh
#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
export ECLIPSE_HOME="/opt/eclipse"

$ECLIPSE_HOME/eclipse $*
save the file (^O = Ctrl+o) and exit nano (^X = Ctrl+x)
5) Create a gnome menu item
sudo nano /usr/share/applications/eclipse.desktop
copy this into nano
[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=eclipse
Icon=/opt/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true
save and exit nano
6) Launch Eclipse for the first time
/opt/eclipse/eclipse -clean &

Wednesday, September 7, 2011

Useful commands for ubuntu

For read apache error log

tail -f /var/log/apache2/error.log

get apptitude

sudo apt-cache search aptitude

sudo apt-get install aptitude

sudo aptitude search rewrite

enable rewrite engine

sudo a2enmod rewrite

Monday, September 5, 2011

Setting up Virtual Hosts with XAMPP running on Windows XP


Setting up virtual hosts with XAMPP is very straight forward and could be done in less than 5 minutes. Although, your local XAMPP server will still work even if virtual hosts are not configured. You might want to ask, is there a need for my local XAMPP setup to configure virtual hosts? Apparently, virtual hosts are needed when

  • your on multiple domains
  • your need to test your projects with same configuration with the server
  • test your projects without touching your public server
  • your just organizing your projects into groups
  • or setup a local copy of your blog or website
What do we need?
This document assumes that you are working with Windows XP with XAMPP. If you don't have XAMPP, get it at their XAMPP for Windows download page. Just execute the exe file and follow the onscreen instructions.

Configuring Windows XP to accept hosts
Hosts is a file under Windows XP that is used to map IP addresses to a custom list of hosts or maybe domain names. The IP address should be placed in one line. The first column should contain the IP address and on the second column its corresponding hostname. The IP address may be separated by a space or by a tab. You can place comments by prepending your line this symbol '#' (pound sign). Initially the first line is added. Now lets add our domain tildemark.com

127.0.0.1       localhost
127.0.0.1       www.tildemark.com
127.0.0.1       tildemark.com

you can check your work by doing a ping to your configured host.


Configuring XAMPP to accecpt Virtual Hosts
  1. Got to your Apache folder in XAMPP and locate the conf files. The are usually located at <<local path>>\xampp\apache\conf\extra
  2. Open the file named httpd-vhosts.conf with a text editor
  3. If posible read the instructions so may have the idea on what you are doing
  4. Now paste the following code at the bottom of the file without touching the document.

    NameVirtualHost 127.0.0.1:80
    <VirtualHost 127.0.0.1:80>
      DocumentRoot E:/xampp/htdocs/    # change this line with your htdocs folder
      ServerName localhost
    </VirtualHost>
  5. Edit the line DocumentRoot with your own document root folder
  6. For each domain you are to configure paste the following lines below, just replace my domain name your corresponding domain:
<VirtualHost www.tildemark.com>
  DocumentRoot "E:\www\www.tildemark.com"
  ServerName www.tildemark.com
  ServerAlias www.tildemark.com

  CustomLog "E:\www\www.tildemark.com\www.tildemark.com-access_log" combined
  ErrorLog "E:\www\www.tildemark.com\www.tildemark.com-error_log"

  <Directory "E:\www\www.tildemark.com">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>