--- title: "PHP on Linux" slug: "prefix-php-on-linux" description: "Install Prefix PHP profiler, set permissions, run install.sh, and verify requests in Prefix for efficient performance monitoring." updated: 2023-11-06T21:19:12Z published: 2023-11-06T21:19:12Z canonical: "docs.stackify.com/prefix-php-on-linux" --- > ## 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 Linux ### 1. Download and install the Prefix installation file: Check out the [Getting Started](https://docs.stackify.com/v1/docs/prefix-getting-started) Prefix page to download and install Prefix on your workstation. ### 2. Create and set the permissions for the PHP profiler installation folder. ``` mkdir -p "/usr/local/stackify/stackify-php-apm" chmod -R 777 "/usr/local/stackify/stackify-php-apm" ``` ### 3. Get the Prefix PHP profiler from Stackify. [https://stackifyversionwarehouse.azurewebsites.net/v1/package/stackify-php-apm/linux](https://stackifyversionwarehouse.azurewebsites.net/v1/package/stackify-php-apm/linux) And put it in a folder of your choice. (It doesn’t need to be the final installation folder) ``` mkdir -p “/tmp/php_profiler wget -O “/tmp/php_profiler/profiler.tar.gz” \ “https://stackifyversionwarehouse.azurewebsites.net/v1/package/stackify-php-apm/linux” ``` ### 4.Go into the directory and extract profiler.tar.gz ``` cd “/tmp/php_profiler” tar -xzf “profiler.tar.gz” ``` ### 5. Run install.sh to install the PHP profiler ``` ./install.sh ``` Use sudo if you need permissions. ``` sudo ./install.sh ``` ### 6. Set the StackifyPrefix environment variable: In your `/etc/environment` file, append the following command `StackifyPrefix=1` Add the following lines to your php.ini ``` [stackify] extension=stackify.so stackify.application_name=My PHP Application stackify.environment_name=Production ``` Replace the `application_name` and `environment_name` values with your application and environment name ### 7. Verify your requests show in Prefix