如何为 Laravel 安装所有必需的 PHP 扩展? [英] How to install all required PHP extensions for Laravel?

查看:25
本文介绍了如何为 Laravel 安装所有必需的 PHP 扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要制作我的 Ubuntu 16.04.有没有办法使用 GUI 或者是使用终端来执行此操作的最简单方法?

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?

我已经安装了 PHP 7.1、MariaDB.

I have already installed PHP 7.1, MariaDB.

我需要启用:

  1. OpenSSL PHP 扩展
  2. PDO PHP 扩展
  3. Mbstring PHP 扩展
  4. Tokenizer PHP 扩展
  5. XML PHP 扩展

推荐答案

Laravel 服务器要求 提到BCMathCtypeJSONMbstringOpenSSLPDOTokenizerXML 扩展是必需的.大多数扩展程序默认安装并启用.

Laravel Server Requirements mention that BCMath, Ctype, JSON, Mbstring, OpenSSL, PDO, Tokenizer, and XML extensions are required. Most of the extensions are installed and enabled by default.

您可以在 Ubuntu 中运行以下命令以确保安装了扩展.

You can run the following command in Ubuntu to make sure the extensions are installed.

sudo apt install openssl php-common php-curl php-json php-mbstring php-mysql php-xml php-zip

特定于 PHP 版本的安装(如果安装了 PHP 7.4)

PHP version specific installation (if PHP 7.4 installed)

sudo apt install php7.4-common php7.4-bcmath openssl php7.4-json php7.4-mbstring

您的 Composer 包可能需要其他 PHP 扩展.从下面的链接中查找.

You may need other PHP extensions for your composer packages. Find from links below.

PHP 扩展,适用于 Ubuntu 20.04 LTS (Focal Fossa)

PHP extensions for Ubuntu 20.04 LTS (Focal Fossa)

PHP 扩展,适用于 Ubuntu 18.04 LTS(仿生)

PHP extensions for Ubuntu 18.04 LTS (Bionic)

PHP 扩展,适用于 Ubuntu 16.04 LTS (Xenial)

PHP extensions for Ubuntu 16.04 LTS (Xenial)

这篇关于如何为 Laravel 安装所有必需的 PHP 扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆