Tag: PHP

Minimum Required PHP Version for Plugins

WordPress has introduced a way for developers to set a minimum required PHP version for their plugins.

Hello World! in PHP

The following is a code snippet to create Hello World! in PHP. <?php echo ‘Hello World’;

How-to Install HHVM on Ubuntu 14.04

HHVM is an open source virtual machine designed for executing programs written in Hack and PHP. The advantage of HHVM is an increase in web request throughput and…

How-to Install LAMP on CentOS 6

The LAMP stack is commonly used for web servers. LAMP stands for Linux, Apache, MySQL and PHP (as well as Python and Perl). The following steps will show…

How-to Install LAMP on CentOS 7

The LAMP stack is commonly used for web servers. LAMP stands for Linux, Apache, MySQL and PHP (Python and Perl could also be included as the “P”). The…

Get User’s IP Address using PHP

Use the following PHP code snippet to display the user’s IP address: <?php if (!empty($_SERVER[‘HTTP_CLIENT_IP’])) { $ip=$_SERVER[‘HTTP_CLIENT_IP’]; } elseif (!empty($_SERVER[‘HTTP_X_FORWARDED_FOR’])) { $ip=$_SERVER[‘HTTP_X_FORWARDED_FOR’]; } else { $ip=$_SERVER[‘REMOTE_ADDR’]; } echo…

Automatic Copyright Year Using PHP

In this code snippet, I will show you how to display the copyright year using PHP automatically.To display the current year for copyright notices use the following code…

Increase PHP Memory Limit with .htaccess

You can increase the allotted PHP memory limit using .htaccess, useful for WordPress, with the following line:phpvalue memorylimit 64M In this example the new allotted PHP memory limit…