如何为 Laravel 安装所有必需的 PHP 扩展?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40815984/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install all required PHP extensions for Laravel?
提问by pvaitonis
I need to make my Ubuntu 16.04. Is there a way using the GUI or is the simplest way to do this by using terminal?
我需要制作我的 Ubuntu 16.04。有没有办法使用 GUI 或者是使用终端来做到这一点的最简单方法?
I have already installed PHP 7.1, MariaDB.
我已经安装了 PHP 7.1,MariaDB。
I need to enable:
我需要启用:
- OpenSSL PHP Extension
- PDO PHP Extension
- Mbstring PHP Extension
- Tokenizer PHP Extension
- XML PHP Extension
- OpenSSL PHP 扩展
- PDO PHP 扩展
- Mbstring PHP 扩展
- 分词器 PHP 扩展
- XML PHP 扩展
回答by Madan Sapkota
Laravel Server Requirementsmentions that BCMath
, Ctype
, JSON
, Mbstring
, OpenSSL
, PDO
, Tokenizer
and XML
extensions are required. Most of the extensions are installed and enabled by default.
Laravel服务器要求提到BCMath
,Ctype
,JSON
,Mbstring
,OpenSSL
,PDO
,Tokenizer
和XML
需要扩展。默认情况下,大多数扩展都已安装并启用。
You can run the following command in Ubuntu to make sure the extensions are installed.
您可以在 Ubuntu 中运行以下命令以确保安装了扩展。
sudo apt install openssl php-common php-curl php-json php-mbstring php-mysql php-xml php-zip
PHP version specific installation (if PHP 7.4 installed)
PHP 版本特定安装(如果安装了 PHP 7.4)
sudo apt install php7.4-common php7.4-bcmath openssl php7.4-json php7.4-mbstring
You may need other PHP extensions for your composer packages. Find from links below.
您的 Composer 包可能需要其他 PHP 扩展。从下面的链接中查找。
PHP extensionsfor Ubuntu 16.04 LTS (Xenial)
适用于 Ubuntu 16.04 LTS (Xenial) 的PHP 扩展
PHP extensionsfor Ubuntu 18.04 LTS (Bionic)
适用于 Ubuntu 18.04 LTS (Bionic) 的PHP 扩展