[{"data":1,"prerenderedAt":775},["ShallowReactive",2],{"navigation":3,"/docs/customizing-the-image/installing-additional-php-extensions":229,"/docs/customizing-the-image/installing-additional-php-extensions-surround":770},[4],{"title":5,"path":6,"stem":7,"children":8},"Docs","/docs","docs",[9,12,56,85,132,153,186,203,216],{"title":10,"path":6,"stem":11},"","docs/index",{"title":13,"path":14,"stem":15,"children":16,"icon":55},"Getting Started","/docs/getting-started","docs/1.getting-started/1.index",[17,19,23,27,31,35,39,43,47,51],{"title":18,"path":14,"stem":15},"Introduction",{"title":20,"path":21,"stem":22},"Container Basics","/docs/getting-started/container-basics","docs/1.getting-started/2.container-basics",{"title":24,"path":25,"stem":26},"Installation","/docs/getting-started/installation","docs/1.getting-started/3.installation",{"title":28,"path":29,"stem":30},"These Images vs Others","/docs/getting-started/these-images-vs-others","docs/1.getting-started/4.these-images-vs-others",{"title":32,"path":33,"stem":34},"Choosing an Image","/docs/getting-started/choosing-an-image","docs/1.getting-started/5.choosing-an-image",{"title":36,"path":37,"stem":38},"Default Configurations","/docs/getting-started/default-configurations","docs/1.getting-started/6.default-configurations",{"title":40,"path":41,"stem":42},"Upgrade Guide","/docs/getting-started/upgrade-guide","docs/1.getting-started/7.upgrade-guide",{"title":44,"path":45,"stem":46},"Changelog","/docs/getting-started/changelog","docs/1.getting-started/8.changelog",{"title":48,"path":49,"stem":50},"About","/docs/getting-started/about","docs/1.getting-started/9.about",{"title":52,"path":53,"stem":54},"Contributing","/docs/getting-started/contributing","docs/1.getting-started/99.contributing",false,{"title":57,"path":58,"stem":59,"children":60,"page":55},"Image Variations","/docs/image-variations","docs/2.image-variations",[61,65,69,73,77,81],{"title":62,"path":63,"stem":64},"CLI","/docs/image-variations/cli","docs/2.image-variations/cli",{"title":66,"path":67,"stem":68},"FPM","/docs/image-variations/fpm","docs/2.image-variations/fpm",{"title":70,"path":71,"stem":72},"FPM-Apache","/docs/image-variations/fpm-apache","docs/2.image-variations/fpm-apache",{"title":74,"path":75,"stem":76},"FPM-NGINX","/docs/image-variations/fpm-nginx","docs/2.image-variations/fpm-nginx",{"title":78,"path":79,"stem":80},"FrankenPHP","/docs/image-variations/frankenphp","docs/2.image-variations/frankenphp",{"title":82,"path":83,"stem":84},"Unit (Deprecated)","/docs/image-variations/unit","docs/2.image-variations/unit",{"title":86,"path":87,"stem":88,"children":89,"page":55},"Framework Guides","/docs/framework-guides","docs/3.framework-guides",[90,123],{"title":91,"icon":55,"defaultOpen":55,"path":92,"stem":93,"children":94,"page":55},"Laravel","/docs/framework-guides/laravel","docs/3.framework-guides/1.laravel",[95,99,103,107,111,115,119],{"title":96,"path":97,"stem":98},"Automations","/docs/framework-guides/laravel/automations","docs/3.framework-guides/1.laravel/1.automations",{"title":100,"path":101,"stem":102},"Task Scheduler","/docs/framework-guides/laravel/task-scheduler","docs/3.framework-guides/1.laravel/2.task-scheduler",{"title":104,"path":105,"stem":106},"Queue","/docs/framework-guides/laravel/queue","docs/3.framework-guides/1.laravel/3.queue",{"title":108,"path":109,"stem":110},"Horizon","/docs/framework-guides/laravel/horizon","docs/3.framework-guides/1.laravel/4.horizon",{"title":112,"path":113,"stem":114},"Reverb","/docs/framework-guides/laravel/reverb","docs/3.framework-guides/1.laravel/4.reverb",{"title":116,"path":117,"stem":118},"Nightwatch","/docs/framework-guides/laravel/nightwatch","docs/3.framework-guides/1.laravel/5.nightwatch",{"title":120,"path":121,"stem":122},"Octane","/docs/framework-guides/laravel/octane","docs/3.framework-guides/1.laravel/octane",{"title":124,"icon":55,"defaultOpen":55,"path":125,"stem":126,"children":127,"page":55},"WordPress","/docs/framework-guides/wordpress","docs/3.framework-guides/2.wordpress",[128],{"title":129,"path":130,"stem":131},"Using Docker with WordPress","/docs/framework-guides/wordpress/using-wordpress-with-docker","docs/3.framework-guides/2.wordpress/4.using-wordpress-with-docker",{"title":133,"path":134,"stem":135,"children":136,"page":55},"Deployment And Production","/docs/deployment-and-production","docs/4.deployment-and-production",[137,141,145,149],{"title":138,"path":139,"stem":140},"Development to Production","/docs/deployment-and-production/development-to-production","docs/4.deployment-and-production/2.development-to-production",{"title":142,"path":143,"stem":144},"Packaging Your App for Deployment","/docs/deployment-and-production/packaging-your-app-for-deployment","docs/4.deployment-and-production/3.packaging-your-app-for-deployment",{"title":146,"path":147,"stem":148},"Configuring SSL","/docs/deployment-and-production/configuring-ssl","docs/4.deployment-and-production/4.configuring-ssl",{"title":150,"path":151,"stem":152},"Choosing a Host","/docs/deployment-and-production/choosing-a-host","docs/4.deployment-and-production/5.choosing-a-host",{"title":154,"icon":55,"defaultOpen":55,"path":155,"stem":156,"children":157,"page":55},"Advanced Guides","/docs/guide","docs/5.guide",[158,162,166,170,174,178,182],{"title":159,"path":160,"stem":161},"Migrating from official PHP images","/docs/guide/migrating-from-official-php-images","docs/5.guide/1.migrating-from-official-php-images",{"title":163,"path":164,"stem":165},"Using Healthchecks With Laravel","/docs/guide/using-healthchecks-with-laravel","docs/5.guide/2.using-healthchecks-with-laravel",{"title":167,"path":168,"stem":169},"Using S6 Overlay","/docs/guide/using-s6-overlay","docs/5.guide/2.using-s6-overlay",{"title":171,"path":172,"stem":173},"Understanding File Permissions","/docs/guide/understanding-file-permissions","docs/5.guide/3.understanding-file-permissions",{"title":175,"path":176,"stem":177},"Configuring Trusted Proxies","/docs/guide/configuring-trusted-proxies","docs/5.guide/4.configuring-trusted-proxies",{"title":179,"path":180,"stem":181},"Major version migrations","/docs/guide/major-version-migrations","docs/5.guide/5.major-version-migrations",{"title":183,"path":184,"stem":185},"Production performance tuning","/docs/guide/production-performance-tuning","docs/5.guide/6.production-performance-tuning",{"title":187,"icon":55,"defaultOpen":55,"path":188,"stem":189,"children":190,"page":55},"Customization","/docs/customizing-the-image","docs/6.customizing-the-image",[191,195,199],{"title":192,"path":193,"stem":194},"Changing php.ini settings","/docs/customizing-the-image/changing-common-php-settings","docs/6.customizing-the-image/1.changing-common-php-settings",{"title":196,"path":197,"stem":198},"Installing PHP extensions","/docs/customizing-the-image/installing-additional-php-extensions","docs/6.customizing-the-image/2.installing-additional-php-extensions",{"title":200,"path":201,"stem":202},"Adding Start Up Scripts","/docs/customizing-the-image/adding-your-own-start-up-scripts","docs/6.customizing-the-image/3.adding-your-own-start-up-scripts",{"title":204,"path":205,"stem":206,"children":207,"page":55},"Troubleshooting","/docs/troubleshooting","docs/7.troubleshooting",[208,212],{"title":209,"path":210,"stem":211},"Common Issues","/docs/troubleshooting/common-issues","docs/7.troubleshooting/1.common-issues",{"title":213,"path":214,"stem":215},"Getting Help","/docs/troubleshooting/getting-help","docs/7.troubleshooting/2.getting-help",{"title":217,"path":218,"stem":219,"children":220,"page":55},"Reference","/docs/reference","docs/8.reference",[221,225],{"title":222,"path":223,"stem":224},"Environment Variable Specification","/docs/reference/environment-variable-specification","docs/8.reference/1.environment-variable-specification",{"title":226,"path":227,"stem":228},"Command Reference","/docs/reference/command-reference","docs/8.reference/2.command-reference",{"id":230,"title":196,"body":231,"description":763,"extension":274,"links":764,"meta":765,"navigation":373,"path":197,"redirect":764,"seo":768,"stem":198,"__hash__":769},"docs/docs/6.customizing-the-image/2.installing-additional-php-extensions.md",{"type":232,"value":233,"toc":753},"minimark",[234,253,258,261,278,282,291,296,300,311,314,318,323,340,429,433,444,642,645,655,678,682,685,689,693,696,739,749],[235,236,237],"lead-p",{},[238,239,240,241,252],"p",{},"serversideup/php includes the ",[242,243,248],"a",{"href":244,"rel":245,"target":247},"https://github.com/mlocati/docker-php-extension-installer",[246],"nofollow","_blank",[249,250,251],"code",{},"install-php-extensions"," tool by default. This tool allows you to install almost any PHP module that you'll need.",[254,255,257],"h2",{"id":256},"default-extensions","Default extensions",[238,259,260],{},"By default, we include a number of PHP extensions to get you up and running. You can learn more why we have certain defaults and what's all included on our default configurations page.",[262,263],"u-button",{"ariaLabel":264,"className":265,"color":273,"label":264,"size":274,"to":275,"trailing-icon":276,"variant":277},"Learn more about default extensions",[266,267,268,269,270,271,272],"font-bold","ring","ring-inset","ring-blue-600","text-blue-600","hover:ring-blue-500","hover:text-blue-500","primary","md","/docs/getting-started/default-configurations#default-php-extensions","i-lucide-arrow-right","outline",[254,279,281],{"id":280},"what-extensions-are-supported","What extensions are supported?",[238,283,284,285,290],{},"Since we're using ",[242,286,288],{"href":244,"rel":287,"target":247},[246],[249,289,251],{},", we have a wide support of extensions across many versions of PHP. You can find the full list of supported extensions on the project's README.",[262,292],{"ariaLabel":293,"className":294,"color":273,"label":293,"size":274,"to":295,"trailing-icon":276,"variant":277,"target":247},"View the supported extensions",[266,267,268,269,270,271,272],"https://github.com/mlocati/docker-php-extension-installer#supported-php-extensions",[254,297,299],{"id":298},"installing-extensions","Installing extensions",[238,301,302,303,306,307,310],{},"Once you have your extensions ready for installation, you need to use ",[249,304,305],{},"root"," permissions to install them. In most cases, the best experience is to use a ",[249,308,309],{},"Dockerfile"," to do this while you package your application in a container.",[238,312,313],{},"If you're not familiar with the concept of packaging your application for deployment, we recommend you to read our guide on how to do it.",[262,315],{"ariaLabel":316,"className":317,"color":273,"label":316,"size":274,"to":143,"trailing-icon":276,"variant":277},"Learn more about packaging your application for deployment",[266,267,268,269,270,271,272],[319,320,322],"h3",{"id":321},"preparing-your-dockerfile","Preparing your Dockerfile",[324,325,326],"warning",{},[238,327,328,332,333,335,336,339],{},[329,330,331],"strong",{},"Our images are unprivileged by default."," This means you'll need to switch to ",[249,334,305],{}," to do \"root things\", then switch back to the ",[249,337,338],{},"www-data"," user. This ensures your container image is hardened against security vulnerabilities.",[341,342,346],"pre",{"className":343,"code":344,"filename":309,"language":345,"meta":10,"style":10},"language-dockerfile shiki shiki-themes github-dark","# Choose our base image\nFROM serversideup/php:8.5-fpm-nginx\n\n# Switch to root so we can do root things\nUSER root\n\n# Install the intl and bcmath extensions with root permissions\nRUN install-php-extensions intl bcmath\n\n# Drop back to our unprivileged user\nUSER www-data\n","dockerfile",[249,347,348,357,368,375,381,390,395,401,410,415,421],{"__ignoreMap":10},[349,350,353],"span",{"class":351,"line":352},"line",1,[349,354,356],{"class":355},"sAwPA","# Choose our base image\n",[349,358,360,364],{"class":351,"line":359},2,[349,361,363],{"class":362},"snl16","FROM",[349,365,367],{"class":366},"s95oV"," serversideup/php:8.5-fpm-nginx\n",[349,369,371],{"class":351,"line":370},3,[349,372,374],{"emptyLinePlaceholder":373},true,"\n",[349,376,378],{"class":351,"line":377},4,[349,379,380],{"class":355},"# Switch to root so we can do root things\n",[349,382,384,387],{"class":351,"line":383},5,[349,385,386],{"class":362},"USER",[349,388,389],{"class":366}," root\n",[349,391,393],{"class":351,"line":392},6,[349,394,374],{"emptyLinePlaceholder":373},[349,396,398],{"class":351,"line":397},7,[349,399,400],{"class":355},"# Install the intl and bcmath extensions with root permissions\n",[349,402,404,407],{"class":351,"line":403},8,[349,405,406],{"class":362},"RUN",[349,408,409],{"class":366}," install-php-extensions intl bcmath\n",[349,411,413],{"class":351,"line":412},9,[349,414,374],{"emptyLinePlaceholder":373},[349,416,418],{"class":351,"line":417},10,[349,419,420],{"class":355},"# Drop back to our unprivileged user\n",[349,422,424,426],{"class":351,"line":423},11,[349,425,386],{"class":362},[349,427,428],{"class":366}," www-data\n",[254,430,432],{"id":431},"building-images-with-docker-compose","Building images with Docker Compose",[238,434,435,436,439,440,443],{},"Here's a simple example with Docker Compose that builds an image with the ",[249,437,438],{},"intl"," and ",[249,441,442],{},"bcmath"," extensions.",[445,446,447,503,608],"code-tree",{"default-value":309},[341,448,449],{"className":343,"code":344,"filename":309,"language":345,"meta":10,"style":10},[249,450,451,455,461,465,469,475,479,483,489,493,497],{"__ignoreMap":10},[349,452,453],{"class":351,"line":352},[349,454,356],{"class":355},[349,456,457,459],{"class":351,"line":359},[349,458,363],{"class":362},[349,460,367],{"class":366},[349,462,463],{"class":351,"line":370},[349,464,374],{"emptyLinePlaceholder":373},[349,466,467],{"class":351,"line":377},[349,468,380],{"class":355},[349,470,471,473],{"class":351,"line":383},[349,472,386],{"class":362},[349,474,389],{"class":366},[349,476,477],{"class":351,"line":392},[349,478,374],{"emptyLinePlaceholder":373},[349,480,481],{"class":351,"line":397},[349,482,400],{"class":355},[349,484,485,487],{"class":351,"line":403},[349,486,406],{"class":362},[349,488,409],{"class":366},[349,490,491],{"class":351,"line":412},[349,492,374],{"emptyLinePlaceholder":373},[349,494,495],{"class":351,"line":417},[349,496,420],{"class":355},[349,498,499,501],{"class":351,"line":423},[349,500,386],{"class":362},[349,502,428],{"class":366},[341,504,509],{"className":505,"code":506,"filename":507,"language":508,"meta":10,"style":10},"language-yml shiki shiki-themes github-dark","services:\n  php:\n    # Use \"build\" instead of \"image\"\n    build:\n      # Use the Dockerfile in the current directory\n      context: .\n      dockerfile: Dockerfile\n    # Expose localhost:80 to NGINX's port 8080\n    ports:\n      - 80:8080\n    # Mount current directory to /var/www/html\n    volumes:\n      - ./:/var/www/html\n","compose.yml","yml",[249,510,511,520,527,532,539,544,556,567,572,579,587,592,600],{"__ignoreMap":10},[349,512,513,517],{"class":351,"line":352},[349,514,516],{"class":515},"s4JwU","services",[349,518,519],{"class":366},":\n",[349,521,522,525],{"class":351,"line":359},[349,523,524],{"class":515},"  php",[349,526,519],{"class":366},[349,528,529],{"class":351,"line":370},[349,530,531],{"class":355},"    # Use \"build\" instead of \"image\"\n",[349,533,534,537],{"class":351,"line":377},[349,535,536],{"class":515},"    build",[349,538,519],{"class":366},[349,540,541],{"class":351,"line":383},[349,542,543],{"class":355},"      # Use the Dockerfile in the current directory\n",[349,545,546,549,552],{"class":351,"line":392},[349,547,548],{"class":515},"      context",[349,550,551],{"class":366},": ",[349,553,555],{"class":554},"sDLfK",".\n",[349,557,558,561,563],{"class":351,"line":397},[349,559,560],{"class":515},"      dockerfile",[349,562,551],{"class":366},[349,564,566],{"class":565},"sU2Wk","Dockerfile\n",[349,568,569],{"class":351,"line":403},[349,570,571],{"class":355},"    # Expose localhost:80 to NGINX's port 8080\n",[349,573,574,577],{"class":351,"line":412},[349,575,576],{"class":515},"    ports",[349,578,519],{"class":366},[349,580,581,584],{"class":351,"line":417},[349,582,583],{"class":366},"      - ",[349,585,586],{"class":565},"80:8080\n",[349,588,589],{"class":351,"line":423},[349,590,591],{"class":355},"    # Mount current directory to /var/www/html\n",[349,593,595,598],{"class":351,"line":594},12,[349,596,597],{"class":515},"    volumes",[349,599,519],{"class":366},[349,601,603,605],{"class":351,"line":602},13,[349,604,583],{"class":366},[349,606,607],{"class":565},"./:/var/www/html\n",[341,609,614],{"className":610,"code":611,"filename":612,"language":613,"meta":10,"style":10},"language-php shiki shiki-themes github-dark","\u003C?php\n// Let's just print out some PHP info\nphpinfo();\n?>\n","public/index.php","php",[249,615,616,624,629,637],{"__ignoreMap":10},[349,617,618,621],{"class":351,"line":352},[349,619,620],{"class":362},"\u003C?",[349,622,623],{"class":554},"php\n",[349,625,626],{"class":351,"line":359},[349,627,628],{"class":355},"// Let's just print out some PHP info\n",[349,630,631,634],{"class":351,"line":370},[349,632,633],{"class":554},"phpinfo",[349,635,636],{"class":366},"();\n",[349,638,639],{"class":351,"line":377},[349,640,641],{"class":362},"?>\n",[238,643,644],{},"Once we have our project ready, we can bring our container up with:",[646,647,648],"tip",{},[238,649,650,651,654],{},"We use the ",[249,652,653],{},"--build"," flag to tell Docker to rebuild the image from scratch. Good practice in development if you're making changes to your Dockerfile.",[341,656,661],{"className":657,"code":658,"filename":659,"language":660,"meta":10,"style":10},"language-bash shiki shiki-themes github-dark","docker compose up --build\n","Terminal","bash",[249,662,663],{"__ignoreMap":10},[349,664,665,669,672,675],{"class":351,"line":352},[349,666,668],{"class":667},"svObZ","docker",[349,670,671],{"class":565}," compose",[349,673,674],{"class":565}," up",[349,676,677],{"class":554}," --build\n",[254,679,681],{"id":680},"real-life-example-showing-development-to-production","Real-life example showing development to production",[238,683,684],{},"If you're looking for a more realistic example how this looks from development to production, check out our guide below.",[262,686],{"ariaLabel":687,"className":688,"color":273,"label":687,"size":274,"to":139,"trailing-icon":276,"variant":277},"Learn more about development to production",[266,267,268,269,270,271,272],[254,690,692],{"id":691},"common-php-extensions-that-you-might-need","Common PHP extensions that you might need",[238,694,695],{},"We compiled a list of extensions for you to reference.",[697,698,699,715],"table",{},[700,701,702],"thead",{},[703,704,705,709,712],"tr",{},[706,707,708],"th",{},"Extension",[706,710,711],{},"Description",[706,713,714],{},"Why it's not included by default",[716,717,718],"tbody",{},[703,719,720,727,736],{},[721,722,723],"td",{},[242,724,438],{"href":725,"rel":726,"target":247},"https://www.php.net/manual/en/intro.intl.php",[246],[721,728,729,730,735],{},"Internationalization functions, ",[242,731,734],{"href":732,"rel":733,"target":247},"https://laravel.com/docs/10.x/validation#rule-email",[246],"used by Laravel for validating emails"," with \"DNS\" or \"spoof\" validation.",[721,737,738],{},"Our tests showed this module will add about 40 MB of space to the Docker image, so we decided to not include it by default.",[646,740,742],{"target":247,"to":741},"https://github.com/serversideup/docker-php/discussions/new?category=q-a",[238,743,744,745],{},"Don't see the extension you need? Having trouble? ",[242,746,748],{"href":741,"rel":747},[246],"Open a discussion on GitHub →",[750,751,752],"style",{},"html pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .s4JwU, html code.shiki .s4JwU{--shiki-default:#85E89D}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}",{"title":10,"searchDepth":359,"depth":359,"links":754},[755,756,757,760,761,762],{"id":256,"depth":359,"text":257},{"id":280,"depth":359,"text":281},{"id":298,"depth":359,"text":299,"children":758},[759],{"id":321,"depth":370,"text":322},{"id":431,"depth":359,"text":432},{"id":680,"depth":359,"text":681},{"id":691,"depth":359,"text":692},"Learn how to add any PHP extension that you need for your application.",null,{"head":766,"layout":7},{"title":767},"Installing additional PHP extensions - Docker PHP - Server Side Up",{"title":196,"description":763},"9s_F5-ZiDmgquKidZOS7Mn7gUy42LIgiq2FPb0jotu8",[771,773],{"title":192,"path":193,"stem":194,"description":772,"children":-1},"Learn how to change common PHP settings with environment variables or your own php.ini file.",{"title":200,"path":201,"stem":202,"description":774,"children":-1},"Learn how to use our entrypoint.d directory to customize your container start up experience.",1789148867514]