Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8338607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:38:38+00:00 2026-06-09T04:38:38+00:00

When I type in phpcs –version, instead of getting the version number, I get

  • 0

When I type in phpcs –version, instead of getting the version number, I get something like this:

/Applications/drupal/php/bin/phpcs: line 2: ?php: No such file or directory
/Applications/drupal/php/bin/phpcs: line 3: /Applications: is a directory
/Applications/drupal/php/bin/phpcs: line 4: Applications: command not found
/Applications/drupal/php/bin/phpcs: line 5: Applications: command not found
/Applications/drupal/php/bin/phpcs: line 6: Applications: command not found
/Applications/drupal/php/bin/phpcs: line 7: Applications: command not found
/Applications/drupal/php/bin/phpcs: line 8: Applications: command not found
/Applications/drupal/php/bin/phpcs: line 9: Applications: command not found
/Applications/drupal/php/bin/phpcs: line 10: Applications: command not found
/Applications/drupal/php/bin/phpcs: line 11: syntax error near unexpected token `newline'
/Applications/drupal/php/bin/phpcs: line 11: ` * @author    Greg Sherwood <gsherwood@squiz.net>'

It looks like its not reading PHP correctly. What did I misconfigure?

All I did was sudo pear install PHP_CodeSniffer. When I run it again, I get:

pear/PHP_CodeSniffer is already installed and is the same as the released version 1.3.5

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:38:39+00:00Added an answer on June 9, 2026 at 4:38 am

    When PEAR does an install of PHP_CodeSniffer, it changes the first line in the main phpcs script so that the #! line points to the PHP executable on your system.

    So before install, the line looks like this: #!@php_bin@ and after install, it will look something like this (depending on where PHP is installed): #!/usr/bin/php

    PEAR has a config setting which tells it where that PHP executable is installed. You can see this value by running pear config-show and looking for the value of PHP CLI/CGI binary (php_bin). You need to make sure this value is actually the location of PHP on your system or else all installs of scripts (like PHPUnit) will have a similar problem.

    The best way to check this value is to run which php and set that value for the PEAR config variable. Then reinstall PHP_CodeSniffer so the replacement is done again.

    So for my system, I’d do this:

    $ which php
    /usr/bin/php
    $ sudo pear config-set php_bin /usr/bin/php
    config-set succeeded
    $ sudo pear uninstall php_codesniffer
    uninstall ok: channel://pear.php.net/PHP_CodeSniffer-1.3.5
    $ sudo pear install php_codesniffer
    downloading PHP_CodeSniffer-1.3.5.tgz ...
    Starting to download PHP_CodeSniffer-1.3.5.tgz (345,113 bytes)
    ......................................................................done: 345,113 bytes
    install ok: channel://pear.php.net/PHP_CodeSniffer-1.3.5
    

    If all goes well, you should see the correct #! line in your new phpcs file:

    $ which phpcs
    /usr/local/bin/phpcs
    $ head -n 1 /usr/local/bin/phpcs
    #!/usr/bin/php
    

    If that looks correct, you’ll be able to run the phpcs command without problems.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

type SQLConn = val mutable private connection : string option member this.Connection with get()
Consider type like this one public interface IHaveGenericMethod { T1 Method<T1>(T1 parm); T2 Method<T1,T2>(T1
what type could contain a number like 2023209999 in java? do you think that
The type of this function is T -> (T -> U) -> U .
I'm using this PHP class for a Twitter script: twitter.slawcup.com/twitter.class.phps The script is: $t=
TYPE point IS RECORD ( X NUMBER, -- The X co-ordinate of the point
type TDelphiSignature=record Signature:array [0..3] of LongWord; Version:string; end; const DelphiSignature:array [0..2] of TDelphiSignature=( (Signature:($384F3D26,$B83782C2,$034224F3,$833A9B17);Version:'Delphi
type Tag(Kids) = member this.Kids = Kids static member (-) (this: Tag, that: list<obj>)
Type name like com.example.Dog will be compiled to com/example/Dog in the .class file. How
What type of projects exist to php none framework for xss filltering and security?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.