Cập nhật cấu hình Apache!!! !!! 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 //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
0brew install php
Cập nhật cấu hình Apache
1brew install php
Bài kiểm tra
2brew install php
Cài đặt
3brew install php
4brew install php
5brew install php
6brew install php
Cài đặt phpmyadmin
7brew install php
8brew install php
Cập nhật cấu hình
9brew install php
Cài đặt Apache
0To 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
Tạo httpd-php.conf
1To 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 httpd
Bài kiểm tra
3To 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
Cài đặt
4To 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
Cài đặt phpmyadmin
5To 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
Hướng dẫn install mysql and phpmyadmin mac - cài đặt mysql và phpmyadmin mac
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/.
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 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.
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 ..