Почему показ груши и phpunit не установлен в xampp на Ubuntu?

848
Haque

Я установил xampp 1.8 на свою Ubuntu 12.04. В / opt / lampp / lib / php / PEAR я вижу, что есть два каталога с именами PEAR и PHPUnit.

Но когда я запускаю pear -V или phpunit из терминала, он выдает следующие сообщения:

Программа «груша» в настоящее время не установлена. Вы можете установить его, набрав: sudo apt-get install php-pear

а также

Программа phpunit в настоящее время не установлена. Вы можете установить его, набрав: sudo apt-get install phpunit

Почему эти сообщения отображаются? Нужно ли снова устанавливать грушу и phpunit. Если так, как это сделать, поскольку у меня все еще есть каталоги PEAR и PHPUnit / opt / lampp / lib / php /

1
Кто-нибудь сталкивался с такой проблемой? Haque 10 лет назад 0
Должен ли я спросить об этом в stackoverflow? Haque 10 лет назад 0

2 ответа на вопрос

0
cweiske

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.

0
RCheesley

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.

Похожие вопросы