Hạ cấp PHP 7.4 về PHP 7.3 trên VestaCP 3
VestaCP

Hạ cấp PHP 7.4 về PHP 7.3 trên VestaCP

Hiện tại thì khi cài đặt VestaCP thì sẽ có phiên bản PHP là 7.4 beta, mà hiện tại đa số code chưa hỗ trợ PHP 7.4 tốt nên cần hạ cấp về PHP 7.3. Đây là bài viết giúp bạn làm điều này

Đăng nhập vào VPS với quyền ROOT và chạy lần lượt các lệnh sau:

yum install yum-utils -y
yum-config-manager –disable remi-php5*
yum-config-manager –disable remi-test
yum-config-manager –disable remi-php70
yum-config-manager –disable remi-php71
yum-config-manager –disable remi-php72
yum-config-manager –disable remi-php74
yum-config-manager –enable remi-php73
yum remove php-*
yum install roundcubemail phpmyadmin mod_php
chmod 777 /var/lib/phpMyAdmin/temp
service httpd restart

Một vấn đề cần xử lý thêm đó là sau khi làm các bước trên, khi truy cập vào phpMyadmin sẽ gặp lỗi

Forbidden
You don’t have permission to access /phpmyadmin/ on this server.

Hạ cấp PHP 7.4 về PHP 7.3 trên VestaCP 4

Để xử lý vấn đề này, bạn sửa thay thế nội dung file  /etc/httpd/conf.d/phpMyAdmin.conf bằng nội dung dưới đây

# phpMyAdmin – Web based MySQL browser written in php
#
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

<Directory /usr/share/phpMyAdmin/>
Order Deny,Allow
Deny from All
Allow from All
</Directory>

<Directory /usr/share/phpMyAdmin/scripts/>
Order Deny,Allow
Deny from All
Allow from All
</Directory>

# This directory does not require access over HTTP – taken from the original
# phpMyAdmin upstream tarball
#
<Directory /usr/share/phpMyAdmin/libraries/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/>
<IfModule mod_authz_core.c>
# Apache 2.4
Require local
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>

# These directories do not require access over HTTP – taken from the original
# phpMyAdmin upstream tarball
#
<Directory /usr/share/phpMyAdmin/libraries/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/lib/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/frames/>
Order Deny,Allow
Deny from All
Allow from None
</Directory>

# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc. This may break your mod_security implementation.
#
#<IfModule mod_security.c>
# <Directory /usr/share/phpMyAdmin/>
# SecRuleInheritance Off
# </Directory>
#</IfModule>

Sau đó khởi động lại HTTPD là được

service httpd restart

 

Avatar of jamesblackvn

Tui là jamesblackvn!

2 Comments

    • Avatar of jamesblackvn

      jamesblackvn

      He he, VestaCP nó có ưu điểm là gọn NHẸ, 512Mb ram là cài được rồi, hệ thống CLI mạnh mẽ, quản trị hầu hết nhu cầu
      Nếu mà nói chuối thì nó ko có tích hợp FIle Manager mặc định thôi

      Chứ cần nhiều phiên bản PHP vẫn có, File Manager vẫn có, chống local băng chroot vẫn có

      Nói chung ai cần GỌN NHẸ, DỄ DÙNG cho end user vè FREE thì cứ múc VestaCP hoy :3

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *

Website này sử dụng Akismet để hạn chế spam. Tìm hiểu bình luận của bạn được duyệt như thế nào.