Skip to content

Instantly share code, notes, and snippets.

@hoangnamitc
Last active November 24, 2023 02:25
Show Gist options
  • Save hoangnamitc/6a9ad58825b549802efbb28f3fb7623c to your computer and use it in GitHub Desktop.
Save hoangnamitc/6a9ad58825b549802efbb28f3fb7623c to your computer and use it in GitHub Desktop.

Revisions

  1. hoangnamitc revised this gist Nov 24, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions php-install.txt
    Original file line number Diff line number Diff line change
    @@ -49,9 +49,9 @@ brew services start httpd

    -------------------------------------------------------------------------------
    # Cài Chuyển nhanh PHP - Sphp
    curl -L https://raw.githubusercontent.com/rhukster/sphp.sh/main/sphp.sh > /opt/homebrew/bin/sphp
    curl -L https://raw.githubusercontent.com/rhukster/sphp.sh/main/sphp.sh > /usr/local/bin/sphp

    chmod +x /opt/homebrew/bin/sphp
    chmod +x /usr/local/bin/sphp

    # Sét Path
    export PATH=/usr/local/bin:/usr/local/sbin:$PATH
  2. hoangnamitc revised this gist Nov 24, 2023. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions php-install.txt
    Original file line number Diff line number Diff line change
    @@ -49,8 +49,9 @@ brew services start httpd

    -------------------------------------------------------------------------------
    # Cài Chuyển nhanh PHP - Sphp
    curl -L https://gist.github.com/rhukster/f4c04f1bf59e0b74e335ee5d186a98e2/raw/0c36a5067fbd63e6a36700a6aaa119df0836bdfc/sphp.sh > /usr/local/bin/sphp
    chmod +x /usr/local/bin/sphp
    curl -L https://raw.githubusercontent.com/rhukster/sphp.sh/main/sphp.sh > /opt/homebrew/bin/sphp

    chmod +x /opt/homebrew/bin/sphp

    # Sét Path
    export PATH=/usr/local/bin:/usr/local/sbin:$PATH
  3. hoangnamitc revised this gist Nov 24, 2023. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion php-install.txt
    Original file line number Diff line number Diff line change
    @@ -14,13 +14,17 @@ brew install shivammathur/php/[email protected]
    -------------------------------------------------------------------------------
    # Thêm PHP vào Apache - Sửa file: /usr/local/etc/httpd/httpd.conf
    # Dán các dòng sau vào:
    LoadModule php5_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp5.so
    ————
    #LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
    #LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
    #LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
    #LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
    #LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
    #LoadModule php_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp.so
    #LoadModule php_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp.so
    LoadModule php_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp.so
    #LoadModule php_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp.so
    #LoadModule php_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp.so

    -------------------------------------------------------------------------------
    # Cấu hình đọc mặc định index.php
  4. hoangnamitc revised this gist Apr 18, 2021. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions php-install.txt
    Original file line number Diff line number Diff line change
    @@ -52,3 +52,6 @@ chmod +x /usr/local/bin/sphp
    export PATH=/usr/local/bin:/usr/local/sbin:$PATH

    # sử dụng: sphp 7.4



  5. hoangnamitc created this gist Apr 18, 2021.
    54 changes: 54 additions & 0 deletions php-install.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,54 @@
    # Cài thư viện
    brew tap shivammathur/php

    -------------------------------------------------------------------------------
    # Cài phiên bản
    brew install shivammathur/php/[email protected]
    brew install shivammathur/php/[email protected]
    brew install shivammathur/php/[email protected]
    brew install shivammathur/php/[email protected]
    brew install shivammathur/php/[email protected]
    brew install shivammathur/php/[email protected]
    brew install shivammathur/php/[email protected]

    -------------------------------------------------------------------------------
    # Thêm PHP vào Apache - Sửa file: /usr/local/etc/httpd/httpd.conf
    # Dán các dòng sau vào:
    LoadModule php5_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp5.so
    #LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
    #LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
    #LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
    #LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
    #LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so
    #LoadModule php_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp.so

    -------------------------------------------------------------------------------
    # Cấu hình đọc mặc định index.php
    # Tìm
    <IfModule dir_module>
    DirectoryIndex index.html
    </IfModule>

    # Sửa thành:
    <IfModule dir_module>
    DirectoryIndex index.php index.html
    </IfModule>

    <FilesMatch \.php$>
    SetHandler application/x-httpd-php
    </FilesMatch>

    # Khởi động lại Apache
    brew services stop httpd
    brew services start httpd


    -------------------------------------------------------------------------------
    # Cài Chuyển nhanh PHP - Sphp
    curl -L https://gist.github.com/rhukster/f4c04f1bf59e0b74e335ee5d186a98e2/raw/0c36a5067fbd63e6a36700a6aaa119df0836bdfc/sphp.sh > /usr/local/bin/sphp
    chmod +x /usr/local/bin/sphp

    # Sét Path
    export PATH=/usr/local/bin:/usr/local/sbin:$PATH

    # sử dụng: sphp 7.4