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 Click – Click – Click 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.
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.
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
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.
- Change directory to /etc with command
- look for php.ini file there if not exist create one copying php.ini.default with command
cp php.ini.default php.ini
- 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?