install_php


"/home/yossef/notes/git/scripts/install_php.md"

path: git/scripts/install_php.md

- **fileName**: install_php
- **Created on**: 2025-03-26 15:02:07

main script for install php on my device

#!/usr/bin/env bash

RED='\e[31m'
GREEN='\e[32m'
RESET='\e[0m'  # Reset color

:<< 'END'
cpkm => check package manger and install
END

_install(){
    ## check if php is install
    if _commend_exists php; then
        cecho "php found" green
    else
        # downlaod using chack package manger (cpkm)
        cpkm php
        if [[ $? == 0 ]]; then
            cecho  "sucessfuly install php" green
        else
            cecho "error happend in install php" red
            exit 1
        fi
    fi

    cecho "install some server for php" green
    # installing some dependences
    cpkm php-apache php-cgi php-fpm php-gd  \
        php-embed php-intl php-redis php-snmp
    if [[ $? == 0 ]]; then # check if there an error happend
        cecho "install servcie like apache adn redis and fpm successufly" green
    else
        cecho "error happend in install some server" red
        exit 1
    fi
    cecho "fisnish install php and service" green
}
_install

references