Skip to content

Instantly share code, notes, and snippets.

@rajibbinalam
Last active October 10, 2024 07:54
Show Gist options
  • Select an option

  • Save rajibbinalam/c260c4e3f73b8232b459c71441c9fe79 to your computer and use it in GitHub Desktop.

Select an option

Save rajibbinalam/c260c4e3f73b8232b459c71441c9fe79 to your computer and use it in GitHub Desktop.

Revisions

  1. rajibbinalam revised this gist Mar 20, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install apache php mysql phpmyadmin.md
    Original file line number Diff line number Diff line change
    @@ -35,7 +35,7 @@ update-alternatives --config php
    # OR
    sudo update-alternatives --set php /usr/bin/php8.1
    ```
    ## INSTALL MARIADB
    ## INSTALL MARIADB -> ( Install MARIADB Or MYSQL. not both)

    ```sh
    sudo apt update
  2. rajibbinalam revised this gist Mar 20, 2024. 1 changed file with 33 additions and 13 deletions.
    46 changes: 33 additions & 13 deletions install apache php mysql phpmyadmin.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    ### Note: ## mean -> Section; # mean -> optional / Comment for a condition
    ##### Note: # mean -> optional / Comment for a condition
    ## INSTALL APACHE

    ```sh
    @@ -11,31 +11,51 @@ sudo ufw allow in "Apache"


    ## INSTALL PHP

    #### Install Default PHP. This command will install default with php plugins. after this no need to use other commands
    ```sh
    sudo apt-get update
    sudo apt install php libapache2-mod-php php-mysql //Install Default PHP
    sudo apt -y install software-properties-common
    sudo apt install php libapache2-mod-php php-mysql
    ```
    #### Install PHP 7.3
    ```sh
    # sudo apt -y install software-properties-common
    sudo add-apt-repository ppa:ondrej/php
    sudo apt-get update
    sudo apt -y install php7.4
    sudo apt-get install -y php7.4-cli php7.4-json php7.4-common php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath
    ```

    #### Install PHP 8.2
    ```sh
    sudo add-apt-repository ppa:ondrej/php
    sudo apt update
    sudo apt-get install -y php8.2-cli php8.2-common php8.2-fpm php8.2-mysql php8.2-zip php8.2-gd php8.2-mbstring php8.2-curl php8.2-xml php8.2-bcmath
    ```
    #### Switch PHP Versions ->
    ```sh
    update-alternatives --config php
    # OR
    sudo update-alternatives --set php /usr/bin/php8.1
    ```
    ## INSTALL MARIADB

    ```sh
    sudo apt update
    sudo apt install mariadb-server
    sudo systemctl start mariadb.service
    sudo mysql_secure_installation
    # sudo mysql_secure_installation
    ```
    ## INSTALL MYSQL
    ```sh
    sudo apt install mysql-server
    sudo systemctl start mysql.service
    ```

    ### CREATE OR SET PASSWORD
    ```sh
    sudo mysql
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
    GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
    # OR
    mysql -u root -p

    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '12345'; # 12345 is password
    GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY '12345' WITH GRANT OPTION;
    ```

    ## INSTALL PHPMYADMIN
    @@ -53,10 +73,10 @@ sudo systemctl reload apache2.service
    ## INSTALL COMPOSER GLOBALLY

    ```sh
    #download
    # download
    curl -sS https://getcomposer.org/installer | php
    #composer.phar move to bin composer
    # composer.phar move to bin composer
    sudo mv composer.phar /usr/local/bin/composer
    #Permission bin/composer for Sudo
    # Permission bin/composer for Sudo
    sudo chmod +x /usr/local/bin/composer
    ```
  3. rajibbinalam revised this gist Mar 18, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions install apache php mysql phpmyadmin.md
    Original file line number Diff line number Diff line change
    @@ -4,9 +4,9 @@
    ```sh
    sudo apt update
    sudo apt install apache2
    sudo ufw app list
    # sudo ufw app list
    sudo ufw allow in "Apache"
    sudo ufw status
    # sudo ufw status
    ```


  4. rajibbinalam revised this gist Mar 18, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install apache php mysql phpmyadmin.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@

    ### Note: ## mean -> Section; # mean -> optional / Comment for a condition
    ## INSTALL APACHE

    ```sh
  5. rajibbinalam revised this gist Dec 19, 2023. 1 changed file with 11 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions install apache php mysql phpmyadmin.md
    Original file line number Diff line number Diff line change
    @@ -48,4 +48,15 @@ sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl
    sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
    sudo a2enconf phpmyadmin.conf
    sudo systemctl reload apache2.service
    ```

    ## INSTALL COMPOSER GLOBALLY

    ```sh
    #download
    curl -sS https://getcomposer.org/installer | php
    #composer.phar move to bin composer
    sudo mv composer.phar /usr/local/bin/composer
    #Permission bin/composer for Sudo
    sudo chmod +x /usr/local/bin/composer
    ```
  6. rajibbinalam created this gist Nov 26, 2023.
    51 changes: 51 additions & 0 deletions install apache php mysql phpmyadmin.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,51 @@

    ## INSTALL APACHE

    ```sh
    sudo apt update
    sudo apt install apache2
    sudo ufw app list
    sudo ufw allow in "Apache"
    sudo ufw status
    ```


    ## INSTALL PHP

    ```sh
    sudo apt-get update
    sudo apt install php libapache2-mod-php php-mysql //Install Default PHP
    sudo apt -y install software-properties-common
    sudo add-apt-repository ppa:ondrej/php
    sudo apt-get update
    sudo apt -y install php7.4
    sudo apt-get install -y php7.4-cli php7.4-json php7.4-common php7.4-mysql php7.4-zip php7.4-gd php7.4-mbstring php7.4-curl php7.4-xml php7.4-bcmath
    ```

    ## INSTALL MARIADB

    ```sh
    sudo apt update
    sudo apt install mariadb-server
    sudo systemctl start mariadb.service
    sudo mysql_secure_installation
    ```

    ### CREATE OR SET PASSWORD
    ```sh
    sudo mysql
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
    GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
    ```

    ## INSTALL PHPMYADMIN

    ```sh
    sudo apt install phpmyadmin

    sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl

    sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
    sudo a2enconf phpmyadmin.conf
    sudo systemctl reload apache2.service
    ```