Warning: include_once(PHP/CodeSniffer/CLI.php): failed to open stream: OSX PHPCS Error

Warning: include_once(PHP/CodeSniffer/CLI.php): failed to open stream: OSX PHPCS Error


April 15, 2018

 Warning: include_once(PHP/CodeSniffer/CLI.php)

I was dealing with this phpcs error last Sunday. occurs when I updated my PHP and updated System Packages also not sure what was the actual issue, whether something got reset but at the end, my problem was phpcs giving me Fatal Error 🙁

Since I am not much familiar with command line because I just moved from Windows to Linux. but along with time, I am getting better and better at dealing with commands 🙂
Seriously, I call it my best decision when I plan to switch from Windows to Linux/ Unix, because Now I am feeling like I am much productive, not have to deal with windows update, Virus problems, GUI ClickClickClick  annnndddd …….

So, after digging got the problem was due to include_path not specified in php.ini file from
but still, the problem not solved so easily so I thought to share what I did to solve it.


So, If you will check the above link the problem will be clear for you or maybe it will work for you if you follow different comments there. I will tell you the solution in my word here.

The above is caused when include_path variable is not specified in php.ini file.

Step 1:

Add Include_Path in php.ini

Verify if the include_path variable is already added

If you have already set the path of pear php executable folder means the include_path is already set then move to step 2.
else If not then

specify the include_path in php.ini

Check the actual and in used php.ini file path

check the pear php executable file path


Now, you will need the output of both above commands to set the include_path in php.ini
try command below but specify the output of above command properly in place.

echo 'include_path = ".:'pear config-get php_dir'"' | sudo tee -a php.ini_path

pear config-get php_dir :- output of this command tried above
php.ini_path :- Actual path of your php.ini file got above.

Step 2:

If the problem is yet not solved for you and still getting fatal then now time to set symlink of pear php executable folder

for me the pear php configuration path was

It may be different for you based on the output of pear config-get php_dir

Run the above command and now check 

Step 3:

If the problem still persists for you then time to do the final smash here.
I am sure it will 100% fix your problem. If not put it in the comment, I will happy to solve it for you personally.

  1. Change directory to /etc with command  cd /etc
  2. look for php.ini file there if not exist create one copying php.ini.default with command
    cp php.ini.default php.ini
  3. Now add the pear path in that php.ini file with command inside /etc directory

The Error is gone, so let’s enjoy and move forward …

If you have any question, Please ask in the comment because I have done through many articles, so I can help you here quick.
check my few other posts related to WordPress Top Posts by Google analytics How to add menu Item programmatically in WordPress?

Recent Comments

  1. With havin so much written content do you ever run into any issues of plagorism
    or copyright violation? My site has a lot of unique content
    I’ve either written myself or outsourced but it looks like a lot of it is popping it up all over the web without my authorization. Do
    you know any techniques to help protect against content from
    being ripped off? I’d really appreciate it.

    • Hey Thomas,
      Although the question is not related to this blog but
      I would love to give you some suggestions for content protection.

      If you want to protect your images from thieves

      1. User Image Water Marking
      there are many plugins that can help you to water mark your image in WordPress.

      2. Disable right click
      Generally, people take content from site html so disabling right click will help you.

      3. adding @copyright notice on your site

      4. Use Yoast SEO plugin and put your content in rss feed.
      So if google will track the content from your site.
      If anyone use your content will be harmful for their site.

      You can also give it a try too

Leave a Reply

Your email address will not be published. Required fields are marked *