0

I am trying to beautify my code through code beautifier. So I typed -

sudo phpcbf -n --standard=PEAR filename.php

Its showing me phpcbf command not found. Then I tried to install phpcbf using the command-

sudo pear install --alldeps channel://pear.php.net/php_beautifier-0.1.15

And the output is -

pear/php_beautifier is already installed and is the same as the released version 0.1.15 install failed

why that happens? I can't find any helpful resource to resolve the issue.

Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
Arjita Mitra
  • 962
  • 2
  • 13
  • 36

2 Answers2

0

Try doing a which phpcbf. If it shows anything, it means that it's installed; it it doesn't, it means you need to add the install location to the PATH.

tino.codes is correct, but if you need to use the command phpcbf, you can always add an alias to php_beautifier. Open up your ~/.bash_profile and add the following line:

alias phpcbf='php_beautifier'

then, save that file and run source ~/.bash_profile.

And now you have an alias to a, then, non-existent command.

Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
weirdpanda
  • 2,521
  • 1
  • 20
  • 31
0

phpcbf is not Pear package you have installed.

The Pear package command is php_beautifier:

Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
tino.codes
  • 1,512
  • 1
  • 12
  • 23