How do I uninstall PHP CodeSniffer on Mac OSX (10.11.6)? - php

I used Pear to install PHP CodeSniffer, and something went terribly wrong. It seems like most of the files weren't copied over. Perhaps I should have installed it with root privileges. It doesn't work, it's a mess, and I want to uninstall it and reinstall it, but I don't know how to uninstall it and I can't find any information about this. The Pear script is long and complicated. I tried:
pear uninstall PHP_CodeSniffer-3.2.3
It says that it's not installed.
But when I try to reinstall over the existing installation, it says I can't because it's already installed.

I found the answer. I'm posting it despite the -1 score I got for my question - up from -2. I'm sure I'm not the only one who had this problem, and it took hours of searching to find the solution. I'm not a pear expert. I only just installed it to use PHP_CodeSniffer.
The pear uninstall command didn't work because the cache needed to be cleared. These commands worked, when logged in as root. I then reinstalled as root.
pear clear-cache
pear uninstall PHP_CodeSniffer

Related

Composer - Installation keeps on failing

I am having a problem in installing Composer. Would you help me solve this?
Here is my scenario:
Before, I am using Composer. I can install packages in my project with no problems. My life was easy. But all of a sudden, something went wrong and I don't what it is. I do not change any configuration in my computer. If I do composer update, there is an error.
something like:
zlib_decode() data error.
I cannot post the screenshot of the error because I already uninstalled Composer hoping that If I reinstall it the problem would be solved.
So I have uninstalled composer, and tried to reinstall it. But now I cannot install Composer using both the windows cmd, and the composer-setup.exe. In the windows cmd, It says, "Installer is corrupted", In the composer-setup.exe the message is : (Failed to decode zlib stream)
Here is what I have tried so far:
I have disabled ESET antivirus. and IPV6 (composer.org degraded mode)
I have disable the firewall.
I have uninstalled composer. but now I cannot install it again.
Here are the other details hope it would help:
I am using Windows 10 64bit
I am using CodeIgniter
I am using XAMPP for Windows
I am running PHP 7.1
I don't know if it is relevant but we have a company domain. and maybe firewall
If there is anything you need to know I will provide it. Hope you can help me with this. Hope I explained my self well. Thanks!
Here is the screenshot:
Screenshot when installed using windows cmd

Uninstall Memcached PHP 5.4 (Installed by Brew)

I have to confess I messed up, I installed the wrong version of Memcached for PHP on my OSX 10.8.5 machine. Basically I used
brew install php54-memcached
After using brew install memcached. My apache won't start up and then I realised I have PHP5.5 ... :(
UPDATE: I tried to remove php 5.4 which I think brew has installed as a dependancy which is causing a conflict. I did sudo rm -rf /usr/local/etc/php/5.4/
Restarted Apache but no cigar.
Any help would be appreciated I tried brew rm php54-memcached but obviously this was no help.
Thanks,
Stefan
Try using:
brew uninstall php54-memcached --force
More tips here.
Ok after hours of digging I think I found it...
Basically Brew had installed 5.4 alongside but changed something in 5.5, it might even have been the self installed PHP (not brew). When I switched the module in the http.conf to point to the 5.4 installation libphp5.so it worked and then when I switched it to the apparent 5.5 version it failed again.
So I just unlinked both and cleared it via homebrew and then effectively reinstalled PHP5.5 via homebrew.
Ideally the php.ini that is used by the Brew installation is the same as the one I was using before so that was nice when I got it back up and running.
I double checked to see if I needed to remove any old files. I only needed to remove the old 5.5 version folder.
One thing to that baffles me though is that when I went into http.conf to change the PHP module link I'm pretty sure it wasn't linking to the Brew version of my PHP5.5 installation but instead to "/usr/libexec/apache2/libphp5.so". This would suggest I was never using the brew version... I'm so confused.
Perhaps when I installed php5.4 by accident it change the bash path... either way everything looks in shape just now so fingers crossed.
Some points to help others:
I followed this to make sure I set it up right
I made sure to link http.conf to the Brew install libphp5.so
I made sure my LaunchAgents plist was the right one
I made sure to update the $PATH (no idea what that really does and welcome any explanations - I've always wondered)
I realise this is terribly formatted and a rambling, but I'm exhausted :)

Installing PEAR + PHPUnit under WINGINX

I need PHPUnit and according to their GitHub page I need to use PEAR to install it.
Problem is, PEAR is not installed by default on WINGINX nor does my PHP folder have a go-pear.bat file as mentioned here: http://pear.php.net/manual/en/installation.getting.php.
So, how do I install PEAR / PHPUnit on WINGINX??
Using Apache is not an option since I need to learn to work with NGINX.
There's little to none documentation on this due WINGINX was released only a few months ago.
This tutorial does also not work since WINGINX does NOT support .htaccess
I have found a solution!!
Since no documentation about this exists yet, and other people might come across this issue as well, I'll explain here how to fix this:
Download the go-pear.phar file and place it in the C:\Winginx\php5\ directory
Open up a terminal and navigate to C:\Winginx\php5\
Type: php go-pear.phar and press enter
Follow the instructions on your screen
Restart NGINX
Open a terminal as Administrator
Run these 2 commands:
pear config-set auto_discover 1
pear install pear.phpunit.de/PHPUnit
Done! You successfully installed PHPUnit
winginx is pretty new. I am not sure if pear support is inbuilt into it as of now. You might want to check with Alexei Shabalin, the author of winginx.
Meanwhile this forum seems to find Alexei saying that pear support is currently not there.
http://translate.google.com/translate?sl=auto&tl=en&js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&u=http%3A%2F%2Fforum.winginx.ru%2Fdiscussion%2F35%2Fpear-i-xml-rpc%2Fp1&act=url

Need procedure to install PEAR (over old version) with go-pear.phar on redhat, centos with php5.3

I'm on CentOS and
So far I've been reading about go-pear and go-pear.phar since my PEAR seems to have gotten behind enough that it can't be upgraded with command: > pear upgrade PEAR
OK, reviews on go-pear.phar seem good, and maybe working with packages and signatures is a necessity. Running on faith here, and forging ahead, I wonder...
Should I remove all of the previous PEAR packages, and if so what is the best way
( hmmmm 'rm' comes to mind )
I'm actually not trying to be an pioneer here; Looking for someone who has done this ( In a controlled manner, and With a Positive Outcome ) ie: I don't want to botch my Server Box.
What else will I need to know about locations (/usr/share) and php.ini file configuration.
I'm open to PEAR install tips, with .phar and want to learn more about it.
Suggestions and pointers welcome. TIA (thanks in advance)
This problem should be solved with RHEL in order to be solved in CentOS, here is the bug report about that problem:
PHP53 Lacks php53-pear
Install the older php-pear via yum install php-pear and than run the following commands:
pear upgrade --force Console_Getopt
pear upgrade --force pear
pear upgrade-all
(It seems that these commands will solve the issue, it worked for labradort from the linked bug report and it worked for me)

Pear SOAP and XAMPP on Ubuntu

All,
I have installed xampp for linux on ubuntu 9.10. The installation directory is /opt/lampp. The xampp website says PEAR comes with the installation.. I am relatively new to PEAR and want to know the answers for following:
Is PEAR installed with xampp or need to be installed separately using synaptic package manager? I browse to /opt/lampp/bin directory and see "pear" there, but when i type it in the command line, it says
"The program 'pear' is currently not installed. You can install it by typing:
sudo apt-get install php-pear
pear: command not found
"
I want to use PEAR:SOAP package in my PHP code. How to use that? Do I need to set any paths to the pear in my php.ini?
Thanks
I figured it out.. xampp comes with pear... So, what I did was..
cd /opt/lampp/bin
sudo ./pear install soap
In PHP code, "require_once("SOAP/Client.php");
That's all !! :)
from what I was able to ascertain from my coleagues, you would need to populate pear to be able to use it.
It does come with the installation, but requires the population to be used.
source for code
First, go to your xampp installation
directory/folder and navigate to the
php directory. For me it’s
x:\xamplite\php
x:
cd \xampplite\php
pear install <package-name>
once this is done pear should be available to be used. And as for the second question. XAMPP should have taken care of any settings that were needed. You should not require any additions into the .ini for it to work.
However remember that there are no secuiritis when programming in this fashion, as stated by the XAMPP website.
EDIT**
also you have Pear Ubuntu install guide link that may help.
The error message you got back should be enough. Apparently the pear program isn't in your path. How did you install XAMPP? Did you use the package manager, or did you install it yourself?
If you used the package manager, then this is the correct next step:
sudo apt-get install php-pear
As you were given in the command help. Ubuntu doesn't install a lot of things by default, but it does install a database of stuff you might type, and what package you need to install to get that command to work.
If you installed it yourself, then you need to figure out how to get PEAR to register as being installed.

Categories