Hướng dẫn install mysql and phpmyadmin mac - cài đặt mysql và phpmyadmin mac

!!! !!! Hướng dẫn này được tạo ra với MacBook Pro M1. Đường dẫn có thể khác nhau cho các máy khác nhau hoặc thậm chí cùng một máy.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Cài đặt PHP

brew install php
To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so


    SetHandler application/x-httpd-php


Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /opt/homebrew/etc/php/8.1/

To restart php after an upgrade:
  brew services restart php
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/php/sbin/php-fpm --nodaemonize
brew services restart php
php --version
PHP 8.1.2 (cli) (built: Jan 21 2022 04:34:01) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2, Copyright (c), by Zend Technologies

Cập nhật cấu hình

php -i | grep "additional .ini"
Scan this dir for additional .ini files => /opt/homebrew/etc/php/8.1/conf.d

# Instead of modify setting in default .ini file, /opt/homebrew/etc/php/8.1/php.ini
# You should vi new .ini file to /opt/homebrew/etc/php/8.1/conf.d
# All .ini files in conf.d will be scanned and loaded

# Example
echo "memory_limit = 512M" > /opt/homebrew/etc/php/8.1/conf.d/memory-limit.ini

php --ini
Configuration File (php.ini) Path: /opt/homebrew/etc/php/8.1
Loaded Configuration File:         /opt/homebrew/etc/php/8.1/php.ini
Scan for additional .ini files in: /opt/homebrew/etc/php/8.1/conf.d
Additional .ini files parsed:      /opt/homebrew/etc/php/8.1/conf.d/ext-opcache.ini,
/opt/homebrew/etc/php/8.1/conf.d/memory-limit.ini

php -i | grep "memory_limit"               
memory_limit => 512M => 512M

Cài đặt Apache

brew install httpd
DocumentRoot is /opt/homebrew/var/www.

The default ports have been set in /opt/homebrew/etc/httpd/httpd.conf to 8080 and in
/opt/homebrew/etc/httpd/extra/httpd-ssl.conf to 8443 so that httpd can run without sudo.

To restart httpd after an upgrade:
  brew services restart httpd
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/httpd/bin/httpd -D FOREGROUND
brew services restart httpd
httpd -v
Server version: Apache/2.4.52 (Unix)
Server built:   Dec 20 2021 13:35:09

Tạo httpd-php.conf

brew install php
0

Cập nhật cấu hình Apache

brew install php
1

Bài kiểm tra

brew install php
2

Cài đặt

brew install php
3
brew install php
4
brew install php
5
brew install php
6

Cài đặt phpmyadmin

brew install php
7
brew install php
8

Cập nhật cấu hình

brew install php
9

Cài đặt Apache

To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so


    SetHandler application/x-httpd-php


Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /opt/homebrew/etc/php/8.1/

To restart php after an upgrade:
  brew services restart php
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/php/sbin/php-fpm --nodaemonize
0

Tạo httpd-php.conf

To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so


    SetHandler application/x-httpd-php


Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /opt/homebrew/etc/php/8.1/

To restart php after an upgrade:
  brew services restart php
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/php/sbin/php-fpm --nodaemonize
1

Cập nhật cấu hình Apache

brew services restart httpd

Bài kiểm tra

To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so


    SetHandler application/x-httpd-php


Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /opt/homebrew/etc/php/8.1/

To restart php after an upgrade:
  brew services restart php
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/php/sbin/php-fpm --nodaemonize
3

Cài đặt

To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so


    SetHandler application/x-httpd-php


Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /opt/homebrew/etc/php/8.1/

To restart php after an upgrade:
  brew services restart php
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/php/sbin/php-fpm --nodaemonize
4

Cài đặt phpmyadmin

To enable PHP in Apache add the following to httpd.conf and restart Apache:
LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/libphp.so


    SetHandler application/x-httpd-php


Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:
    /opt/homebrew/etc/php/8.1/

To restart php after an upgrade:
  brew services restart php
Or, if you don't want/need a background service you can just run:
  /opt/homebrew/opt/php/sbin/php-fpm --nodaemonize
5

Tôi có thể cài đặt phpmyadmin trên mac không?

Tải xuống và cài đặt tệp, làm theo hướng dẫn và ghi lại bất kỳ tên người dùng và mật khẩu nào được cung cấp cho bạn. Lệnh để bắt đầu Apache trong thiết bị đầu cuối MAC. Với điều đó, tất cả những gì còn lại là cài đặt phpmyadmin. Đổi tên thư mục thành phpmyadmin và chuyển nó sang/thư viện/máy chủ web/tài liệu/.

Phpmyadmin có tương thích với mysql không?

Phiên bản tương lai tương thích với PHP 7.2 và mới hơn và MySQL/MariaDB 5.5 và mới hơn.compatible with PHP 7.2 and newer and MySQL/MariaDB 5.5 and newer.

MySQL có hoạt động trên Mac Big Sur không?

MySQL không được tải sẵn với MacOS Big Sur và cần được tải từ trang web MySQL.Phiên bản mới nhất của MySQL 8.0.24 hoạt động với MacOS 11 Big Sur.Sử dụng Lưu trữ DMG MySQL-8.0.The latest version of MySQL 8.0. 24 does work with macOS 11 Big Sur. Use the DMG Archive mysql-8.0.

Làm thế nào cài đặt apache mysql php stack mac?

Mở thiết bị đầu cuối và làm theo các bước bên dưới ...
Bước 1 - Cài đặt hoặc khởi động lại Chia sẻ web Apache trên Mac.Để bắt đầu chia sẻ web Apache: Sudo Apachectl bắt đầu.....
Bước 2 - Tài liệu gốc (cấp hệ thống và cấp độ người dùng), .htaccess ghi đè, cài đặt PHP.Root Web cấp hệ thống.....
Bước 3 - Cài đặt MySQL.....
Bước 4 - Cài đặt phpmyadmin ..