---
title: "PHP on macOS"
slug: "prefix-php-on-macos"
updated: 2022-08-11T17:59:26Z
published: 2022-08-11T17:59:26Z
excludeFromSearch: true
excludeFromExternalSearch: true
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PHP on macOS

## Download Latest PHP Profiler

          M1 Support

          

PHP on M1 devices is supported with PHP profiler version 1.13.12 and above.

**1. Get the latest Stackify PHP Profiler for Prefix:** [https://download.stackify.com/stackify-php-apm/stackify-php-apm-macos-latest.tar.gz](https://download.stackify.com/stackify-php-apm/stackify-php-apm-macos-latest.tar.gz)

**2. Copy & extract the profiler:** copy tar.gz file to extraction directory: (example: /usr/local/stackify)

          NOTE: create extraction directory if it doesn't exist:

          

*sudo mkdir /usr/local/stackify*

```
cd /usr/local/stackify/ && sudo cp ~/Downloads/stackify-php-apm-macos-latest.tar.gz ./stackify-php-apm-latest.tar.gz && sudo tar -zxvf stackify-php-apm-latest.tar.gz
```

![PHP untar extension.png](https://cdn.document360.io/3fcaf473-a1ef-4778-aa2c-fd28411c2b01/Images/Documentation/PHP%20untar%20extension.png)

## Auto Install Script

Run the included install script:

```
sudo bash ./install.sh
```

## Manual Install

#### Get PHP Config information

Because every system is setup differently, phpinfo() is commonly used to check configuration settings and for available predefined variables on a given system. ![Example PHP Info.png](https://cdn.document360.io/3fcaf473-a1ef-4778-aa2c-fd28411c2b01/Images/Documentation/Example%20PHP%20Info.png)

[read more about phpinfo at php.net](https://www.php.net/manual/en/function.phpinfo.php)

#### Specifically you'll need:

1. php version ![PHP version.png](https://cdn.document360.io/3fcaf473-a1ef-4778-aa2c-fd28411c2b01/Images/Documentation/PHP%20version.png)
2. php.ini location ![PHP ini locations.png](https://cdn.document360.io/3fcaf473-a1ef-4778-aa2c-fd28411c2b01/Images/Documentation/PHP%20ini%20locations.png)
3. php extensions directory ![PHP extension directory (Core).png](https://cdn.document360.io/3fcaf473-a1ef-4778-aa2c-fd28411c2b01/Images/Documentation/PHP%20extension%20directory%20%28Core%29.png)

#### Install the PHP profiler

**1. Navigate to your PHP extensions directory: (found in your phpinfo)**

```
cd /extension_dir/from/php.ini (example: /usr/local/lib/php/pecl)
```

**2. Copy Stackify files to your PHP extensions directory:**

```
cp /usr/local/stackify/macos/stackify-7.4.so ./stackify.so
```

          Important:

          

use the extension for your matching PHP version (i.e. stackify-7.4.so)

```
cp /usr/local/stackify/Stackify.php ./Stackify.php
```

**3. Add the extension to your php.ini:** Navigate to your php.ini file (found in your phpinfo) and add the following settings:

```
[stackify]
extension=stackify.so
stackify.application_name=My PHP Application
stackify.environment_name=Development
stackify.prefix_enabled=1
```

          Dedicated stackify.ini file:

          

Alternatively, instead of editing your global php.ini file you can add these settings to an isolated stackify.ini file. This file should be placed in the directory found in the **Scan this dir for additional .ini files** section of your phpinfo (example: /usr/local/etc/php/7.4/conf.d)

## Verify the profiler is installed

reload your phpinfo page and you should now see the [Stackify] section has been added with your configuration details: ![PHP stackify extension (Stackify).png](https://cdn.document360.io/3fcaf473-a1ef-4778-aa2c-fd28411c2b01/Images/Documentation/PHP%20stackify%20extension%20%28Stackify%29.png)
