Why showing pear and phpunit is not installed in xampp on ubuntu?

1

I have installed xampp 1.8 on my ubuntu 12.04. In /opt/lampp/lib/php/PEAR I can see there are two directory named PEAR and PHPUnit.

But when I run pear -V or phpunit from terminal it gives the below messages:

The program 'pear' is currently not installed. You can install it by typing: sudo apt-get install php-pear

and

The program 'phpunit' is currently not installed. You can install it by typing: sudo apt-get install phpunit

Why these messages are showing ? Do I need to install pear and phpunit again. If so how to do this as I still have PEAR and PHPUnit directory /opt/lampp/lib/php/

Haque

Posted 2013-06-12T09:38:39.953

Reputation: 11

Is there anyone who have faced this type of problem – Haque – 2013-06-12T11:47:00.433

Should I ask this in stackoverflow ? – Haque – 2013-06-12T17:10:54.987

Answers

0

I also had this problem and the steps I followed to resolve it were as follows:

  • I had PHP installed separate to XAMPP from a previous attempt so I removed it first using sudo apt-get -y purge php.* to ensure that I was using the XAMPP PHP setup (as this was causing some confusion!)
  • Edit the .bashrc file in the following location: /home/<your user>/.bashrc
  • Add at the bottom of the page the path to the /bin folder in XAMPP - in my case this was PATH=$PATH:/opt/lampp/bin

After I followed these steps, closed down my Konsole window and re-opened then I could run the PHP script I was trying to use.

RCheesley

Posted 2013-06-12T09:38:39.953

Reputation: 101

0

You need to add the xampp bin/ directory to your $PATH variable; otherwise the executables cannot be found.

This could be done by e.g.

PATH=$PATH:/opt/lampp/lib/php/bin

in your .bashrc, so it gets automatically executed whenever you open a terminal.

cweiske

Posted 2013-06-12T09:38:39.953

Reputation: 1 010