Author: depot4beginners

Centos 7 , php 5.6 , mysql, vagrant

[root@localhost ~]# history
1  yum install httpd
2  yum search php
3  sudo apachectl restart
4  yum install php56w
5  yum install php56u
6  rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
7  rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
8  yum -y install php56w php56w-opcache
9  yum -y install php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mys                                                                                                                ql php56w-intl php56w-mbstring
10  sudo apachectl restart
11  php -v
12  httpd -v
13  exit
14  cd /home
15  cd/Demo
16  cd Demo
17  ls
18  chmod 644 index.php
19  sudo apachectl restart
20  nano /etc/sysconfig/selinux
21  vim /etc/sysconfig/selinux
22  vi /etc/sysconfig/selinux
23  sestatus
24  setenforce 0
25  sudo apachectl restart
26  exit
27  mysql -v
28  yum remove php56w-mysql
29  yum remove php56w-mysqlnd
30  yum remove php5-mysqlnd
31  yum install php-mysqlnd
32  yum remove php-common
33  yum install php-mysqlnd
34  apachectl restart
35  php -v
36  sudo php -v
37  yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd p                                                                                                                hp56w-devel php56w-intl php56w-mbstring
38  yum remove php
39  yum remove php-mysqlnd
40  yum remove php-common
41  yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd p                                                                                                                hp56w-devel php56w-intl php56w-mbstring
42  y
43  apachectl restart
44  php -v
45  mysql -v
46  yum install php56-mysql
47  yum install php56w-mysql
48  yum install php56w-mysqlnd
49  apachectl restart
50  pecl install xdebug
51  yum install pecl
52  yum install php54w-pear
53  yum install php56w-pear
54  yum install gcc gcc-c++ autoconf automake
55  pecl install Xdebug
56  apachectl restart
57  yum install java-1.7.0-openjdk
58  yum remove java-1.7.0-openjdk
59  apachectl stop
60  exit
61  apachectl restart
62  getenforce
63  setenforce 0
64  getenforce
65  yum -y install mysql-community-server
66  rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rp                                                                                                                m
67  yum -y install mysql-community-server
68  /usr/bin/systemctl enable mysqld
69  /usr/bin/systemctl start mysqld
70  service mysqld restart
71  /usr/bin/mysql_secure_installation
72  firewall-cmd  –reload
73  mysql -u root -p root
74  mysql -u root -p mysql
75  service mysqld restart
76  apachectl restart
77  install php5-mysqlnd
78  yum install php5-mysqlnd
79  yum install php56w-mysqlnd
80  yum install php56w-mysqlnd56
81  yum install php-mysqlnd
82  php -m | grep -i php
83  php -i | grep “php”
84  yum info php-fpm
85  yum info php-
86  yum search php
87  yum search php54w
88  yum install php56w-mysqlnd
89  yum install php56w-mysqlnd –skip-broken
90  apachectl restart
91  yum install php-mysqlnd-5.4.16-23.el7_0.3.x86_64
92  yum install php-mysqlnd-5.6.16-23.el7_0.3.x86_64
93  yum install php56w-mysqlnd-5.6.16-23.el7_0.3.x86_64
94  mysql -v
95  su root
96  exit
97  su root
98  exit
99  history

http://www.techoism.com/how-to-upgrade-php-version-5-4-to-5-6-on-centosrhel/

The PHP Development Team reports the quick accessibility of PHP 5.6.0. This new version accompanies new features, some backward incompatible changes and many enhancements.

logo-php56

Main features include in PHP 5.6.0 :

 

  • Constant scalar expressions.
  • Exponentiation utilizing the ** operator.
  • Function and constant importing with the utilization decisive word.
  • phpdbg as an intuitive coordinated debugger SAPI.
  • GMP questions now bolster operator over-burdening.
  • Document transfers bigger than 2 gigabytes in size are presently acknowledged.
  • First we need to check the current version of PHP. To check the versio of PHP run following command:
    # php -v
    
    PHP 5.4.35 (cli) (built: Nov 14 2014 07:04:10)
    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
        with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
    
  • To upgrade php, first you must include the Webtatic EL yum repository data relating to your CentOS/RHEL variant to yum:For CentOS/RHEL 7:
    # rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
    # rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
    

    For CentOS/RHEL 6:

    # rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
    
  • After installing Webtatic yum repository, you have to remove the old version of php-common package. It will also delete it dependencies packages.
    # yum remove php-common
    

    Sample Output:

    Dependencies Resolved
    
    ===================================================================================
     Package             Arch          Version                      Repository    Size
    ===================================================================================
    Removing:
     php-common          x86_64        5.4.39-1.el6.remi            @remi        7.0 M
    Removing for dependencies:
     php                 x86_64        5.4.39-1.el6.remi            @remi        9.1 M
     php-cli             x86_64        5.4.39-1.el6.remi            @remi         12 M
     php-devel           x86_64        5.4.39-1.el6.remi            @remi        8.1 M
     php-gd              x86_64        5.4.39-1.el6.remi            @remi        665 k
     php-ldap            x86_64        5.4.39-1.el6.remi            @remi        119 k
     php-mbstring        x86_64        5.4.39-1.el6.remi            @remi        2.5 M
     php-mcrypt          x86_64        5.4.39-1.el6.remi            @remi         86 k
     php-mysql           x86_64        5.4.39-1.el6.remi            @remi        452 k
     php-pdo             x86_64        5.4.39-1.el6.remi            @remi        348 k
     php-pear            noarch        1:1.9.5-9.el6.remi           @remi        2.0 M
     php-process         x86_64        5.4.39-1.el6.remi            @remi        128 k
     php-snmp            x86_64        5.4.39-1.el6.remi            @remi        107 k
     php-xml             x86_64        5.4.39-1.el6.remi            @remi        626 k
    
    Transaction Summary
    ===================================================================================
    Remove       14 Package(s)
    
    Installed size: 43 M
    
  • Now we install PHP 5.5 using following command:
    # yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring
    
  • After installing PHP 5.6, we need to restart Apache service.
    # /etc/init.d/httpd restart
    
    # php -v
    
    PHP 5.6.8 (cli) (built: Apr 17 2015 22:49:36)
    Copyright (c) 1997-2015 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
        with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
    

 

How to upgrade PHP version 5.4 to 5.5 on CentOS/RHEL

Git command

  • Kéo code master về branch có sẵn (How to merge remote master to local branch)

– Checkout về brach cần merger:

– Run :

git fetch
git rebase origin/master

delete file and push to remote

git commit -a -m "A file was deleted"
git push

 

revert deleted file:

git ls-files -d | xargs git checkout --

 show conflict files

git diff --name-only --diff-filter=U


https://backlogtool.com/git-guide/vn/stepup/stepup1_1.html

Build Sass in Sublime text 3

  • Install Ruby (nho chọn tuy chon add to PATH variable)
  • restart computer
  • go lenh: gem install sass de cài sass
  • Neu compile bang ruby thi run: sass –watch style.scss:style.css (nho cd vao path sass folder)
  • Cai Libsassbuild
  • Tools-> Libsassbuild -> edit project config:
    •    Pass text:{
      “output”: {
      “dir”: “../../assets/css/”,
      “structure”: “flat”
      },
      “compile”: {
      “line-comments”: false,
      “line-numbers”: true,
      “style”: “nested”
      }
      }
    • Save as lai nhu hinh:
    • untitled
  • Muon build tu dong khi save thi can them plugin: SublimeOnSaveBuild

 

Mac dinh khi sua file partial(file duoc imported) => Build => se sinh ra file partial css tuong ung. Muon ngan chan cai nay thi

Sublime Text 3 Keyboard Shortcuts

General

Command Pallete
CTRL + SHIFT + P
Show­/Hide Console
CTRL + `
Show­/Hide Sidebar
CTRL + K, B
Redo Last Keyboard Shortcut
CTRL + Y
Select Autoco­mplete Sugges­tion
CTRL + SPACE

Window Manipu­lation

Full­scr­een
F11
Dist­raction Free Mode
Shift + F11
New Window
CTRL + SHIFT + N
New Tab
CTRL + N
Select A Tab
ALT + TAB NUMBER
Close Tab
CTRL + W
Move Tab to Pane
CTRL + SHIFT + PANE NUMBER
Switch to Pane
CTRL + PANE NUMBER

Layout

2, 3, 4 Column
ALT + SHIFT + 1/4
2 or 3 Row
ALT + SHIFT + 8/9
4 Grid
ALT + SHIFT + 5
Split Pane in Half
CTRL + K, CTRL + SHIFT + UP

Pane Manipu­lation

Move to Panel
CTRL + PANEL NUMBER
Move File to Panel
CTRL + SHIFT + Panel Number

Navigation

Quick Open File
CTRL + P
Open File, Search Symbol
CTRL + P, @
Go to Symbol
CTRL + R
Go to Line
CTRL + G
Go to Next Tab
CTRL + PGDOWN
Go to Previous Tab
CTRL + PGUP
Jump to Closing Parent­hesis
CTRL + M

Find & Replacing

Find
CTRL + F
Find Next
F3
Find Previous
SHIFT + F3
Replace Every Select­ion
After selecting, ALT + F3
Repl­ace
CTRL + H
Incr­emental Search
CTRL + I
Find in Files
CTRL + SHIFT + F
Find then Multi-­Edit
CTRL + F, ALT + Enter
Use Selection for Find Field
CTRL + E
Use Selection for Replace Field
CTRL + SHIFT + E

Selecting Text

Line
CTRL + L
Word
CTRL + D
Quick Select Next Iterat­ion
CTRL + D
UnSelect Next Iterat­ion
CTRL + U
Skip, and Select the Next Iterat­ion
CTRL + K, D
Pare­nthesis Content
CTRL + SHIFT + M
Inde­ntation Content
CTRL + SHIFT + J
Column Selection Up
CTRL + ALT + UP
Column Selection Down
CTRL + ALT + DOWN
Mult­i-S­elect Editing
CTRL + CLICK

Editing

Delete Line
CTRL + SHIFT + K
Delete From Cursor to EOL
CTRL + K, K
Delete From Cursor to BOL
CTRL + K, BKSP
Delete Word Forwards
CTRL + DEL
Delete Word Backwa­rds
CTRL + BKSP
Move Line Up
CTRL + SHIFT UP
Move Line Down
CTRL + SHIFT + DOWN
Insert Line Before
CTRL + SHIFT + ENTER
Insert Line After
CTRL + ENTER
Indent Current Line
CTRL + ]
UnIndent Current Line
CTRL + [
Dupl­icate Line
CTRL + SHIFT + D
Join Line Below Current Line
CTRL + J
Paste With Proper Indent­ation
CTRL + SHIFT + V
Tran­spose
SELECT ITEMS, CTRL + T

Transform

To Upperc­ase
CTRL + K, U
To Lowerc­ase
CTRL + K, L
Increase Font Size
CTRL + PLUS
Decrease Font Size
CTRL + MINUS

Bookmarks

New Bookmark
CTRL + F2
Next Bookmark
F2
Previous Bookmark
SHIFT + F2
Clear Bookma­rks
CTRL + SHIFT + F2

Code Folding

Fold Select­ion
CTRL + SHIFT + [
UnFold Select­ion
CTRL + SHIFT + ]
Fold All
CTRL + K, 1
UnFold All
CTRL + K, J
Fold Level
CTRL + 2/9

Commenting

Comment Line
CTRL + /
Block Comment
CTRL + SHIFT + /