# PHP Dev Server ## Setup true \ && SUDO= \ && PKGADD="$SUDO apt install -y --no-install-recommends" \ && PKGDEL="$SUDO apt purge -y" \ && ${PKGADD:?} apt-transport-https lsb-release ca-certificates curl \ && curl -sSL https://packages.sury.org/php/apt.gpg | $SUDO tee /etc/apt/trusted.gpg.d/php.gpg >/dev/null \ && echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | $SUDO tee /etc/apt/sources.list.d/php.list >/dev/null \ && $SUDO apt update \ && ${PKGADD:?} php7.3-cli php7.3-sqlite3 \ && $SUDO apt clean \ && true ## Run true `# Setup common vars (host/guest)` \ && GUESTWD=/home/user/serv \ && GUESTSUDO=sudo \ && CPY_INN="tmp" \ && CPY_OUT="tmp" \ && SSH="ssh user@localhost -p10022 -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no" \ && true true `# Setup mounts & persistence (host)` \ && tar c ${CPY_INN:?} | ${SSH:?} -- sh -c 'true && mkdir -p '"${GUESTWD:?}"' && cd '"${GUESTWD:?}"' && tar x' \ && $SSH -- sh -c "true && $GUESTSUDO mount -tcifs //10.0.2.2/beef-webapp /mnt/beef-webapp" \ && $SSH -- sh -c "true && mkdir ${GUESTWD:?}/src && $GUESTSUDO mount --bind /mnt/beef-webapp/src \"${GUESTWD:?}/src\"" \ && true true `# Run dev server (guest)` \ && cd "${GUESTWD:?}" \ && DEBUG=1 php -dassert.bail=1 -dzend.assertions=1 -dassert.exception=1 -S 0.0.0.0:8080 src/index.php \ && true true `# Copy persistence from vm back to host (host)` \ && $SSH -- sh -c "true && cd \"${GUESTWD:?}\" && tar c \"${CPY_OUT:?}\"" | tar x \ && true ## Links - [Install old php](https://tecadmin.net/how-to-install-php-on-debian-12/)