Friday, August 22, 2014

Install Laravel Framework in Windows

1) *PHP version greater than 5.3.7 is required.

2) Download Laravel from:

3) Extract Laravel into the htdocs folder for XAMPP.

4) Download Composer from:

5) Enable openssl from all php.ini files.

6) Install Composer into the same directory php.exe is located.

7) Open cmd.

8) Change into the directory where you extracted Laravel e.g: cd C:\xampp\htdocs\laravel.

9) Type the command: composer install.

10) Installation completed.

Monday, August 12, 2013

Import Sql file from Command Prompt in xampp

first copy your sql file and paste to bin directory of xampp/mysql

Then go to your xampp location->mysql->bin in command prompt and write.

mysql -u username -p (here 'username' is the username of the database) then press enter

It will ask a password of your database. Enter your password and hit enter. Then write

use database_name (here 'database_name' is the name of the database)

Then give the path of your source sql file.

source filename.sql

Friday, July 12, 2013

Installing Ruby, Rubygems, Compass and Sass in Ubuntu 12.04 LTS

Open Terminal - Ctrl + Alt + t

Login as root - sudo -s (this will ask for you a password)

After entered the password. In the terminal write this command -

For installing ruby :-

apt-get install ruby-full build-essential

For installing rubygems :-

apt-get install rubygems

For installing compass :-

gem install compass

For installing sass :-

gem install sass

check you sass

sass -v

Note: If there is an error you probably need to the following line export PATH=$PATH:/var/lib/gems/1.8/bin  in the end of your ./bashrc

How to do it

nano ./bashrc
append the line in the end export PATH=$PATH:/var/lib/gems/1.8/bin in the end of your ./bashrc
close your terminal and start it again

Install lampp in Ubuntu 12.04 LTS

First download lampp from the link mentioned below :-

After download :-

Open Terminal - Ctrl + Alt + t

Login as root - sudo -s (this will ask for you a password)

After entered password. In the terminal write this command -

tar xvfz xampp-linux-1.x.x.tar.gz -C /opt

This process will install xampp in the following directory - /opt/lampp/

Now give the permission to htdocs folder to read and write operation -

chmod 777 -R /opt/lampp/htdocs/

Start services of lampp write this command in the terminal

/opt/lampp/lampp start

Checking :-


For stop its services

/opt/lampp/lampp stop

Sometime after insallation finished when we go to (phpmyadmin) section -


It will throw an error message. For solving this issue write following command in the terminal :-

chmod 777 -R /opt/lampp/etc/extra/

gedit /opt/lampp/etc/extra/httpd-xampp.conf

It will open httpd-xampp.conf in the editor named gedit now put this line

Require all granted

After this line

<Directory "/opt/lampp/phpmyadmin">
    AllowOverride AuthConfig Limit
    Order allow,deny

In the terminal write this command to change the permission of the directory /opt/lampp/etc/extra/

chmod 777 -R /opt/lampp/etc/extra/

And its all done. Now enjoy it..

Wednesday, May 23, 2012

Change date to timestamp PHP

Change normal date to timestamp

$timestamp = strtotime(date("D M d, Y G:i:s a"));

Hack google-sitemap-generator for my custom sitemaping

Just Open Your google-sitemap-generator Plugin Directory. And open sitemap-core.php file

find this :-

$this->AddUrl($page->GetUrl(), $page->getLastMod(),$page->getChangeFreq(),$page->getPriority());

And Below after ending second '}' (Curlibraces) you write down your code like that:-

$rows = $wpdb->get_results( "SELECT id, last_access FROM TABLE ORDER BY id ASC" );
foreach($rows as $row) :
$the_page = get_page_by_title( 'PAGE_TITLE' );
$GetUrl = add_query_arg(array('id' => $row->id), get_permalink($the_page->ID));
$lastMod = strtotime($row->last_access);
$this->AddUrl($GetUrl, $lastMod, 'Weekly', 0.6);

Saturday, November 19, 2011

show data inside cdata section xml

To show data inside CDATA section in xml from PHP.

if you use this type of xml file

<row no="1">
<DL val="ID">474692000000048282</FL>
<DL val="Name">
<![CDATA[ Marion Center ASD ]]>
<row no="2">
<DL val="ID">474692000000048280</FL>
<DL val="Name">
<![CDATA[ Franklin Regional School District ]]>

$xml = simplexml_load_file('filename');

foreach($xml->Data->row as $row) {
echo "<ul><li>".$row->DL[1]."</li></ul>";

All Done..