[{"data":1,"prerenderedAt":767},["ShallowReactive",2],{"navigation":3,"/docs/customizing-the-image/installing-additional-php-extensions":221,"/docs/customizing-the-image/installing-additional-php-extensions-surround":762},[4],{"title":5,"path":6,"stem":7,"children":8},"Docs","/docs","docs",[9,12,56,85,132,153,178,195,208],{"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],{"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,"icon":55,"defaultOpen":55,"path":180,"stem":181,"children":182,"page":55},"Customization","/docs/customizing-the-image","docs/6.customizing-the-image",[183,187,191],{"title":184,"path":185,"stem":186},"Changing php.ini settings","/docs/customizing-the-image/changing-common-php-settings","docs/6.customizing-the-image/1.changing-common-php-settings",{"title":188,"path":189,"stem":190},"Installing PHP extensions","/docs/customizing-the-image/installing-additional-php-extensions","docs/6.customizing-the-image/2.installing-additional-php-extensions",{"title":192,"path":193,"stem":194},"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":196,"path":197,"stem":198,"children":199,"page":55},"Troubleshooting","/docs/troubleshooting","docs/7.troubleshooting",[200,204],{"title":201,"path":202,"stem":203},"Common Issues","/docs/troubleshooting/common-issues","docs/7.troubleshooting/1.common-issues",{"title":205,"path":206,"stem":207},"Getting Help","/docs/troubleshooting/getting-help","docs/7.troubleshooting/2.getting-help",{"title":209,"path":210,"stem":211,"children":212,"page":55},"Reference","/docs/reference","docs/8.reference",[213,217],{"title":214,"path":215,"stem":216},"Environment Variable Specification","/docs/reference/environment-variable-specification","docs/8.reference/1.environment-variable-specification",{"title":218,"path":219,"stem":220},"Command Reference","/docs/reference/command-reference","docs/8.reference/2.command-reference",{"id":222,"title":188,"body":223,"description":755,"extension":266,"links":756,"meta":757,"navigation":365,"path":189,"redirect":756,"seo":760,"stem":190,"__hash__":761},"docs/docs/6.customizing-the-image/2.installing-additional-php-extensions.md",{"type":224,"value":225,"toc":745},"minimark",[226,245,250,253,270,274,283,288,292,303,306,310,315,332,421,425,436,634,637,647,670,674,677,681,685,688,731,741],[227,228,229],"lead-p",{},[230,231,232,233,244],"p",{},"serversideup/php includes the ",[234,235,240],"a",{"href":236,"rel":237,"target":239},"https://github.com/mlocati/docker-php-extension-installer",[238],"nofollow","_blank",[241,242,243],"code",{},"install-php-extensions"," tool by default. This tool allows you to install almost any PHP module that you'll need.",[246,247,249],"h2",{"id":248},"default-extensions","Default extensions",[230,251,252],{},"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.",[254,255],"u-button",{"ariaLabel":256,"className":257,"color":265,"label":256,"size":266,"to":267,"trailing-icon":268,"variant":269},"Learn more about default extensions",[258,259,260,261,262,263,264],"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",[246,271,273],{"id":272},"what-extensions-are-supported","What extensions are supported?",[230,275,276,277,282],{},"Since we're using ",[234,278,280],{"href":236,"rel":279,"target":239},[238],[241,281,243],{},", 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.",[254,284],{"ariaLabel":285,"className":286,"color":265,"label":285,"size":266,"to":287,"trailing-icon":268,"variant":269,"target":239},"View the supported extensions",[258,259,260,261,262,263,264],"https://github.com/mlocati/docker-php-extension-installer#supported-php-extensions",[246,289,291],{"id":290},"installing-extensions","Installing extensions",[230,293,294,295,298,299,302],{},"Once you have your extensions ready for installation, you need to use ",[241,296,297],{},"root"," permissions to install them. In most cases, the best experience is to use a ",[241,300,301],{},"Dockerfile"," to do this while you package your application in a container.",[230,304,305],{},"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.",[254,307],{"ariaLabel":308,"className":309,"color":265,"label":308,"size":266,"to":143,"trailing-icon":268,"variant":269},"Learn more about packaging your application for deployment",[258,259,260,261,262,263,264],[311,312,314],"h3",{"id":313},"preparing-your-dockerfile","Preparing your Dockerfile",[316,317,318],"warning",{},[230,319,320,324,325,327,328,331],{},[321,322,323],"strong",{},"Our images are unprivileged by default."," This means you'll need to switch to ",[241,326,297],{}," to do \"root things\", then switch back to the ",[241,329,330],{},"www-data"," user. This ensures your container image is hardened against security vulnerabilities.",[333,334,338],"pre",{"className":335,"code":336,"filename":301,"language":337,"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",[241,339,340,349,360,367,373,382,387,393,402,407,413],{"__ignoreMap":10},[341,342,345],"span",{"class":343,"line":344},"line",1,[341,346,348],{"class":347},"sAwPA","# Choose our base image\n",[341,350,352,356],{"class":343,"line":351},2,[341,353,355],{"class":354},"snl16","FROM",[341,357,359],{"class":358},"s95oV"," serversideup/php:8.5-fpm-nginx\n",[341,361,363],{"class":343,"line":362},3,[341,364,366],{"emptyLinePlaceholder":365},true,"\n",[341,368,370],{"class":343,"line":369},4,[341,371,372],{"class":347},"# Switch to root so we can do root things\n",[341,374,376,379],{"class":343,"line":375},5,[341,377,378],{"class":354},"USER",[341,380,381],{"class":358}," root\n",[341,383,385],{"class":343,"line":384},6,[341,386,366],{"emptyLinePlaceholder":365},[341,388,390],{"class":343,"line":389},7,[341,391,392],{"class":347},"# Install the intl and bcmath extensions with root permissions\n",[341,394,396,399],{"class":343,"line":395},8,[341,397,398],{"class":354},"RUN",[341,400,401],{"class":358}," install-php-extensions intl bcmath\n",[341,403,405],{"class":343,"line":404},9,[341,406,366],{"emptyLinePlaceholder":365},[341,408,410],{"class":343,"line":409},10,[341,411,412],{"class":347},"# Drop back to our unprivileged user\n",[341,414,416,418],{"class":343,"line":415},11,[341,417,378],{"class":354},[341,419,420],{"class":358}," www-data\n",[246,422,424],{"id":423},"building-images-with-docker-compose","Building images with Docker Compose",[230,426,427,428,431,432,435],{},"Here's a simple example with Docker Compose that builds an image with the ",[241,429,430],{},"intl"," and ",[241,433,434],{},"bcmath"," extensions.",[437,438,439,495,600],"code-tree",{"default-value":301},[333,440,441],{"className":335,"code":336,"filename":301,"language":337,"meta":10,"style":10},[241,442,443,447,453,457,461,467,471,475,481,485,489],{"__ignoreMap":10},[341,444,445],{"class":343,"line":344},[341,446,348],{"class":347},[341,448,449,451],{"class":343,"line":351},[341,450,355],{"class":354},[341,452,359],{"class":358},[341,454,455],{"class":343,"line":362},[341,456,366],{"emptyLinePlaceholder":365},[341,458,459],{"class":343,"line":369},[341,460,372],{"class":347},[341,462,463,465],{"class":343,"line":375},[341,464,378],{"class":354},[341,466,381],{"class":358},[341,468,469],{"class":343,"line":384},[341,470,366],{"emptyLinePlaceholder":365},[341,472,473],{"class":343,"line":389},[341,474,392],{"class":347},[341,476,477,479],{"class":343,"line":395},[341,478,398],{"class":354},[341,480,401],{"class":358},[341,482,483],{"class":343,"line":404},[341,484,366],{"emptyLinePlaceholder":365},[341,486,487],{"class":343,"line":409},[341,488,412],{"class":347},[341,490,491,493],{"class":343,"line":415},[341,492,378],{"class":354},[341,494,420],{"class":358},[333,496,501],{"className":497,"code":498,"filename":499,"language":500,"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",[241,502,503,512,519,524,531,536,548,559,564,571,579,584,592],{"__ignoreMap":10},[341,504,505,509],{"class":343,"line":344},[341,506,508],{"class":507},"s4JwU","services",[341,510,511],{"class":358},":\n",[341,513,514,517],{"class":343,"line":351},[341,515,516],{"class":507},"  php",[341,518,511],{"class":358},[341,520,521],{"class":343,"line":362},[341,522,523],{"class":347},"    # Use \"build\" instead of \"image\"\n",[341,525,526,529],{"class":343,"line":369},[341,527,528],{"class":507},"    build",[341,530,511],{"class":358},[341,532,533],{"class":343,"line":375},[341,534,535],{"class":347},"      # Use the Dockerfile in the current directory\n",[341,537,538,541,544],{"class":343,"line":384},[341,539,540],{"class":507},"      context",[341,542,543],{"class":358},": ",[341,545,547],{"class":546},"sDLfK",".\n",[341,549,550,553,555],{"class":343,"line":389},[341,551,552],{"class":507},"      dockerfile",[341,554,543],{"class":358},[341,556,558],{"class":557},"sU2Wk","Dockerfile\n",[341,560,561],{"class":343,"line":395},[341,562,563],{"class":347},"    # Expose localhost:80 to NGINX's port 8080\n",[341,565,566,569],{"class":343,"line":404},[341,567,568],{"class":507},"    ports",[341,570,511],{"class":358},[341,572,573,576],{"class":343,"line":409},[341,574,575],{"class":358},"      - ",[341,577,578],{"class":557},"80:8080\n",[341,580,581],{"class":343,"line":415},[341,582,583],{"class":347},"    # Mount current directory to /var/www/html\n",[341,585,587,590],{"class":343,"line":586},12,[341,588,589],{"class":507},"    volumes",[341,591,511],{"class":358},[341,593,595,597],{"class":343,"line":594},13,[341,596,575],{"class":358},[341,598,599],{"class":557},"./:/var/www/html\n",[333,601,606],{"className":602,"code":603,"filename":604,"language":605,"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",[241,607,608,616,621,629],{"__ignoreMap":10},[341,609,610,613],{"class":343,"line":344},[341,611,612],{"class":354},"\u003C?",[341,614,615],{"class":546},"php\n",[341,617,618],{"class":343,"line":351},[341,619,620],{"class":347},"// Let's just print out some PHP info\n",[341,622,623,626],{"class":343,"line":362},[341,624,625],{"class":546},"phpinfo",[341,627,628],{"class":358},"();\n",[341,630,631],{"class":343,"line":369},[341,632,633],{"class":354},"?>\n",[230,635,636],{},"Once we have our project ready, we can bring our container up with:",[638,639,640],"tip",{},[230,641,642,643,646],{},"We use the ",[241,644,645],{},"--build"," flag to tell Docker to rebuild the image from scratch. Good practice in development if you're making changes to your Dockerfile.",[333,648,653],{"className":649,"code":650,"filename":651,"language":652,"meta":10,"style":10},"language-bash shiki shiki-themes github-dark","docker compose up --build\n","Terminal","bash",[241,654,655],{"__ignoreMap":10},[341,656,657,661,664,667],{"class":343,"line":344},[341,658,660],{"class":659},"svObZ","docker",[341,662,663],{"class":557}," compose",[341,665,666],{"class":557}," up",[341,668,669],{"class":546}," --build\n",[246,671,673],{"id":672},"real-life-example-showing-development-to-production","Real-life example showing development to production",[230,675,676],{},"If you're looking for a more realistic example how this looks from development to production, check out our guide below.",[254,678],{"ariaLabel":679,"className":680,"color":265,"label":679,"size":266,"to":139,"trailing-icon":268,"variant":269},"Learn more about development to production",[258,259,260,261,262,263,264],[246,682,684],{"id":683},"common-php-extensions-that-you-might-need","Common PHP extensions that you might need",[230,686,687],{},"We compiled a list of extensions for you to reference.",[689,690,691,707],"table",{},[692,693,694],"thead",{},[695,696,697,701,704],"tr",{},[698,699,700],"th",{},"Extension",[698,702,703],{},"Description",[698,705,706],{},"Why it's not included by default",[708,709,710],"tbody",{},[695,711,712,719,728],{},[713,714,715],"td",{},[234,716,430],{"href":717,"rel":718,"target":239},"https://www.php.net/manual/en/intro.intl.php",[238],[713,720,721,722,727],{},"Internationalization functions, ",[234,723,726],{"href":724,"rel":725,"target":239},"https://laravel.com/docs/10.x/validation#rule-email",[238],"used by Laravel for validating emails"," with \"DNS\" or \"spoof\" validation.",[713,729,730],{},"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.",[638,732,734],{"target":239,"to":733},"https://github.com/serversideup/docker-php/discussions/new?category=q-a",[230,735,736,737],{},"Don't see the extension you need? Having trouble? ",[234,738,740],{"href":733,"rel":739},[238],"Open a discussion on GitHub →",[742,743,744],"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":351,"depth":351,"links":746},[747,748,749,752,753,754],{"id":248,"depth":351,"text":249},{"id":272,"depth":351,"text":273},{"id":290,"depth":351,"text":291,"children":750},[751],{"id":313,"depth":362,"text":314},{"id":423,"depth":351,"text":424},{"id":672,"depth":351,"text":673},{"id":683,"depth":351,"text":684},"Learn how to add any PHP extension that you need for your application.",null,{"head":758,"layout":7},{"title":759},"Installing additional PHP extensions - Docker PHP - Server Side Up",{"title":188,"description":755},"9s_F5-ZiDmgquKidZOS7Mn7gUy42LIgiq2FPb0jotu8",[763,765],{"title":184,"path":185,"stem":186,"description":764,"children":-1},"Learn how to change common PHP settings with environment variables or your own php.ini file.",{"title":192,"path":193,"stem":194,"description":766,"children":-1},"Learn how to use our entrypoint.d directory to customize your container start up experience.",1776367057875]