markdown Instalasi php 7.1 di MacOS menggunakan homebrew
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown Instalasi php 7.1 di MacOS menggunakan homebrew相关的知识,希望对你有一定的参考价值。
# Instalasi PHP 7.1 di MacOS High Sierra menggunakan Homebrew
Asumsi homebrew sudah terinstall, apabila belum silahkan diinstall terlebih dahulu, kemudian lakukan instalasi wget untuk memastikan instalasi homebrew sudah dapat digunakan. [https://brew.sh/](https://brew.sh/)
```bash
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install wget
```
Lakukan instalasi php 7.1 juga dengan menggunakan brew
```bash
RockIT:~ tjrocks$ brew tap homebrew/dupes
Updating Homebrew...
Warning: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated.
==> Tapping homebrew/dupes
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-dupes'...
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 5 (delta 0), reused 3 (delta 0), pack-reused 0
Unpacking objects: 100% (5/5), done.
Tapped 0 formulae (30 files, 23.4KB)
RockIT:~ tjrocks$ brew tap homebrew/versions
Warning: homebrew/versions was deprecated. This tap is now empty as all its formulae were migrated.
==> Tapping homebrew/versions
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-versions'...
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 9 (delta 0), reused 5 (delta 0), pack-reused 0
Unpacking objects: 100% (9/9), done.
Tapped 0 formulae (37 files, 31.1KB)
RockIT:~ tjrocks$ brew tap homebrew/homebrew-php
==> Tapping homebrew/php
Cloning into '/usr/local/Homebrew/Library/Taps/homebrew/homebrew-php'...
remote: Counting objects: 793, done.
remote: Compressing objects: 100% (608/608), done.
remote: Total 793 (delta 532), reused 241 (delta 177), pack-reused 0
Receiving objects: 100% (793/793), 315.45 KiB | 195.00 KiB/s, done.
Resolving deltas: 100% (532/532), done.
Tapped 759 formulae (808 files, 1.4MB)
RockIT:~ tjrocks$ php --version
PHP 7.1.7 (cli) (built: Jul 15 2017 18:08:09) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
```
### Reinstall php71 dengan parameter --with-pear
Apabila ada yang terlupa pada instalasi awal lakukan reinstall dan tambahkan parameter yang ingin ditambahkan, contoh reinstall dengan pear;
```bash
$ brew reinstall php71 --with-pear
```
### Install mcrypt extension
```bash
$ brew install homebrew/php/php71-mcrypt
To finish installing mcrypt for PHP 7.1:
* /usr/local/etc/php/7.1/conf.d/ext-mcrypt.ini was created,
do not forget to remove it upon extension removal.
* Validate installation via one of the following methods:
*
* Using PHP from a webserver:
* - Restart your webserver.
* - Write a PHP page that calls "phpinfo();"
* - Load it in a browser and look for the info on the mcrypt module.
* - If you see it, you have been successful!
*
* Using PHP from the command line:
* - Run `php -i "(command-line 'phpinfo()')"`
* - Look for the info on the mcrypt module.
* - If you see it, you have been successful!
```
以上是关于markdown Instalasi php 7.1 di MacOS menggunakan homebrew的主要内容,如果未能解决你的问题,请参考以下文章