Trong nhiều trường hợp, bạn có thể muốn sử dụng XAMPP với phiên bản PHP khác với phiên bản được cài đặt sẵn. Bạn có thể làm điều này để nhận được những lợi ích của phiên bản PHP mới hơn hoặc để tạo lại các lỗi bằng phiên bản PHP cũ hơn
Hướng dẫn này giả định rằng hệ thống của bạn bao gồm tất cả các công cụ biên dịch cần thiết. Nếu chưa có, bạn có thể cài đặt dễ dàng bằng cách chạy lệnh sudo apt-get install build-essential hoặc sudo yum groupinstall "Development Tools" từ thiết bị đầu cuối Linux của bạn
Để sử dụng một phiên bản PHP khác với XAMPP, hãy làm theo các bước sau
Dừng máy chủ Apache của bạn bằng bảng điều khiển XAMPP
Mở một thiết bị đầu cuối Linux mới và đảm bảo bạn đã đăng nhập với quyền root
Sao lưu các tệp PHP XAMPP hiện tại của bạn, trong trường hợp sau này bạn muốn trở lại phiên bản PHP trước đó. Các tệp này được lưu trữ ở hai vị trí. thư mục con php/ và modules/ của thư mục cài đặt XAMPP của bạn [thường là /opt/lampp]. Bạn cũng nên sao lưu php. ini trong thư mục con etc/
cd /opt/lampp mv /opt/lampp/php /opt/lampp/php.old mv /opt/lampp/etc/php.ini /opt/lampp/etc/php.ini.old mv /opt/lampp/modules/libphp5.so /opt/lampp/modules/libphp5.so.old
Tải xuống kho lưu trữ nguồn của phiên bản PHP mà bạn muốn sử dụng từ trang web PHP và trích xuất nội dung của tệp lưu trữ nén vào thư mục /tmp
Định cấu hình và xây dựng PHP theo cách thông thường. Khi thực thi tập lệnh cấu hình, hãy chỉ định thư mục cài đặt XAMPP cho các tùy chọn --prefix, --with-apxs2 và --with-config-file, cùng với các lệnh cho bất kỳ mô-đun nào khác mà bạn muốn kích hoạt. Ví dụ, đây là một ví dụ đơn giản về cấu hình PHP chỉ với sự hỗ trợ của MySQL
./configure --prefix=/opt/lampp --with-apxs2=/opt/lampp/bin/apxs --with-config-file-path=/opt/lampp/etc --with-mysql=mysqlnd
Dưới đây là một ví dụ về cấu hình phức tạp hơn để kích hoạt các mô-đun bổ sung
./configure --prefix=/opt/lampp --with-apxs2=/opt/lampp/bin/apxs --with-config-file-path=/opt/lampp/etc --with-mysql=mysqlnd --enable-inline-optimization --disable-debug --enable-bcmath --enable-calendar --enable-ctype --enable-ftp --enable-gd-native-ttf --enable-magic-quotes --enable-shmop --disable-sigchild --enable-sysvsem --enable-sysvshm --enable-wddx --with-gdbm=/opt/lampp --with-jpeg-dir=/opt/lampp --with-png-dir=/opt/lampp --with-freetype-dir=/opt/lampp --with-zlib=yes --with-zlib-dir=/opt/lampp --with-openssl=/opt/lampp --with-xsl=/opt/lampp --with-ldap=/opt/lampp --with-gd --with-imap-ssl --with-gettext=/opt/lampp --with-mssql=/opt/lampp --with-sybase-ct=/opt/lampp --with-mysql-sock=/opt/lampp/var/mysql/mysql.sock --with-oci8=shared,instantclient,/opt/lampp/lib/instantclient --with-mcrypt=/opt/lampp --with-mhash=/opt/lampp --enable-sockets --enable-mbstring=all --with-curl=/opt/lampp --enable-mbregex --enable-zend-multibyte --enable-exif --with-bz2=/opt/lampp --with-sqlite=shared,/opt/lampp --with-sqlite3=/opt/lampp --with-libxml-dir=/opt/lampp --enable-soap --enable-pcntl --with-mysqli=mysqlnd --with-iconv=/opt/lampp --with-pdo-mysql=mysqlnd --with-pdo-sqlite --with-icu-dir=/opt/lampp --enable-fileinfo --enable-phar --enable-zip --enable-intl
Đây là một ví dụ về những gì bạn có thể thấy trong quá trình cấu hình
Sau khi cấu hình xong, tiến hành build PHP như bình thường
make && make install
Khi kết thúc bước này, phiên bản PHP mới sẽ được cài đặt trong thư mục con php/ của thư mục cài đặt XAMPP của bạn, thay thế phiên bản trước đó
Để biết thêm thông tin về cách định cấu hình và xây dựng PHP trên hệ thống Linux, hãy tham khảo hướng dẫn sử dụng PHP
sao chép php. ini-Development từ thư mục con php/ mới sang thư mục con etc/ và đổi tên nó thành php. ban đầu. Nếu bạn thích sử dụng cài đặt sản xuất, thay vào đó, bạn có thể sử dụng tệp php. tập tin sản xuất ban đầu
cd /opt/lampp/ cp php/php.ini-development etc/php.ini
Khởi động lại máy chủ Apache của bạn thông qua bảng điều khiển XAMPP để các thay đổi của bạn có hiệu lực
Phiên bản mới của PHP bây giờ sẽ hoạt động. Để xác minh điều này, hãy duyệt đến URL http. //localhost/xampp/phpinfo. php, hiển thị đầu ra của lệnh phpinfo[] và kiểm tra số phiên bản ở đầu trang
Bạn phải sao lưu máy chủ của mình trước khi chạy các lệnh này vì chúng không thể bị đảo ngược. Nếu bạn đang sử dụng dịch vụ lưu trữ đám mây, hãy đảm bảo rằng bạn hình dung phiên bản của mình trước khi chạy bất kỳ lệnh nào trong số này. Bạn đã được cảnh báo
Để biết phiên bản PHP nào bạn đang sử dụng, hãy chạy
php -v
Nếu bạn đang chạy PHP 7. x, bạn có thể tiếp tục với hướng dẫn này để nâng cấp lên PHP 8
1. Gói PHP
Nâng cấp từ PHP 7. x lên PHP 8 không chỉ liên quan đến việc nâng cấp lõi PHP mà còn tất cả các tiện ích mở rộng của nó. Ví dụ: nếu bạn sử dụng tiện ích mở rộng PHP cURL, bạn sẽ cần cài đặt thủ công phiên bản PHP 8 ở cuối hướng dẫn này
Ở cuối hướng dẫn này, tôi đã bao gồm một lệnh để cài đặt các tiện ích mở rộng PHP 8 phổ biến nhất, tuy nhiên, bạn nên kiểm tra xem PHP 7 nào. x hiện được cài đặt trên máy chủ cụ thể của bạn và lưu ý mọi thứ quan trọng đối với việc chạy ứng dụng web của riêng bạn
dpkg -l | grep php | tee packages.txt
đầu ra
ii libapache2-mod-php 1:7.2+60ubuntu1 all server-side, HTML-embedded scri
ii libapache2-mod-php7.2 7.2.24-0ubuntu0.18.04.7 amd64 server-side, HTML-embedded scri
ii php 1:7.2+60ubuntu1 all server-side, HTML-embedded scri
ii php-bz2 1:7.2+60ubuntu1 all bzip2 module for PHP [default]
ii php-common 1:60ubuntu1 all Common files for PHP packages
ii php-curl 1:7.2+60ubuntu1 all CURL module for PHP [default]
ii php-gd 1:7.2+60ubuntu1 all GD module for PHP [default]
ii php-mbstring 1:7.2+60ubuntu1 all MBSTRING module for PHP [defaul
ii php-mysql 1:7.2+60ubuntu1 all MySQL module for PHP [default]
ii php-pear 1:1.10.5+submodules+notgz-1ubuntu1.18.04.3 all PEAR Base System
ii php-php-gettext 1.0.12-0.1 all read gettext MO files directly,
ii php-phpseclib 2.0.9-1 all implementations of an arbitrary
ii php-tcpdf 6.2.13+dfsg-1ubuntu1 all PHP class for generating PDF fi
ii php-xml 1:7.2+60ubuntu1 all DOM, SimpleXML, WDDX, XML, and
ii php-zip 1:7.2+60ubuntu1 all Zip module for PHP [default]
ii php7.2 7.2.24-0ubuntu0.18.04.7 all server-side, HTML-embedded scri
ii php7.2-bz2 7.2.24-0ubuntu0.18.04.7 amd64 bzip2 module for PHP
ii php7.2-cli 7.2.24-0ubuntu0.18.04.7 amd64 command-line interpreter for th
ii php7.2-common 7.2.24-0ubuntu0.18.04.7 amd64 documentation, examples and com
ii php7.2-curl 7.2.24-0ubuntu0.18.04.7 amd64 CURL module for PHP
ii php7.2-gd 7.2.24-0ubuntu0.18.04.7 amd64 GD module for PHP
ii php7.2-json 7.2.24-0ubuntu0.18.04.7 amd64 JSON module for PHP
ii php7.2-mbstring 7.2.24-0ubuntu0.18.04.7 amd64 MBSTRING module for PHP
ii php7.2-mysql 7.2.24-0ubuntu0.18.04.7 amd64 MySQL module for PHP
ii php7.2-opcache 7.2.24-0ubuntu0.18.04.7 amd64 Zend OpCache module for PHP
ii php7.2-readline 7.2.24-0ubuntu0.18.04.7 amd64 readline module for PHP
ii php7.2-xml 7.2.24-0ubuntu0.18.04.7 amd64 DOM, SimpleXML, WDDX, XML, and
ii php7.2-zip 7.2.24-0ubuntu0.18.04.7 amd64 Zip module for PHP
ii phpmyadmin 4:4.6.6-5ubuntu0.5 all MySQL web administration tool
Ví dụ trên cho thấy PHP 7. 2 tiện ích mở rộng được cài đặt trên máy chủ của riêng tôi trước khi nâng cấp lên PHP 8. Sao chép kết quả của riêng bạn vào một tệp văn bản và giữ nó an toàn trong trường hợp bạn cần cài đặt phiên bản PHP 8 sau này
2. Gỡ cài đặt/Gỡ bỏ PHP 7. x và Tiện ích mở rộng
Để gỡ cài đặt PHP 7. x và tất cả các tiện ích mở rộng của nó, hãy chạy lệnh bên dưới
________số 8
Nhấn
dpkg -l | grep php | tee packages.txt
7 và dpkg -l | grep php | tee packages.txt
8 khi được nhắcNếu bạn đã cài đặt phpMyAdmin, bạn có thể thấy màn hình này
Nếu được nhắc với thông báo trên, hãy chọn
dpkg -l | grep php | tee packages.txt
9 và nhấn dpkg -l | grep php | tee packages.txt
8Bạn cũng có thể được nhắc xóa cơ sở dữ liệu
Nếu được nhắc với thông báo trên, hãy chọn
ii libapache2-mod-php 1:7.2+60ubuntu1 all server-side, HTML-embedded scri
ii libapache2-mod-php7.2 7.2.24-0ubuntu0.18.04.7 amd64 server-side, HTML-embedded scri
ii php 1:7.2+60ubuntu1 all server-side, HTML-embedded scri
ii php-bz2 1:7.2+60ubuntu1 all bzip2 module for PHP [default]
ii php-common 1:60ubuntu1 all Common files for PHP packages
ii php-curl 1:7.2+60ubuntu1 all CURL module for PHP [default]
ii php-gd 1:7.2+60ubuntu1 all GD module for PHP [default]
ii php-mbstring 1:7.2+60ubuntu1 all MBSTRING module for PHP [defaul
ii php-mysql 1:7.2+60ubuntu1 all MySQL module for PHP [default]
ii php-pear 1:1.10.5+submodules+notgz-1ubuntu1.18.04.3 all PEAR Base System
ii php-php-gettext 1.0.12-0.1 all read gettext MO files directly,
ii php-phpseclib 2.0.9-1 all implementations of an arbitrary
ii php-tcpdf 6.2.13+dfsg-1ubuntu1 all PHP class for generating PDF fi
ii php-xml 1:7.2+60ubuntu1 all DOM, SimpleXML, WDDX, XML, and
ii php-zip 1:7.2+60ubuntu1 all Zip module for PHP [default]
ii php7.2 7.2.24-0ubuntu0.18.04.7 all server-side, HTML-embedded scri
ii php7.2-bz2 7.2.24-0ubuntu0.18.04.7 amd64 bzip2 module for PHP
ii php7.2-cli 7.2.24-0ubuntu0.18.04.7 amd64 command-line interpreter for th
ii php7.2-common 7.2.24-0ubuntu0.18.04.7 amd64 documentation, examples and com
ii php7.2-curl 7.2.24-0ubuntu0.18.04.7 amd64 CURL module for PHP
ii php7.2-gd 7.2.24-0ubuntu0.18.04.7 amd64 GD module for PHP
ii php7.2-json 7.2.24-0ubuntu0.18.04.7 amd64 JSON module for PHP
ii php7.2-mbstring 7.2.24-0ubuntu0.18.04.7 amd64 MBSTRING module for PHP
ii php7.2-mysql 7.2.24-0ubuntu0.18.04.7 amd64 MySQL module for PHP
ii php7.2-opcache 7.2.24-0ubuntu0.18.04.7 amd64 Zend OpCache module for PHP
ii php7.2-readline 7.2.24-0ubuntu0.18.04.7 amd64 readline module for PHP
ii php7.2-xml 7.2.24-0ubuntu0.18.04.7 amd64 DOM, SimpleXML, WDDX, XML, and
ii php7.2-zip 7.2.24-0ubuntu0.18.04.7 amd64 Zip module for PHP
ii phpmyadmin 4:4.6.6-5ubuntu0.5 all MySQL web administration tool
1 và nhấn dpkg -l | grep php | tee packages.txt
83. Autoclean và Autoremove
Sau khi gỡ cài đặt các gói khỏi Linux, bạn nên chạy hai lệnh này
./configure --prefix=/opt/lampp --with-apxs2=/opt/lampp/bin/apxs --with-config-file-path=/opt/lampp/etc --with-mysql=mysqlnd5
./configure --prefix=/opt/lampp --with-apxs2=/opt/lampp/bin/apxs --with-config-file-path=/opt/lampp/etc --with-mysql=mysqlnd6
Nhấn
ii libapache2-mod-php 1:7.2+60ubuntu1 all server-side, HTML-embedded scri
ii libapache2-mod-php7.2 7.2.24-0ubuntu0.18.04.7 amd64 server-side, HTML-embedded scri
ii php 1:7.2+60ubuntu1 all server-side, HTML-embedded scri
ii php-bz2 1:7.2+60ubuntu1 all bzip2 module for PHP [default]
ii php-common 1:60ubuntu1 all Common files for PHP packages
ii php-curl 1:7.2+60ubuntu1 all CURL module for PHP [default]
ii php-gd 1:7.2+60ubuntu1 all GD module for PHP [default]
ii php-mbstring 1:7.2+60ubuntu1 all MBSTRING module for PHP [defaul
ii php-mysql 1:7.2+60ubuntu1 all MySQL module for PHP [default]
ii php-pear 1:1.10.5+submodules+notgz-1ubuntu1.18.04.3 all PEAR Base System
ii php-php-gettext 1.0.12-0.1 all read gettext MO files directly,
ii php-phpseclib 2.0.9-1 all implementations of an arbitrary
ii php-tcpdf 6.2.13+dfsg-1ubuntu1 all PHP class for generating PDF fi
ii php-xml 1:7.2+60ubuntu1 all DOM, SimpleXML, WDDX, XML, and
ii php-zip 1:7.2+60ubuntu1 all Zip module for PHP [default]
ii php7.2 7.2.24-0ubuntu0.18.04.7 all server-side, HTML-embedded scri
ii php7.2-bz2 7.2.24-0ubuntu0.18.04.7 amd64 bzip2 module for PHP
ii php7.2-cli 7.2.24-0ubuntu0.18.04.7 amd64 command-line interpreter for th
ii php7.2-common 7.2.24-0ubuntu0.18.04.7 amd64 documentation, examples and com
ii php7.2-curl 7.2.24-0ubuntu0.18.04.7 amd64 CURL module for PHP
ii php7.2-gd 7.2.24-0ubuntu0.18.04.7 amd64 GD module for PHP
ii php7.2-json 7.2.24-0ubuntu0.18.04.7 amd64 JSON module for PHP
ii php7.2-mbstring 7.2.24-0ubuntu0.18.04.7 amd64 MBSTRING module for PHP
ii php7.2-mysql 7.2.24-0ubuntu0.18.04.7 amd64 MySQL module for PHP
ii php7.2-opcache 7.2.24-0ubuntu0.18.04.7 amd64 Zend OpCache module for PHP
ii php7.2-readline 7.2.24-0ubuntu0.18.04.7 amd64 readline module for PHP
ii php7.2-xml 7.2.24-0ubuntu0.18.04.7 amd64 DOM, SimpleXML, WDDX, XML, and
ii php7.2-zip 7.2.24-0ubuntu0.18.04.7 amd64 Zip module for PHP
ii phpmyadmin 4:4.6.6-5ubuntu0.5 all MySQL web administration tool
3 và dpkg -l | grep php | tee packages.txt
8 nếu được nhắc4. Thêm kho lưu trữ PPA của Ondřej Surý
Nếu bạn đang chạy Ubuntu 22. 04 trở lên thì không cần thêm kho bên dưới này. Thay vào đó, hãy chuyển sang phần 5
Nếu bạn đang chạy Ubuntu 20. 04 hoặc 18. 04, các gói nhị phân PHP 8 chỉ khả dụng trong kho lưu trữ Ondřej Surý PPA. Cài đặt bên dưới
./configure --prefix=/opt/lampp --with-apxs2=/opt/lampp/bin/apxs --with-config-file-path=/opt/lampp/etc --with-mysql=mysqlnd9
Bạn có thể thấy một thông báo chào mừng
đầu ra
./configure --prefix=/opt/lampp --with-apxs2=/opt/lampp/bin/apxs --with-config-file-path=/opt/lampp/etc --with-mysql=mysqlnd --enable-inline-optimization --disable-debug --enable-bcmath --enable-calendar --enable-ctype --enable-ftp --enable-gd-native-ttf --enable-magic-quotes --enable-shmop --disable-sigchild --enable-sysvsem --enable-sysvshm --enable-wddx --with-gdbm=/opt/lampp --with-jpeg-dir=/opt/lampp --with-png-dir=/opt/lampp --with-freetype-dir=/opt/lampp --with-zlib=yes --with-zlib-dir=/opt/lampp --with-openssl=/opt/lampp --with-xsl=/opt/lampp --with-ldap=/opt/lampp --with-gd --with-imap-ssl --with-gettext=/opt/lampp --with-mssql=/opt/lampp --with-sybase-ct=/opt/lampp --with-mysql-sock=/opt/lampp/var/mysql/mysql.sock --with-oci8=shared,instantclient,/opt/lampp/lib/instantclient --with-mcrypt=/opt/lampp --with-mhash=/opt/lampp --enable-sockets --enable-mbstring=all --with-curl=/opt/lampp --enable-mbregex --enable-zend-multibyte --enable-exif --with-bz2=/opt/lampp --with-sqlite=shared,/opt/lampp --with-sqlite3=/opt/lampp --with-libxml-dir=/opt/lampp --enable-soap --enable-pcntl --with-mysqli=mysqlnd --with-iconv=/opt/lampp --with-pdo-mysql=mysqlnd --with-pdo-sqlite --with-icu-dir=/opt/lampp --enable-fileinfo --enable-phar --enable-zip --enable-intl0
Nhấn
dpkg -l | grep php | tee packages.txt
8 để thêm kho lưu trữ5. Cài đặt PHP8
Khi viết, PHP 8. 1 hiện đã có sẵn vì vậy chúng tôi sẽ cài đặt cái đó. Nếu có phiên bản mới hơn, hãy đảm bảo thay đổi các lệnh bên dưới để phù hợp
./configure --prefix=/opt/lampp --with-apxs2=/opt/lampp/bin/apxs --with-config-file-path=/opt/lampp/etc --with-mysql=mysqlnd --enable-inline-optimization --disable-debug --enable-bcmath --enable-calendar --enable-ctype --enable-ftp --enable-gd-native-ttf --enable-magic-quotes --enable-shmop --disable-sigchild --enable-sysvsem --enable-sysvshm --enable-wddx --with-gdbm=/opt/lampp --with-jpeg-dir=/opt/lampp --with-png-dir=/opt/lampp --with-freetype-dir=/opt/lampp --with-zlib=yes --with-zlib-dir=/opt/lampp --with-openssl=/opt/lampp --with-xsl=/opt/lampp --with-ldap=/opt/lampp --with-gd --with-imap-ssl --with-gettext=/opt/lampp --with-mssql=/opt/lampp --with-sybase-ct=/opt/lampp --with-mysql-sock=/opt/lampp/var/mysql/mysql.sock --with-oci8=shared,instantclient,/opt/lampp/lib/instantclient --with-mcrypt=/opt/lampp --with-mhash=/opt/lampp --enable-sockets --enable-mbstring=all --with-curl=/opt/lampp --enable-mbregex --enable-zend-multibyte --enable-exif --with-bz2=/opt/lampp --with-sqlite=shared,/opt/lampp --with-sqlite3=/opt/lampp --with-libxml-dir=/opt/lampp --enable-soap --enable-pcntl --with-mysqli=mysqlnd --with-iconv=/opt/lampp --with-pdo-mysql=mysqlnd --with-pdo-sqlite --with-icu-dir=/opt/lampp --enable-fileinfo --enable-phar --enable-zip --enable-intl2
./configure --prefix=/opt/lampp --with-apxs2=/opt/lampp/bin/apxs --with-config-file-path=/opt/lampp/etc --with-mysql=mysqlnd --enable-inline-optimization --disable-debug --enable-bcmath --enable-calendar --enable-ctype --enable-ftp --enable-gd-native-ttf --enable-magic-quotes --enable-shmop --disable-sigchild --enable-sysvsem --enable-sysvshm --enable-wddx --with-gdbm=/opt/lampp --with-jpeg-dir=/opt/lampp --with-png-dir=/opt/lampp --with-freetype-dir=/opt/lampp --with-zlib=yes --with-zlib-dir=/opt/lampp --with-openssl=/opt/lampp --with-xsl=/opt/lampp --with-ldap=/opt/lampp --with-gd --with-imap-ssl --with-gettext=/opt/lampp --with-mssql=/opt/lampp --with-sybase-ct=/opt/lampp --with-mysql-sock=/opt/lampp/var/mysql/mysql.sock --with-oci8=shared,instantclient,/opt/lampp/lib/instantclient --with-mcrypt=/opt/lampp --with-mhash=/opt/lampp --enable-sockets --enable-mbstring=all --with-curl=/opt/lampp --enable-mbregex --enable-zend-multibyte --enable-exif --with-bz2=/opt/lampp --with-sqlite=shared,/opt/lampp --with-sqlite3=/opt/lampp --with-libxml-dir=/opt/lampp --enable-soap --enable-pcntl --with-mysqli=mysqlnd --with-iconv=/opt/lampp --with-pdo-mysql=mysqlnd --with-pdo-sqlite --with-icu-dir=/opt/lampp --enable-fileinfo --enable-phar --enable-zip --enable-intl3
đầu ra
dpkg -l | grep php | tee packages.txt
0Nhấn
ii libapache2-mod-php 1:7.2+60ubuntu1 all server-side, HTML-embedded scri
ii libapache2-mod-php7.2 7.2.24-0ubuntu0.18.04.7 amd64 server-side, HTML-embedded scri
ii php 1:7.2+60ubuntu1 all server-side, HTML-embedded scri
ii php-bz2 1:7.2+60ubuntu1 all bzip2 module for PHP [default]
ii php-common 1:60ubuntu1 all Common files for PHP packages
ii php-curl 1:7.2+60ubuntu1 all CURL module for PHP [default]
ii php-gd 1:7.2+60ubuntu1 all GD module for PHP [default]
ii php-mbstring 1:7.2+60ubuntu1 all MBSTRING module for PHP [defaul
ii php-mysql 1:7.2+60ubuntu1 all MySQL module for PHP [default]
ii php-pear 1:1.10.5+submodules+notgz-1ubuntu1.18.04.3 all PEAR Base System
ii php-php-gettext 1.0.12-0.1 all read gettext MO files directly,
ii php-phpseclib 2.0.9-1 all implementations of an arbitrary
ii php-tcpdf 6.2.13+dfsg-1ubuntu1 all PHP class for generating PDF fi
ii php-xml 1:7.2+60ubuntu1 all DOM, SimpleXML, WDDX, XML, and
ii php-zip 1:7.2+60ubuntu1 all Zip module for PHP [default]
ii php7.2 7.2.24-0ubuntu0.18.04.7 all server-side, HTML-embedded scri
ii php7.2-bz2 7.2.24-0ubuntu0.18.04.7 amd64 bzip2 module for PHP
ii php7.2-cli 7.2.24-0ubuntu0.18.04.7 amd64 command-line interpreter for th
ii php7.2-common 7.2.24-0ubuntu0.18.04.7 amd64 documentation, examples and com
ii php7.2-curl 7.2.24-0ubuntu0.18.04.7 amd64 CURL module for PHP
ii php7.2-gd 7.2.24-0ubuntu0.18.04.7 amd64 GD module for PHP
ii php7.2-json 7.2.24-0ubuntu0.18.04.7 amd64 JSON module for PHP
ii php7.2-mbstring 7.2.24-0ubuntu0.18.04.7 amd64 MBSTRING module for PHP
ii php7.2-mysql 7.2.24-0ubuntu0.18.04.7 amd64 MySQL module for PHP
ii php7.2-opcache 7.2.24-0ubuntu0.18.04.7 amd64 Zend OpCache module for PHP
ii php7.2-readline 7.2.24-0ubuntu0.18.04.7 amd64 readline module for PHP
ii php7.2-xml 7.2.24-0ubuntu0.18.04.7 amd64 DOM, SimpleXML, WDDX, XML, and
ii php7.2-zip 7.2.24-0ubuntu0.18.04.7 amd64 Zip module for PHP
ii phpmyadmin 4:4.6.6-5ubuntu0.5 all MySQL web administration tool
3 và dpkg -l | grep php | tee packages.txt
8 nếu được nhắcKhởi động lại Apache
dpkg -l | grep php | tee packages.txt
16. Cài đặt phần mở rộng PHP 8
Lệnh bên dưới bao gồm một số tiện ích mở rộng PHP phổ biến nhất, bao gồm một trang web WordPress điển hình. Tuy nhiên, nếu bạn thấy rằng một số tiện ích mở rộng bị thiếu, hãy tham khảo Bước 1 ở trên và cài đặt các gói bạn yêu cầu theo cách thủ công