PHP (từ viết tắt đệ quy của PHP. Bộ tiền xử lý siêu văn bản) là một ngôn ngữ kịch bản mã nguồn mở, có mục đích chung phổ biến, được sử dụng rộng rãi và phù hợp nhất để phát triển các trang web và ứng dụng dựa trên web. Đây là ngôn ngữ kịch bản phía máy chủ có thể được nhúng trong HTML Show Hiện tại, có ba phiên bản PHP được hỗ trợ, tôi. e PHP 5. 6, 7. 0 và 8. 0. Ý nghĩa của PHP 5. 3, 5. 4 và 5. 5 người đều đã hết tuổi thọ; Trong bài viết này, chúng tôi sẽ giải thích cách cài đặt tất cả các phiên bản PHP được hỗ trợ trong Ubuntu và các dẫn xuất của nó với các phần mở rộng PHP được yêu cầu nhiều nhất cho cả máy chủ web Apache và Nginx bằng cách sử dụng Ondřej Surý PPA. Chúng tôi cũng sẽ giải thích cách đặt phiên bản PHP mặc định sẽ được sử dụng trên hệ thống Ubuntu Lưu ý rằng PHP 7. x là phiên bản ổn định được hỗ trợ trong kho phần mềm Ubuntu, bạn có thể xác nhận điều này bằng cách chạy lệnh apt bên dưới $ sudo apt show php OR $ sudo apt show php -a Hiển thị thông tin phiên bản PHP Package: php Version: 1:7.0+35ubuntu6 Priority: optional Section: php Source: php-defaults (35ubuntu6) Origin: Ubuntu Maintainer: Ubuntu Developers <[email protected]> Original-Maintainer: Debian PHP Maintainers <[email protected]> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 11.3 kB Depends: php7.0 Supported: 5y Download-Size: 2,832 B APT-Sources: http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages Description: server-side, HTML-embedded scripting language (default) PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. . This package is a dependency package, which depends on Debian's default PHP version (currently 7.0). Để cài đặt phiên bản PHP mặc định từ kho phần mềm Ubuntu, hãy sử dụng lệnh bên dưới $ sudo apt install php Cài đặt PHP (5. 6, 7. x, 8. 0) trên Ubuntu bằng PPA1. Trước tiên, hãy bắt đầu bằng cách thêm Ondřej Surý PPA để cài đặt các phiên bản PHP khác nhau – PHP 5. 6, PHP7. x và PHP 8. 0 trên hệ thống Ubuntu $ sudo apt install software-properties-common $ sudo add-apt-repository ppa:ondrej/phpThêm PPA trong Ubuntu 2. Tiếp theo, cập nhật hệ thống như sau $ sudo apt-get update 3. Bây giờ hãy cài đặt các phiên bản PHP được hỗ trợ khác nhau như sau Đối với máy chủ web Apache$ sudo apt install php5.6 [PHP 5.6] $ sudo apt install php7.0 [PHP 7.0] $ sudo apt install php7.1 [PHP 7.1] $ sudo apt install php7.2 [PHP 7.2] $ sudo apt install php7.3 [PHP 7.3] $ sudo apt install php7.4 [PHP 7.4] $ sudo apt install php8.0 [PHP 8.0] Đối với máy chủ web Nginx$ sudo apt install php5.6-fpm [PHP 5.6] $ sudo apt install php7.0-fpm [PHP 7.0] $ sudo apt install php7.1-fpm [PHP 7.1] $ sudo apt install php7.2-fpm [PHP 7.2] $ sudo apt install php7.3-fpm [PHP 7.3] $ sudo apt install php7.4-fpm [PHP 7.4] $ sudo apt install php8.0-fpm [PHP 8.0] 4. Để cài đặt bất kỳ mô-đun PHP nào, chỉ cần chỉ định phiên bản PHP và sử dụng chức năng tự động hoàn thành để xem tất cả các mô-đun như sau ------------ press Tab key for auto-completion ------------ $ sudo apt install php5.6 $ sudo apt install php7.0 $ sudo apt install php7.1 $ sudo apt install php7.2 $ sudo apt install php7.3 $ sudo apt install php7.4 $ sudo apt install php8.0Tìm kiếm các mô-đun PHP 5. Bây giờ bạn có thể cài đặt các mô-đun PHP cần thiết nhất từ danh sách ________số 8_______6. Cuối cùng, xác minh phiên bản PHP mặc định được sử dụng trên hệ thống của bạn như thế này $ php -vKiểm tra phiên bản PHP mặc định trong Ubuntu Đặt phiên bản PHP mặc định trong Ubuntu7. Bạn có thể thiết lập phiên bản PHP mặc định sẽ sử dụng trên hệ thống bằng lệnh update-alternatives, sau khi thiết lập xong kiểm tra lại phiên bản PHP để xác nhận như sau Package: php Version: 1:7.0+35ubuntu6 Priority: optional Section: php Source: php-defaults (35ubuntu6) Origin: Ubuntu Maintainer: Ubuntu Developers <[email protected]> Original-Maintainer: Debian PHP Maintainers <[email protected]> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 11.3 kB Depends: php7.0 Supported: 5y Download-Size: 2,832 B APT-Sources: http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages Description: server-side, HTML-embedded scripting language (default) PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. . This package is a dependency package, which depends on Debian's default PHP version (currently 7.0).0Đặt PHP 5. 6 trong Ubuntu Package: php Version: 1:7.0+35ubuntu6 Priority: optional Section: php Source: php-defaults (35ubuntu6) Origin: Ubuntu Maintainer: Ubuntu Developers <[email protected]> Original-Maintainer: Debian PHP Maintainers <[email protected]> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 11.3 kB Depends: php7.0 Supported: 5y Download-Size: 2,832 B APT-Sources: http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages Description: server-side, HTML-embedded scripting language (default) PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. . This package is a dependency package, which depends on Debian's default PHP version (currently 7.0).1Đặt PHP 7. 0 trong Ubuntu Package: php Version: 1:7.0+35ubuntu6 Priority: optional Section: php Source: php-defaults (35ubuntu6) Origin: Ubuntu Maintainer: Ubuntu Developers <[email protected]> Original-Maintainer: Debian PHP Maintainers <[email protected]> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 11.3 kB Depends: php7.0 Supported: 5y Download-Size: 2,832 B APT-Sources: http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages Description: server-side, HTML-embedded scripting language (default) PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. . This package is a dependency package, which depends on Debian's default PHP version (currently 7.0).2Đặt PHP 7. 1 trong Ubuntu Package: php Version: 1:7.0+35ubuntu6 Priority: optional Section: php Source: php-defaults (35ubuntu6) Origin: Ubuntu Maintainer: Ubuntu Developers <[email protected]> Original-Maintainer: Debian PHP Maintainers <[email protected]> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 11.3 kB Depends: php7.0 Supported: 5y Download-Size: 2,832 B APT-Sources: http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages Description: server-side, HTML-embedded scripting language (default) PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. . This package is a dependency package, which depends on Debian's default PHP version (currently 7.0).3Đặt phiên bản PHP 8 8. Để đặt phiên bản PHP sẽ hoạt động với máy chủ web Apache, hãy sử dụng các lệnh bên dưới. Đầu tiên, tắt phiên bản hiện tại bằng lệnh a2dismod và sau đó bật phiên bản bạn muốn bằng lệnh a2enmod Package: php Version: 1:7.0+35ubuntu6 Priority: optional Section: php Source: php-defaults (35ubuntu6) Origin: Ubuntu Maintainer: Ubuntu Developers <[email protected]> Original-Maintainer: Debian PHP Maintainers <[email protected]> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 11.3 kB Depends: php7.0 Supported: 5y Download-Size: 2,832 B APT-Sources: http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages Description: server-side, HTML-embedded scripting language (default) PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. . This package is a dependency package, which depends on Debian's default PHP version (currently 7.0).4Bật Tắt các mô-đun PHP cho Apache 9. Sau khi chuyển từ phiên bản này sang phiên bản khác, bạn có thể tìm thấy tệp cấu hình PHP của mình bằng cách chạy lệnh bên dưới Package: php Version: 1:7.0+35ubuntu6 Priority: optional Section: php Source: php-defaults (35ubuntu6) Origin: Ubuntu Maintainer: Ubuntu Developers <[email protected]> Original-Maintainer: Debian PHP Maintainers <[email protected]> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 11.3 kB Depends: php7.0 Supported: 5y Download-Size: 2,832 B APT-Sources: http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages Description: server-side, HTML-embedded scripting language (default) PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. . This package is a dependency package, which depends on Debian's default PHP version (currently 7.0).5Tìm tệp cấu hình PHP Bạn cũng có thể thích
Trong bài viết này, chúng tôi đã hướng dẫn cách cài đặt tất cả các phiên bản PHP được hỗ trợ trong Ubuntu và các dẫn xuất của nó. Nếu bạn có bất kỳ câu hỏi hoặc suy nghĩ nào muốn chia sẻ, hãy làm như vậy thông qua biểu mẫu phản hồi bên dưới Làm cách nào để cài đặt phiên bản cụ thể của PHP?Nếu bạn muốn chọn phiên bản cụ thể của PHP trên một trong hai hệ thống, hãy làm theo một trong các bước cài đặt bên dưới. . Cài đặt PHP với Apache trên Ubuntu. Nếu bạn đang chạy máy chủ web Apache, hãy cài đặt PHP với mô-đun Apache. . Cài đặt PHP với Nginx trên Ubuntu. Máy chủ Nginx không có xử lý PHP gốc Cách cài đặt phiên bản PHP 7. 4 trên Windows 10?Tải xuống PHP 7. 4 từ Trang web chính thức . Trong bước đầu tiên, để cài đặt PHP 7. 4 trên Hệ điều hành Windows 10, hãy mở trình duyệt web yêu thích của bạn và điều hướng trang web chính thức của PHP. Tiếp theo, tải xuống phiên bản 64 bit Non-Thread-Safe của tệp zip Trình cài đặt PHP7 trên hệ thống của bạn.
Làm cách nào để cài đặt phiên bản PHP 8 trên Windows 10?Trong ảnh này, chúng ta sẽ thực hiện ba bước sau để cài đặt PHP 8 trên windows. . Bước 1. Lấy các tệp PHP và giải nén chúng Bước 2. cấu hình php. ban đầu Bước 3. Thêm PHP vào biến môi trường đường dẫn Cách cài đặt PHP 7. 3 trên Windows 10?Lưu tệp đã tải xuống, php-7. 3. 0-Win32-VC15-x64. . Truy cập trang web chính thức cho PHP tại php. mạng lưới Nhấp vào liên kết "tải xuống" trong menu trên cùng. Bạn thấy trang tải xuống Nhấp vào "Tải xuống Windows". Bạn thấy trang PHP For Windows |