0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Laravel10に必要なPHP拡張機能の追加

Posted at

1. PHP8.1以上であること

$ php -v
PHP 8.2.10 (cli) (built: Sep  2 2023 06:59:22) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.10, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.10, Copyright (c), by Zend Technologies

2. 各種拡張機能

下記の13個の拡張機能が必要とのこと

  • Ctype PHP拡張
  • cURL PHP拡張
  • DOM PHP拡張
  • Fileinfo PHP拡張
  • Filter PHP拡張
  • Hash PHP拡張
  • Mbstring PHP拡張
  • OpenSSL PHP拡張
  • PCRE PHP拡張
  • PDO PHP拡張
  • Session PHP拡張
  • Tokenizer PHP拡張
  • XML PHP拡張

参考 https://readouble.com/laravel/10.x/ja/deployment.html

2-1. PHPで利用可能か確認する

$ php -m | egrep -i 'ctype|curl|dom|fileinfo|filter|hash|mbstring|openssl|pcre|pdo|session|tokenizer|xml'
ctype
curl
fileinfo
filter
hash
libxml
openssl
pcre
PDO
random
session
tokenizer

「curl」「dom」「mbstring」「xml」が不足しているのでそれを追加する

2-2. 「curl」「dom(xml)」「mbstring」「xml」が存在するか確認する

$ apt search php | grep -i 'curl|mbstring|xml'

2-3. 「curl」「dom(xml)」「mbstring」「xml」の追加

$ sudo apt install php8.2-curl php8.2-mbstring php8.2-xml

2-4. 2-2で実行したコマンドを再実行して必要な拡張機能が読み込まれているか確認

$ php -m | egrep -i 'ctype|curl|dom|fileinfo|filter|hash|mbstring|openssl|pcre|pdo|session|tokenizer|xml'
ctype
curl
dom
fileinfo
filter
hash
libxml
mbstring
openssl
pcre
PDO
random
session
SimpleXML
tokenizer
xml
xmlreader
xmlwriter
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?