Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I seem to be having a problem with PHPUnit running properly on my machine.

I have Pear installed and running correctly on my machine, and then followed this guide to the letter:

But when I type phpunit in terminal in Ubuntu, I get the following response:

PHP Warning:  require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in /home/thalley887/pear/share/pear/PHPUnit/Autoload.php on line 45
PHP Stack trace:
PHP   1. {main}() /home/thalley887/pear/bin/phpunit:0
PHP   2. require() /home/thalley887/pear/bin/phpunit:43
PHP Fatal error:  require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.:/usr/share/php') in /home/thalley887/pear/share/pear/PHPUnit/Autoload.php on line 45
PHP Stack trace:
PHP   1. {main}() /home/thalley887/pear/bin/phpunit:0
PHP   2. require() /home/thalley887/pear/bin/phpunit:43

I have checked in my php.ini file and have the following line:

include_path = ".:/usr/share/php"

I am using Ubuntu 12.04. Please comment if I can give anymore details. If I can't fix this I am going to jump out of the window!!

share|improve this question

Launch a sudo find /usr/share/ -name Iterator -type d | grep File/Iterator

If you have no results, the packages is missing, reinstall with

pear install phpunit/File_Iterator

If still does not work, try reinstall phpunit

pear install --force --alldeps phpunit/phpunit

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.