######################################################
How to install PHP, PHPUnit and composer on Mac
######################################################
1.PHP installation
# curl -s http://php-osx.liip.ch/install.sh | bash -s 7.4
# cd /usr/local/bin
# ln -s /usr/local/php74/bin/php php
# ln -s /usr/local/php74/bin/phpize phpize
# ln -s /usr/local/php74/bin/php-config php-config
# php -v
PHP 7.4.7 (cli) (built: Jun 12 2020 00:00:24) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v3.0.0-dev, Copyright (c) 2002-2020, by Derick Rethans
with Zend OPcache v7.4.7, Copyright (c), by Zend Technologies
To download and install the current stable version of PHPUnit:
# wget https://phar.phpunit.de/phpunit.phar
# chmod +x phpunit.phar
# mv phpunit.phar /usr/local/bin/phpunit
# phpunit --version
PHPUnit 9.2.3 by Sebastian Bergmann and contributors.
To download and install the latest version of composer:
# curl -sS https://getcomposer.org/installer | php
# chmod +x composer.phar
# mv composer.phar /usr/local/bin/composer
# composer -V
Composer version 1.10.7 2020-06-03 10:03:56
Set the paths for PHP:
echo 'export PATH="/usr/local/opt/php@7.4.7/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/php@7.4.7/sbin:$PATH"' >> ~/.bash_profile
Comments
Post a Comment