Last active
November 24, 2023 02:25
-
-
Save hoangnamitc/6a9ad58825b549802efbb28f3fb7623c to your computer and use it in GitHub Desktop.
PHP Installation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 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 | |
# 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://raw.githubusercontent.com/rhukster/sphp.sh/main/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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment