Categories
Software Technology Web Development

PHP 7 – what’s new and feature spotlight

You might already know that PHP 7 is now a stable release. PHP 7 is a new major version, still it has very few backward incompatible changes. However, lots of functions have been deprecated. This is the most important version update for PHP since the release of PHP 5 in the year of 2004. Drastic performance improvements along with reduced memory consumption will supercharge your web application. The new Zend Engine 3.0 enables your website with 2x faster performance and 50% better memory consumption than PHP 5.6 which allows you to serve more concurrent visitors without adding a new hardware. PHP 7 is based on the PHPNG AKA PHP Next-Gen project, that was led by Zend. Also, PHP 7 now has support for 64-bit Windows system which was lacking in 5.x version. However, it was already supported in the Linux 64-bit platforms and local LAMP stacks. Besides the performance enhancements, PHP 7 has introduced many new features, like new operators, type declarations, anonymous classes, namespace imports, etc.

Categories
Hardware Internet Software Technology Web Development

XAMPP vs WAMP vs MAMP

Why I’m writing this? Obviously, because I’m a PHP programmer 🙂 and I felt how hard it is to decide which bundle (LAMP stack) should be used. I’ve worked on Linux back in 4-5 years ago, then Windows for a long time, and currently working on Mac platform. I’ve used all these three bundles over a different time period. I’m in the development industry for over 10 years and I think now I’m in a position to do a side-by-side comparison of these tools so that the newcomers seek some help from this article.

What is LAMP stack

Don’t assume something with those software’s original names, i.e. XAMPP, WAMP, or MAMP. These are merely bundled packages with Apache, MySQL, and PHP. Actually, if you know how to configure Apache, MySQL, and PHP (i.e. many of you may have configured unmanaged dedicated servers in Linode/Rackspace etc.), then you do not need to use these bundles. It’s an ease of use as it includes the automatic configurations, many utilities, phpMyAdmin, servers start/stop/restart interface (i.e. you do not need to do it via shell commands).

There are misconceptions as well like these are for different platforms. Actually, it’s not. XAMPP supports Windows, Linux, and Mac OS X. WAMP only supports Windows platform. MAMP supports both Windows and Mac OS X. But here is the trick, that which one is better for a specific platform?

Categories
Technology Web Development

Some useful htaccess rules

htaccess is basically a directory level configuration file for Apache based web servers. It allows you to set different decentralized configuration directives per directory and all sub-directory wide. You can say it an access control configuration file. htaccess works differently in CGI, fCGI, and Apache Module modes.

Below are some useful htaccess rules that we need frequesntly.

Prevent directory listing:
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>

Specify directory indexes:
DirectoryIndex index.php index.html

Re-write base path:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
</IfModule>

OR
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /live/
</IfModule>

Follow / Un-Follow Symbolic Link:
Options +FollowSymLinks
OR
Options -FollowSymLinks

non-www to www:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.domain\.com
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
</IfModule>

www to non-www:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domain\.com
RewriteRule (.*) http://domain.com/$1 [R=301,L]
</IfModule>