Category: PHP

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

Removing the index.php file Codeigniter

http://www.codeigniter.com/user_guide/general/urls.html

Neu van khong dc, vào http.conf sua:

<Directory d:/Workspace/mycodeigniter.com>
AllowOverride All
Require all granted

</Directory>
<VirtualHost *:80>
ServerAdmin webmaster@mycodeigniter.com
DocumentRoot “d:/Workspace/mycodeigniter.com”
ServerName mycodeigniter.com
ServerAlias http://www.mycodeigniter.com
DirectoryIndex index.php index.html
ErrorLog “logs/mycodeigniter.com-error.log”
CustomLog “logs/mycodeigniter.com-access.log” common
</VirtualHost>

Xdebug and Sublime Text | Vaerenbergh

This blog post is about making Xdebug work together with Sublime Text (in this example version 2). By many considered a tough task. But it’s doable. Your IDE will look something like this: A couple of assumptions made before continuing: Sublime Text 2 or higher is installed.

Source: Xdebug and Sublime Text | Vaerenbergh

 

custom shortcut key:

Reference->Keybinding user:

[
{“keys”: [“ctrl+f8”], “command”: “xdebug_breakpoint”},
{“keys”: [“shift+f8”], “command”: “xdebug_conditional_breakpoint”},
{“keys”: [“ctrl+shift+f5”], “command”: “xdebug_continue”, “args”: {“command”: “run”}},
{“keys”: [“f6”], “command”: “xdebug_continue”, “args”: {“command”: “step_over”}},
{“keys”: [“f7”], “command”: “xdebug_continue”, “args”: {“command”: “step_into”}},
{“keys”: [“f5”], “command”: “xdebug_continue”, “args”: {“command”: “step_out”}},
{“keys”: [“ctrl+shift+f9”], “command”: “xdebug_session_start”},
{“keys”: [“ctrl+shift+f10”], “command”: “xdebug_session_stop”},
{“keys”: [“ctrl+shift+f11”], “command”: “xdebug_layout”, “args”: {“keymap” : true}}
]

Setup Vagrant, Linux, PHP, XDebug

list file: ls -al /etc
de biet path hien tai: pwd
apache:
sudo yum install httpd
sudo systemctl start httpd.service
start apache khi boot system: sudo systemctl enable httpd.service
sudo systemctl restart httpd.service
MySQL:
sudo yum install mariadb-server mariadb
start service: sudo systemctl start mariadb
remove mot vai caidat default: sudo mysql_secure_installation
PHP:
sudo yum install php php-mysql
List module va extension: yum search php-
yum info package_name : xem thong tin package
yum info php-fpm : mo ta chi tiet package
sudo yum install php-fpm: cai package php-fpm
sudo yum install package1 package2 … : install nhieu package
sudo vi /var/www/html/info.php : tao file
:$ => di den cuoi file
😡 (quit and save)
:w
and
:q => exit without save
i => insert mode
esc: thoat insert mode
sudo rm /var/www/html/info.php =>delete file

$ vagrant reload
Neu loi: /sbin/mount.vboxsf: mounting failed with the error: No such device => :
sudo yum update -y
sudo yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) dkms -y
vagrant plugin install vagrant-vbguest

vagrant file:
config.vm.network “private_network”, ip: “192.168.33.10”
config.vm.network “private_network”, ip: “192.168.33.10”
config.vm.synced_folder “./shared/www”, “/var/www/html/”, :mount_options => [“dmode=777”, “fmode=777”]
config.vm.synced_folder “./shared/logs”, “/logs”, :mount_options => [“dmode=777”, “fmode=777”]

link tham khao:

https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/3/html/Step_by_Step_Guide/s1-navigating-pwd.html

https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-7