Whats new in PHP 5.5 / 5.4 / 5.3?

Whats new in PHP?

This is a quick reference on whats been added / removed or upgraded on new versions of php.

PHP 5.5

Release date: 2013-06-20

Features and Updates

  1. Generators and coroutines
  2. “finally” keyword
  3. New password hashing API
  4. “foreach” now supports list()
  5. “empty()” supports arbitrary expressions
  6. Array and string literal dereferencing
  7. Zend OPcache extension for opcode caching.
  8. Array_column
  9. Improvements to GD
  10. Class name resolution via::class
  11. Datetime impromvents
  12. A lot more improvements and fixes.

PHP 5.4

Release date: 2012-03-01

Features and Updates

  1. Trait support
  2. Short array syntax support
  3. Built-in web server (CLI).
  4. Performance and reduced memory requirements
  5. Instance Method Call
  6. Closure Binding
  7. Objects as Functions ( Function de-refernecing)
  8. JsonSerializable Interface
  9. Binary Notation
  10. Short open tag
  11. Session Upload progress
  12. Default charset is now UTF-8

Many more improvement and fixes

Removed items:

  • register_globals,
  • safe_mode,
  • allow_call_time_pass_reference,
  • session_register(),
  • session_unregister()
  • and session_is_registered().
  • break / continue $var syntax removed
  • ext/sqlite moved to pecl

PHP 5.3

release date: 2009-06-30

Features and Updates

  1. Namespaces concept is added in Php 5.3
  2. Support for Late Static Bindings has been added.
  3. Support for jump labels (limited goto) has been added.
  4. There are two new magic methods, __callStatic() and __invoke().
  5. Nowdoc syntax is now supported, similar to Heredoc syntax, but with single quotes.
  6. Constants can now be declared outside a class using the const keyword.
  7. Ternary short cut “?:”
  8. Optional garbage collection for cyclic references
  9. Optional mysqlnd PHP native replacement for libmysql
  10. 140+ bug fixes.

Removed items:

Removed the following extensions: ext/mhash (see ext/hash), ext/msql, ext/pspell (see ext/enchant), ext/sybase (see ext/sybase_ct)

Moved the following extensions to PECL: ext/ming, ext/fbsql, ext/ncurses, ext/fdf
Removed zend.ze1_compatibility_mode

How to setup CSF firewall in linux

CSF Firewall setup:

CSF is very popular firewall. It comes with lots of prebuilt features and most of the case just doing simple installation
will protect server from many known issues. Please check http://configserver.com/cp/csf.html to see all the options and features
available.

Installation

rm -fv csf.tgz

wget http://www.configserver.com/free/csf.tgz
tar -xzf csf.tgz
cd csf
sh install.sh

basic configuration:

port settings:
By default following ports are opened:

TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995"
TCP_OUT = "20,21,22,25,53,80,110,113,443"
UDP_IN = "20,21,53"
UDP_OUT = "20,21,53,113,123"
We can remove any port or add any port as per our requirement.
 some important ports to be considered :
 10000 // webmin default port
 2087,2083,2086 // cpanel ports
 26 // some server use 26 as outgoing mail server to by pass ISP limitation.

So based on your requirement, please add necessary ports.

to edit the ports open any editor like vim:
 vi /etc/csf/csf.conf

and dont forget to restart

service csf restart
 Blocking predefined IPs:
 vi /etc/csf/csf.deny
1.2.3.4
 198.168.0.0/16
 Allowing predefined IPS:
vi /etc/csf/csf.allow

edit above file as per requirement to deny or allow predefined ips.

Ips can be single ip per line or range per line as above.

Once all the settings are done, we can set testing mode to live mode by
setting TESTING = 0 and restarting the csf by service csf restart

Basic commands:
Csf comes with lots of command line command, simply typing csf on command line will show all the available
commands but some frequently used commands are:

csf -d <ip adress to block>
 csf -a <ip address to allow / unblock>
 csf -r <reload rules>