text 在macOS Mojave上设置PHP 7.2(带自制软件)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 在macOS Mojave上设置PHP 7.2(带自制软件)相关的知识,希望对你有一定的参考价值。

Set up PHP 7.2 on macOS Mojave (with homebrew)
==============================================

 less than 1 minute read

To check the version of PHP in the terminal, type the following command:

```
php -v

```

or can see what versions of PHP are installed with 

```
brew list | grep php

```

Maybe it's worth cleaning up some of the old packages from brew. It's up to you.

Make sure brew is up to date:

```
brew update
brew upgrade

```

Let's finally install 7.2 version of PHP

```
brew install php@7.2

```

If you need to have this version of PHP first in your `PATH` run the following command:

```
echo 'export PATH="/usr/local/opt/php@7.2/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/php@7.2/sbin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile

```

And the result?

```
php --version

```

Where is a php.ini file?

Your .ini file is located in `/usr/local/etc/php/7.2/php.ini`. To check just type

```
php --ini

```

How to install extensions?

PHP extensions have been removed and now should be installed from `PECL`:

```
pecl install xdebug
```

以上是关于text 在macOS Mojave上设置PHP 7.2(带自制软件)的主要内容,如果未能解决你的问题,请参考以下文章

无法在 macOS mojave 上编辑我的 config.inc.php 文件,已下载 XAMPP

markdown 在MacOS中安装PHP MSSQL驱动程序(Mojave)

如何在 macOS 10.14.4 Mojave 上使用 fink

在 CLion 中设置 OpenMP 项目 MacOS Mojave

麻烦在 MacOS Mojave 上安装 pymssql

sh 在macOS Mojave上重新安装Brew的XCode命令行工具