- 1 Minute to read
- Print
- DarkLight
- PDF
PHP on macOS
- 1 Minute to read
- Print
- DarkLight
- PDF
Download Latest PHP Profiler
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
2. Copy & extract the profiler:
copy tar.gz file to extraction directory: (example: /usr/local/stackify)
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
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.
read more about phpinfo at php.net
Specifically you'll need:
php version
php.ini location
php extensions directory
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
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
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: