brew update
brew install mariadb
#LUÔN KHỞI ĐỘNG CÙNG MÁY https://mariadb.com/kb/en/launchd/
| Terminal run code: | |
| ```` | |
| sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl | |
| ```` | |
| DONE ! |
| (for any site) | |
| RewriteEngine On | |
| RewriteCond %{HTTPS} !=on | |
| RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] | |
| Header always set Content-Security-Policy "upgrade-insecure-requests;" | |
| (with WordPress) - (replace line: "RewriteEngine On") |
| ------------------------------- | |
| Xem php.init ở đâu: php --ini | |
| - post_max_size : 750M | |
| - upload_max_filesize : 750M (Dung lượng tối đa cho việc upload file) | |
| - max_execution_time : 120 (Thời gian tối đa để thực thi 1 tác vụ PHP "giây") |
| sudo dscacheutil -flushcache | |
| sudo killall -HUP mDNSResponder |
| - Mở Automator | |
| - Tạo mới "Service" (Quick Action) | |
| - Thêm một action "Run Shell Script" | |
| - Mục Workflow receives current bạn chọn: "files or folders" in "Finder.app" | |
| - Mục Run Shell Script: | |
| + Shell chọn: /bin/bash | |
| + Pass input chọn: as arguments | |
| + nội dung nhập: | |
| for f in "$@"; do |
| - Mở Automator | |
| - Quick Action | |
| - Tạo mới "Service" | |
| - Thêm một action "Run Shell Script" | |
| - Mục Workflow receives current bạn chọn: "files or folders" in "Finder" | |
| - Mục Run Shell Script: | |
| + Shell chọn: /bin/bash | |
| + Pass input chọn: as arguments | |
| + nội dung nhập: | |
| /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -a "$@" |
| # Sau khi cài xong mà ko gõ được lệnh composer thì chạy lệnh sau: | |
| sudo mv composer.phar /usr/local/bin/composer |
| # 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 update
brew install mariadb
#LUÔN KHỞI ĐỘNG CÙNG MÁY https://mariadb.com/kb/en/launchd/
| Source: https://getgrav.org/blog/macos-monterey-apache-multiple-php-versions | |
| ------------------------------------------------------------------------------------------------ | |
| # Tắt Apache mặc định của OSX | |
| sudo apachectl stop | |
| sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null | |
| ------------------------------------------------------------------------------------------------ | |
| # Cài Apache mới | |
| HOMEBREW_NO_AUTO_UPDATE=1 brew install httpd | |
| ------------------------------------------------------------------------------------------------ |