WordPress: Fix permalink issue “Not Found” in Ubuntu

run command: nano  /etc/apache2/apache2.conf Change from “AllowOverride None” to “AllowOverride All” Save and close Now run: a2enmod rewrite Now run sudo service apache2 restart It should work now.

Fix SQL Error: GROUP BY incompatible with sql_mode=only_full_group_by

MySQL 5.7.5+ changed the GROUP BY behavior. So in this and future versions GROUP BY would not work in same way as it used to be before. So to make GROUP BY feature working like before follow these details: Note: First of all to follow these steps you must need to have root access to […]

PHP: How to fix Image rotation issue in img tag because of EXIF

Photos captured by some smartphones especially iPhones are automatically rotated when we use it in <img> tag which is mostly not acceptable as we don’t need such unwanted rotation. This happens because of EXIF Data stored in that image. But we can easily fix it using PHP by following these steps: function autorotate($src) { // […]

How to remove index.php from codeigniter in UBUNTU?

This tutorial will show you that how to remove index.php from codeigniter in UBUNTU or how to enable url rewriting. Step 1 : Add this in htaccess file <IfModule mod_rewrite.c> RewriteEngine On #RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [QSA,L] </IfModule> Step 2 : Remove index.php in codeigniter config $config[‘index_page’] = ”; Step 3 […]

SSH: How to stop a script running in the background?

Open/Login SSH into the server Type in ps x See the list of processes currently on your server Get the PID(process id) from that list and type kill xxxxx That should do it. Source: StackOverflow Tested on Linux / CentOS 6.7 x 64

PHP: How to run / execute a script in the background forever through SSH ?

You can execute a php script in the background forever by using SSH through PHP but for that you have to make sure first that SSH2 extension is available. PHP DOCS: http://www.php.net/manual/en/function.ssh2-exec.php $connection = ssh2_connect(‘shell.example.com’, 22); ssh2_auth_password($connection, ‘username’, ‘password’); /* if you want to execute script from a different directory then use commands in same line […]

SSH: how to run a PHP script in background forever in Linux (CentOS) ?

If you want to run a PHP script in the background forever through SSH then follow these steps: If you are using a SSH terminal (PuTTY) then directly run following command: // Notice ‘&’; that operator will help to run this script forever. php server.php & // make sure that you are in the root directory […]

CentOS: how to execute a php file with different php version than the php version of OS

To execute a php file with different php version than the version installed on the main php of your Server follow this: You should know that where is that php version located so that you can add the path. In my case I want to use PHP 7 that is installed in the plesk hosting […]