How-to articles, tricks, and solutions about LINUX

"No X11 DISPLAY variable" - what does it mean?

"No X11 DISPLAY variable" is an error message that you might see when trying to run a Java program that uses the X Window System to display a graphical user interface (GUI).

Compiling php with curl, where is curl installed?

The location of the curl installation depends on the operating system and the method used to install it.

Composer: file_put_contents(./composer.json): failed to open stream: Permission denied

This error message is indicating that the script is trying to write to the file "composer.json" in the current directory (indicated by "./"), but it doesn't have the necessary permissions to do so.

Downloading Java JDK on Linux via wget is shown license page instead

If you are trying to download the Java Development Kit (JDK) on Linux using wget and you are being shown the license page instead of the JDK download, it is likely because the download page has changed since the wget command was written.

How to activate virtualenv in Linux?

To activate a virtual environment in Linux, you can use the source command and the path to the activate script that is located in the virtual environment's bin directory.

How to check the presence of php and apache on ubuntu server through ssh

To check if PHP is installed on your Ubuntu system, you can use the following command:

How to Clean Your Ubuntu Machine

4 ways to clean your ubuntu machine. Here are some ways to clean your ubuntu PC and make it faster. Try the examples yourself and see the results.

How to Copy a File from/to a Remote Server

SCP is being used to copy files from one machine to an other one. It can be used to transfer (download and upload) files vis ssh.

How to Count the Pages in a PDF File with PHP

PHP provides a range of extensions and functions for getting the number of pages in a PDF document. Let’s check out the most efficient ones, here.

How to Find All Files Containing Specific Text on Linux

Learn How to Find All Files Containing Specific Text on Linux with W3docs tutorial. Also, try the examples yourself and see the results.

How to find Java Heap Size and Memory Used (Linux)?

To find the Java heap size and the amount of memory used on a Linux system, you can use the jstat command and specify the process ID (PID) of the Java process.

How to find my php-fpm.sock?

To find your PHP-FPM socket file, you will need to first determine the location of your PHP installation.

How to Generate SSH key for Git

SSH is a network protocol that helps to login from one computer to another securely. In this tutorial, you will read how to generate the SSH key for Git.

How to Install Git on Ubuntu 18.04

Working with Git starts with installing. This tutorial shows how to install Git on Linux. Get the codes of installing Git from repository and source code.

How to set JAVA_HOME in Linux for all users

To set the JAVA_HOME environment variable in Linux for all users, you will need to add a line to the /etc/environment file.

open() in Python does not create a file if it doesn't exist

Here is a code snippet that demonstrates how to use the open() function in Python to create a new file if it does not already exist:

Run process with realtime output in PHP

In PHP, you can use the proc_open function to run a process and read its output in real-time.

Tell Composer to use Different PHP Version

To use a specific version of PHP with Composer, you can specify the version you want to use in the config section of your composer.json file.

UnicodeDecodeError: 'utf8' codec can't decode byte 0x9c

This error occurs when a file or string that is being decoded using the UTF-8 encoding contains an invalid byte sequence.

Use different PHP version CLI executable for one command

You can use the alias command in your terminal to create a new command that runs a different version of PHP.

Where is the php.ini file on a Linux/CentOS PC?

On a CentOS system, the php.ini file is usually located in the /etc directory.