When provisioning a server, you must decide which version of PHP you want to install by default. The php binary on your server will point to the installed version selected at the time of its creation.Once the server has been created, Laravel Forge makes it easy to install additional versions alongside the default version.
To install a PHP version, navigate to the server’s dashboard and click the Runtime tab, then click PHP. Click the Install version button, select the version to install and decide whether you want it to become the CLI default. Click Install to begin the installation process.When you install a new version of PHP onto your server, Laravel Forge will create and configure the PHP-FPM process for that version. This means that your server will be running multiple versions of PHP at once.
To uninstall a PHP version, navigate to the server’s dashboard and click the Runtime tab, then click PHP. Locate the version of PHP you want to remove, open the dropdown menu and click Uninstall PHP X.X and confirm the removal.PHP versions may be removed so long as:
There are other versions installed
The version you wish to uninstall is not the server’s default version for new sites
The version you wish to uninstall is not the server’s default version on the CLI
The version you wish to uninstall is not used by any sites
When an additional version of PHP has been installed, you may reference it on the CLI via phpx.x, replacing the x.x with the version number (e.g., php8.5). The php binary will always point to the active CLI version (if changed from the default).
The “default” PHP version is the version of PHP that will be used by default when creating a new site on the server.When selecting a new version of PHP as your server’s “default” version, the PHP versions used by existing sites will not be updated.
To patch a PHP version, navigate to the server’s dashboard and click the Runtime tab, then click PHP. Identify the version of PHP you want to patch, open the dropdown menu and click Update.
Typically, patch updates should not cause any breaking changes to your server, although a few seconds of downtime is possible. We recommend that you exercise caution when patching PHP.
You may configure the maximum file upload size by clicking the Runtime tab, then PHP of the server management dashboard. This value should be provided in megabytes. For reference, 1024MB is 1GB.
You may configure the maximum execution time through the by clicking the Runtime tab, then PHP of the server management dashboard. This value should be provided in seconds. Forge applies this value across your server by updating the following configurations:
max_execution_time in php.ini.
request_terminate_timeout in the PHP-FPM www.conf (for each installed PHP version).
Optimizing the PHP OPcache for production will configure OPcache to store your compiled PHP code in memory to greatly improve performance. If you choose to optimize OPcache for production, you should verify that your deployment script reloads the PHP-FPM service at the end of each deployment unless you’re using zero-downtime deployments.
OPcache is enabled by default for all newly created servers.
You can customize the php.ini and FPM settings for individual PHP versions. To edit these settings, navigate to the server’s dashboard and click the “PHP” tab. Locate the version of PHP you want to configure, open the dropdown menu next to that version, and select either:
Edit PHP-FPM configuration - Modify the PHP FPM (web) configuration for this specific PHP version
Edit PHP CLI configuration - Modify the PHP CLI (command-line interface) configuration for this specific PHP version
These settings apply only to the individual version of PHP selected and will not affect other PHP versions installed on your server.
PHP “beta” and “release candidate” releases are often available on Laravel Forge weeks before their final release. This allows you to experiment with upcoming major PHP versions on sites that are not in production. However, some Forge features, PHP features, and PHP extensions may not work as expected during that period.
Once that PHP version becomes stable, you will need to fully uninstall and re-install the PHP version.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Laravel Forge","colors":{"primary":"#18B69B","light":"#18B69B","dark":"#18B69B"},"logo":{"light":"https://mintcdn.com/forge-laravel/sHyXHYyrLoATu64X/logo/logo.svg?fit=max\u0026auto=format\u0026n=sHyXHYyrLoATu64X\u0026q=85\u0026s=469c693d945743b5870032ffac8d67b7","dark":"https://mintcdn.com/forge-laravel/sHyXHYyrLoATu64X/logo/logo.svg?fit=max\u0026auto=format\u0026n=sHyXHYyrLoATu64X\u0026q=85\u0026s=469c693d945743b5870032ffac8d67b7","href":"https://forge.laravel.com"},"favicon":"https://mintcdn.com/forge-laravel/DhXK7kFkCTo-2V2J/favicon.png?fit=max\u0026auto=format\u0026n=DhXK7kFkCTo-2V2J\u0026q=85\u0026s=eda7438a183a53fc59e814b80feebd59","api":{"playground":{"display":"simple"},"examples":{"languages":["php","bash","javascript","go"]}},"background":{"decoration":"windows"},"navbar":{"primary":{"type":"button","label":"Get started","href":"https://forge.laravel.com"}},"footer":{"socials":{"x":"https://x.com/laravel","github":"https://github.com/laravel","discord":"https://discord.com/invite/laravel","linkedin":"https://linkedin.com/company/laravel"}},"seo":{"metatags":{"canonical":"https://laravel.com/forge/docs"}},"fonts":{"heading":{"family":"Figtree"},"body":{"family":"Figtree"}},"integrations":{"fathom":{"siteId":"UZINDLYX"}},"contextual":{"options":["copy","chatgpt","claude","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Community","icon":"discord","href":"https://discord.gg/laravel"},{"anchor":"Blog","icon":"newspaper","href":"https://blog.laravel.com"},{"anchor":"Status","icon":"heart-pulse","href":"https://status.on-forge.com"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"forge-laravel","hasAudioNarration":false,"actualSubdomain":"forge-laravel","customDomains":["forge.laravel.com"],"gitSource":{"type":"github","owner":"laravel","repo":"forge-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae35736befa89197b16df06","collectionId":"706b0864-66ed-4e31-83ec-2dda6fe33b80","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae35736befa89197b16df06"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae35736befa89197b16df06","clientVersion":"0.0.4021","searchFilterCounts":[{"language":"default","tag":"Documentation","count":49},{"language":"default","tag":"Sites","count":11},{"language":"default","tag":"Resources","count":10},{"language":"default","tag":"Basics","count":9},{"language":"default","tag":"Servers","count":9},{"language":"default","tag":"Knowledge Base","count":7},{"language":"default","tag":"API Reference","count":5},{"language":"default","tag":"Introduction","count":5},{"language":"default","tag":"Troubleshooting","count":5},{"language":"default","tag":"Integrations","count":4}]},"assistantConfig":{},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"/* latin-ext */\n@font-face {\n font-family: 'Instrument Sans';\n font-style: normal;\n font-weight: 400 500;\n font-stretch: 100%;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/instrumentsans/v4/pxiTypc9vsFDm051Uf6KVwgkfoSxQ0GsQv8ToedPibnr0She1YmV.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Instrument Sans';\n font-style: normal;\n font-weight: 400 500;\n font-stretch: 100%;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/instrumentsans/v4/pxiTypc9vsFDm051Uf6KVwgkfoSxQ0GsQv8ToedPibnr0SZe1Q.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrodmgPn.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrMdmgPn.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* symbols2 */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFg08vz7ehw.woff2) format('woff2');\n unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrgdmgPn.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrkdmgPn.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrcdmg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\nbody{font-family:\"Instrument Sans\";font-weight:400}h1,h2,h3,h4{letter-spacing:-.025rem!important}code,pre{font-family:'Geist Mono',ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,'Liberation Mono','Courier New',monospace}.font-semibold,b,h1,h2,h3,h4,strong{font-weight:500!important}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500!important;color:rgb(var(--primary-light))!important}.codeblock-dark div:not(:last-child){color:#fafafa}"}],"page":{"pagePath":"servers/php","slug":"/servers/php","pageMetadata":{"title":"PHP","description":"Learn how to manage PHP versions on your Laravel Forge server.","href":"/servers/php"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Learn how to manage PHP versions on your Laravel Forge server.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{Heading,Tip,Warning}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`introduction`,children:`Introduction`}),`\n`,_jsxs(_components.p,{children:[`Laravel Forge makes it easy to install and configure multiple versions of PHP on your server. Each installed PHP version runs its own FPM process. In addition, you may `,_jsx(_components.a,{href:`/sites/the-basics#php-version`,children:`update the PHP version used by specific sites at any time`}),`.`]}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Laravel Forge is only aware of PHP installations that are managed through the Forge dashboard and not manually installed on the server.`})}),`\n`,_jsx(Heading,{level:`2`,id:`managing-php-versions`,children:`Managing PHP versions`}),`\n`,_jsxs(_components.p,{children:[`When provisioning a server, you must decide which version of PHP you want to install by default. The `,_jsx(_components.code,{children:`php`}),` binary on your server will point to the installed version selected at the time of its creation.`]}),`\n`,_jsx(_components.p,{children:`Once the server has been created, Laravel Forge makes it easy to install additional versions alongside the default version.`}),`\n`,_jsx(Heading,{level:`3`,id:`installing-php-versions`,children:`Installing PHP versions`}),`\n`,_jsx(_components.p,{children:`To install a PHP version, navigate to the server’s dashboard and click the Runtime tab, then click PHP. Click the Install version button, select the version to install and decide whether you want it to become the CLI default. Click Install to begin the installation process.`}),`\n`,_jsx(_components.p,{children:`When you install a new version of PHP onto your server, Laravel Forge will create and configure the PHP-FPM process for that version. This means that your server will be running multiple versions of PHP at once.`}),`\n`,_jsx(Heading,{level:`3`,id:`uninstalling-php-versions`,children:`Uninstalling PHP versions`}),`\n`,_jsx(_components.p,{children:`To uninstall a PHP version, navigate to the server’s dashboard and click the Runtime tab, then click PHP. Locate the version of PHP you want to remove, open the dropdown menu and click Uninstall PHP X.X and confirm the removal.`}),`\n`,_jsx(_components.p,{children:`PHP versions may be removed so long as:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`There are other versions installed`}),`\n`,_jsx(_components.li,{children:`The version you wish to uninstall is not the server’s default version for new sites`}),`\n`,_jsx(_components.li,{children:`The version you wish to uninstall is not the server’s default version on the CLI`}),`\n`,_jsx(_components.li,{children:`The version you wish to uninstall is not used by any sites`}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`php-on-the-cli`,children:`PHP on the CLI`}),`\n`,_jsxs(_components.p,{children:[`When an additional version of PHP has been installed, you may reference it on the CLI via `,_jsx(_components.code,{children:`phpx.x`}),`, replacing the `,_jsx(_components.code,{children:`x.x`}),` with the version number (e.g., `,_jsx(_components.code,{children:`php8.5`}),`). The `,_jsx(_components.code,{children:`php`}),` binary will always point to the active CLI version (if changed from the default).`]}),`\n`,_jsx(Heading,{level:`3`,id:`default-php-installation`,children:`Default PHP installation`}),`\n`,_jsx(_components.p,{children:`The “default” PHP version is the version of PHP that will be used by default when creating a new site on the server.`}),`\n`,_jsxs(_components.p,{children:[`When selecting a new version of PHP as your server’s “default” version, the PHP versions used by existing sites `,_jsx(_components.strong,{children:`will not be updated`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`patching-php-versions`,children:`Patching PHP versions`}),`\n`,_jsx(_components.p,{children:`To patch a PHP version, navigate to the server’s dashboard and click the Runtime tab, then click PHP. Identify the version of PHP you want to patch, open the dropdown menu and click Update.`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Typically, patch updates should not cause any breaking changes to your server, although a few seconds of downtime is possible. We recommend that you exercise caution when patching PHP.`})}),`\n`,_jsx(Heading,{level:`2`,id:`common-php-configuration-settings`,children:`Common PHP configuration settings`}),`\n`,_jsx(_components.p,{children:`Changing the following settings will apply the changes to all versions of PHP installed on the server.`}),`\n`,_jsx(Heading,{level:`3`,id:`max-file-upload-size`,children:`Max file upload size`}),`\n`,_jsxs(_components.p,{children:[`You may configure the maximum file upload size by clicking the Runtime tab, then PHP of the server management dashboard. This value should be provided in megabytes. For reference, `,_jsx(_components.code,{children:`1024MB`}),` is `,_jsx(_components.code,{children:`1GB`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`max-execution-time`,children:`Max execution time`}),`\n`,_jsx(_components.p,{children:`You may configure the maximum execution time through the by clicking the Runtime tab, then PHP of the server management dashboard. This value should be provided in seconds. Forge applies this value across your server by updating the following configurations:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`max_execution_time`}),` in `,_jsx(_components.code,{children:`php.ini`}),`.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`request_terminate_timeout`}),` in the PHP-FPM `,_jsx(_components.code,{children:`www.conf`}),` (for each installed PHP version).`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`fastcgi_read_timeout`}),` in your Nginx configuration.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`opcache`,children:`OPcache`}),`\n`,_jsxs(_components.p,{children:[`Optimizing the PHP OPcache for production will configure OPcache to store your compiled PHP code in memory to greatly improve performance. If you choose to optimize OPcache for production, you should verify that your deployment script `,_jsx(_components.a,{href:`/knowledge-base/servers#restarting-php-fpm`,children:`reloads the PHP-FPM service`}),` at the end of each deployment unless you’re using zero-downtime deployments.`]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`OPcache is enabled by default for all newly created servers.`})}),`\n`,_jsx(Heading,{level:`3`,id:`editing-php-and-fpm-configuration-settings`,children:`Editing PHP and FPM configuration settings`}),`\n`,_jsxs(_components.p,{children:[`You can customize the `,_jsx(_components.code,{children:`php.ini`}),` and FPM settings for individual PHP versions. To edit these settings, navigate to the server’s dashboard and click the “PHP” tab. Locate the version of PHP you want to configure, open the dropdown menu next to that version, and select either:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Edit PHP-FPM configuration`}),` - Modify the PHP FPM (web) configuration for this specific PHP version`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Edit PHP CLI configuration`}),` - Modify the PHP CLI (command-line interface) configuration for this specific PHP version`]}),`\n`]}),`\n`,_jsx(_components.p,{children:`These settings apply only to the individual version of PHP selected and will not affect other PHP versions installed on your server.`}),`\n`,_jsx(Heading,{level:`2`,id:`beta-and-release-candidates`,children:`Beta and release candidates`}),`\n`,_jsx(_components.p,{children:`PHP “beta” and “release candidate” releases are often available on Laravel Forge weeks before their final release. This allows you to experiment with upcoming major PHP versions on sites that are not in production. However, some Forge features, PHP features, and PHP extensions may not work as expected during that period.`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`Once that PHP version becomes stable, you will need to fully uninstall and re-install the PHP version.`})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"PHP","description":"Learn how to manage PHP versions on your Laravel Forge server.","href":"/servers/php"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Introduction","slug":"introduction","depth":2,"children":[]},{"title":"Managing PHP versions","slug":"managing-php-versions","depth":2,"children":[{"title":"Installing PHP versions","slug":"installing-php-versions","depth":3,"children":[]},{"title":"Uninstalling PHP versions","slug":"uninstalling-php-versions","depth":3,"children":[]},{"title":"PHP on the CLI","slug":"php-on-the-cli","depth":3,"children":[]},{"title":"Default PHP installation","slug":"default-php-installation","depth":3,"children":[]},{"title":"Patching PHP versions","slug":"patching-php-versions","depth":3,"children":[]}]},{"title":"Common PHP configuration settings","slug":"common-php-configuration-settings","depth":2,"children":[{"title":"Max file upload size","slug":"max-file-upload-size","depth":3,"children":[]},{"title":"Max execution time","slug":"max-execution-time","depth":3,"children":[]},{"title":"OPcache","slug":"opcache","depth":3,"children":[]},{"title":"Editing PHP and FPM configuration settings","slug":"editing-php-and-fpm-configuration-settings","depth":3,"children":[]}]},{"title":"Beta and release candidates","slug":"beta-and-release-candidates","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/forge-laravel/1bbd0658b78e8288/rudder.js","/docs/_mintlify/custom/forge-laravel/cf2463a5a064fd05/plain.js"],"subdomain":"forge-laravel","siteName":"Laravel Forge","title":"PHP - Laravel Forge","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-21T14:18:15.409Z","originalFileLocation":"servers/php.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Learn how to manage PHP versions on your Laravel Forge server.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Laravel Forge\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"PHP - Laravel Forge\">\u003cmeta data-mint-head property=\"og:description\" content=\"Learn how to manage PHP versions on your Laravel Forge server.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Laravel Forge\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://laravel.com/forge/docs/servers/php\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://forge-laravel.mintlify.app/_mintlify/api/og/v2?division=Servers\u0026amp;title=PHP\u0026amp;description=Learn+how+to+manage+PHP+versions+on+your+Laravel+Forge+server.\u0026amp;theme=1c0f39d14eacb1d14985e191\u0026amp;signature=e58ff4f80f270ec002f0e69e53ed4cacee084e1c8572cc3a84a2d5640c1592b8\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"PHP - Laravel Forge\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Learn how to manage PHP versions on your Laravel Forge server.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://forge-laravel.mintlify.app/_mintlify/api/og/v2?division=Servers\u0026amp;title=PHP\u0026amp;description=Learn+how+to+manage+PHP+versions+on+your+Laravel+Forge+server.\u0026amp;theme=1c0f39d14eacb1d14985e191\u0026amp;signature=e58ff4f80f270ec002f0e69e53ed4cacee084e1c8572cc3a84a2d5640c1592b8\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Laravel Forge\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#18B69B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://laravel.com/forge/docs/servers/php\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/servers/php.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://laravel.com/#organization\",\"name\":\"Laravel Forge\",\"url\":\"https://laravel.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/forge-laravel/sHyXHYyrLoATu64X/logo/logo.svg?fit=max\u0026auto=format\u0026n=sHyXHYyrLoATu64X\u0026q=85\u0026s=469c693d945743b5870032ffac8d67b7\"}},{\"@type\":\"WebSite\",\"@id\":\"https://laravel.com/forge/docs#website\",\"name\":\"Laravel Forge\",\"url\":\"https://laravel.com/forge/docs\",\"publisher\":{\"@id\":\"https://laravel.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://laravel.com/forge/docs/servers/php#webpage\",\"url\":\"https://laravel.com/forge/docs/servers/php\",\"name\":\"PHP\",\"description\":\"Learn how to manage PHP versions on your Laravel Forge server.\",\"dateModified\":\"2026-10-21T14:18:15.409Z\",\"isPartOf\":{\"@id\":\"https://laravel.com/forge/docs#website\"},\"breadcrumb\":{\"@id\":\"https://laravel.com/forge/docs/servers/php#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://laravel.com/forge/docs/servers/php#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Servers\",\"item\":\"https://laravel.com/forge/docs/servers/the-basics\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP\",\"item\":\"https://laravel.com/forge/docs/servers/php\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://laravel.com/forge/docs/servers/php#article\",\"headline\":\"PHP\",\"name\":\"PHP\",\"description\":\"Learn how to manage PHP versions on your Laravel Forge server.\",\"url\":\"https://laravel.com/forge/docs/servers/php\",\"mainEntityOfPage\":{\"@id\":\"https://laravel.com/forge/docs/servers/php#webpage\"},\"dateModified\":\"2026-10-21T14:18:15.409Z\",\"publisher\":{\"@id\":\"https://laravel.com/#organization\"},\"isPartOf\":{\"@id\":\"https://laravel.com/forge/docs#website\"}}]}\u003c/script>","siteName":"Laravel Forge","nav":{"global":{"anchors":[{"anchor":"Community","icon":"discord","href":"https://discord.gg/laravel"},{"anchor":"Blog","icon":"newspaper","href":"https://blog.laravel.com"},{"anchor":"Status","icon":"heart-pulse","href":"https://status.on-forge.com"}]},"tabs":[{"tab":"Documentation","groups":[{"group":"Get Started","pages":[{"title":"Welcome to Laravel Forge","sidebarTitle":"Introduction","href":"/introduction"},{"title":"Laravel Forge CLI","href":"/cli"},{"title":"Laravel Forge SDK","href":"/sdk"}]},{"group":"Basics","pages":[{"title":"Organizations","href":"/organizations"},{"title":"Teams","href":"/teams"},{"title":"Server Providers","href":"/server-providers"},{"title":"Storage Providers","href":"/storage-providers"},{"title":"Source Control","href":"/source-control"},{"title":"SSH Keys","href":"/ssh"},{"title":"Recipes","href":"/recipes"},{"title":"Notifications","href":"/notifications"},{"title":"API","href":"/api"}]},{"group":"Servers","pages":[{"title":"Creating and Managing Servers","sidebarTitle":"Managing Servers","href":"/servers/the-basics"},{"title":"Server Types","href":"/servers/types"},{"title":"Laravel VPS","description":"Learn about Laravel VPS and instant provisioning.","href":"/servers/laravel-vps"},{"title":"PHP","href":"/servers/php"},{"title":"Load Balancing","description":"Learn how to horizontally scale your application using load balancers.","href":"/servers/load-balancing"},{"title":"Nginx Templates","href":"/servers/nginx-templates"},{"title":"Root Access / Security","sidebarTitle":"Security","href":"/servers/security"},{"title":"Monitoring","href":"/servers/monitoring"},{"title":"Real-Time Metrics","href":"/servers/real-time-metrics"}]},{"group":"Sites","pages":[{"title":"Creating and Managing Sites","sidebarTitle":"Managing Sites","href":"/sites/the-basics"},{"title":"Domains","href":"/sites/domains"},{"title":"Deployments","href":"/sites/deployments"},{"title":"Repository Access","href":"/sites/repository-access"},{"title":"Environment Variables","href":"/sites/environment-variables"},{"title":"Commands","href":"/sites/commands"},{"title":"Queues","href":"/sites/queues"},{"title":"Network","href":"/sites/network"},{"title":"User Isolation","sidebarTitle":"Isolation","href":"/sites/user-isolation"},{"title":"Laravel","href":"/sites/laravel"},{"title":"Logs","href":"/sites/logs"}]},{"group":"Resources","pages":[{"title":"Databases","href":"/resources/databases"},{"title":"Database Backups","href":"/resources/database-backups"},{"title":"Managed Databases","href":"/resources/managed-databases"},{"title":"Managed Cache","href":"/resources/managed-cache"},{"title":"Object Storage","sidebarTitle":"Object Storage","href":"/resources/object-storage"},{"title":"Caches","href":"/resources/caches"},{"title":"Background Processes","href":"/resources/background-processes"},{"title":"Scheduler","href":"/resources/scheduler"},{"title":"Network","href":"/resources/network"},{"title":"Packages","href":"/resources/packages"}]},{"group":"Integrations","pages":[{"title":"Envoyer","href":"/integrations/envoyer"},{"title":"Sentry","href":"/integrations/sentry"},{"title":"Aikido","href":"/integrations/aikido"},{"title":"OpenClaw","sidebarTitle":"OpenClaw","href":"/integrations/openclaw"}]},{"group":"Other","pages":[{"title":"Support","mode":"wide","href":"/support"},{"title":"Changelog","href":"/changelog"},{"title":"Report Abuse","sidebarTitle":"Abuse","href":"/abuse"}]}]},{"tab":"Knowledge Base","pages":[{"title":"Knowledge Base","href":"/knowledge-base/servers"}]},{"tab":"API Reference","icon":"square-terminal","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]}]},"title":"PHP - Laravel Forge","buildId":"dpl_DGmhKsAzJdVqypJzon18vViniWRY","deploymentId":"dpl_DGmhKsAzJdVqypJzon18vViniWRY","dynamics":[],"chunks":[]}