When I see your code, I see that your machine does not have the mbstring extension.
phpunit/phpunit 8.0.4 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
You must install this extension (or activate it) before trying to install Phpunit.
Solution 1 - Activating the extension:
Look for the php.ini configuration file on your machine. To find where it is, type the command in the terminal php -i
.
Search in the first lines a line started like this: Configuration File (php.ini) Path
. What comes next indicates the folder where your configuration file is.
Locate this folder and open the file php.ini
. Then add the following line:
(If you are on Windows)
extension=php_mbstring.dll
(If you are on Linux)
extension=php_mbstring.so
Run the installation command again. If you are giving error, let’s go to the 2nd solution:
Solution 2 - Activating mbstring
In Ubuntu you must execute the following command:
sudo apt install php-mbstring
I think with that, you should solve your problem.
I hope I’ve helped.
P.S.: Please inform your operating system and which server you are using, editing the question, so we can offer the best answer for you.
Issue #1 to reflect changes to the question
The mistake: Problem 1 - Installation request for phpunit/phpunit 8.0.4 -> satisfiable by phpunit/phpunit[8.0.4]. - phpunit/phpunit 8.0.4 requires php ^7.2 -> your PHP version (7.0.33) does not satisfy that requirement.
indicates that the PHP version is not supported by the latest version of Phpunit.
You can solve it in two ways:
- Installing an old version of Phpunit or,
- Installing a newer version of PHP.
I hope I’ve helped.
That answer might help you: How to confiscate phpunit in the right way
– DNick