添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
强悍的斑马  ·  Building OpenSSL ...·  10 小时前    · 
爱喝酒的牛肉面  ·  getnameinfo(3) - ...·  10 小时前    · 
冷冷的棒棒糖  ·  Dell EMC OpenManage ...·  14 小时前    · 
奔跑的风衣  ·  如何在Ubuntu ...·  昨天    · 
英勇无比的萝卜  ·  cookieLifetime | ...·  2 月前    · 
爱健身的剪刀  ·  Search | Illinois ...·  8 月前    · 

Alpine Linux is a Linux distro that is lightweight and security-focused. The main aim of alpine is to be minimalistic be it in scope or space. Since it is small in size it is used in those containers which require less time for booting. Unlike other distros which use GNU, Glibc alpine used musl, busybox. PHP is a general-purpose, server-side scripting language that is used for making dynamic and interactive websites. It was created by a danish programmer in 1993. PHP is short for PHP: HYPERTEXT PREPROCESSOR. Some features of PHP are:

  • It is open-source and has a large number of users.
  • Used in creating dynamic web content.
  • Multi-server and Multi-platform compatible.
  • Supports a large number of databases.
  • Today we will be looking at the installation of PHP on alpine Linux.  A Linux environment will be used in this article (UBUNTU) and it will be used docker to create an alpine container. So make sure to know the basic docker commands.

    Installing PHP on Alpine Linux

    Step 1: Pull the alpine image from the docker hub.

    docker pull alpine

    Step 2: Now make a container from this image and enter it. The name of the container will be sample_cont for this article.

    docker run -t -d –name <container_name> alpine

    Now run commands inside this container using the “ exec” command. Keep in mind that alpine has a “sh” shell.

    docker exec -it sample_cont /bin/sh

    Installing PHP

    Make sure to upgrade and update the packages, using the apk command.

    apk update && apk upgrade

    Now write the command to install PHP.

    apk add php  ( you can specify the version also, by default it fetches the latest version)

    To verify the installation and check the version type the command below.

    php -v

    So this is how PHP can be installed on an alpine Linux system, hope this article was helpful.

    Like Article
    We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy Got It !
    Please go through our recently updated Improvement Guidelines before submitting any improvements.
    This article is being improved by another user right now. You can suggest the changes for now and it will be under the article's discussion tab.
    You will be notified via email once the article is available for improvement. Thank you for your valuable feedback!
    Please go through our recently updated Improvement Guidelines before submitting any improvements.
    Suggest Changes
    Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.