phpcbf command not found
Introduction
When you run more command in linux terminal / console, you get the following error message
phpcbf: command not found
or when using sudo you get the following error message
sudo: phpcbf: command not found
Solutions to phpcbf: command not found
How To Fix phpcbf: command not found in Ubuntu / Debian / Kali Linux / Raspbian
In Ubuntu phpcbf is provided by php-codesniffer package.
php-codesniffer is:
PHP_CodeSniffer is a set of two PHP scripts; the main phpcs script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second phpcbf script to automatically correct coding standard violations. PHP_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.
To fix this problem, we can install more using the command below.
sudo apt-get -y install php-codesniffer
This command might take some time to finish depending on your machine internet connection.
You can also use apt command to install php-codesniffer.
sudo apt -y install php-codesniffer
Or if you have aptitude installed you can use the following command.
sudo aptitude install php-codesniffer
Summary
In this tutorial we learn how to fix phpcbf command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.