30 April 2016

PHP Basic


  • Variable
PHP has a total of eight data types which we use to construct our variables:

Integers: are whole numbers, without a decimal point, like 4195.

Doubles: are floating-point numbers, like 3.14159 or 49.1.

Booleans: have only two possible values either true or false.

NULL: is a special type that only has one value: NULL.

Strings: are sequences of characters, like 'PHP supports string operations.'

Arrays: are named and indexed collections of other values.

Objects: are instances of programmer-defined classes, which can package up both other kinds of values and functions that are specific to the class.

Resources: are special variables that hold references to resources external to PHP (such as database connections).

MySQL Command


Some useful command lines:

backup: # mysqldump -h localhost -u root -p database_name > dumpfilename.sql

restore:# mysql -u root -p database_name < dumpfilename.sql

mysql -u root -p

mysql> create database `dev-001` default charset utf8;

mysql> drop database `dev-001`;

Backup and restore all databases:

mysqldump -u root -p --all-databases > backup.sql

mysql -u root -p < backup.sql

07 November 2015

05 August 2015

How to install magento 1.8 in Ubuntu

Follow the step below:

1.    Download Packages (installation, sample-data) and Extract
2.    Create database and import sample data magento_sample_data_for_1.6.1.0.sql
3.    open your virtual host http://local.magento
4.    Install sudo apt-get install php5-mcrypt
5.    sudo apt-get install php5-mcrypt
       sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/apache2/conf.d/
       sudo service apache2 restart
       sudo a2ensite php5
6.    copy images of sample data to /media/catalog
7.    you are done!

Linux Basic command line

Linux Commands

  • Permission and ownership
chmod
- r is for read permission = 4
- w is for write permission = 2
- x is for execute permission = 1

chown
- u is for user
- g is for group
- and o is for others
Ex:
chmod -R 755 directory-name
chmod u+x filename

chmod Examples
Give read, write and execute to everybody (user, group, and others)
read, write and execute = 4 + 2 + 1 = 7.