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?

忘備録-Dockerコンテナでphp.iniの変更を反映する-

Last updated at Posted at 2025-08-08

Dockerコンテナ内でphp.iniの内容を変更する機会があったため忘備録として記録に残そうと思います。

コンテナ内のphp.iniの設定を反映させるための手順

1. php.iniに設定を追加

;メモリ使用量の上限
memory_limit = 256M

2. docker compose build --no-cacheコマンドでビルドする

$ docker compose build --no-cache
[+] Building 60.2s (14/14) FINISHED                                                                                                                                 docker:desktop-linux
 => [php internal] load build definition from Dockerfile                                                                                                                            0.0s
 => => transferring dockerfile: 835B                                                                                                                                                0.0s
 => [php internal] load metadata for docker.io/library/php:8.1-fpm    

3. docker-compose up -dコマンドで起動する

$ docker-compose up -d           
[+] Running 3/3
 ✔ Container docker-db-1     Started                                                                                                                                        0.0s 
 ✔ Container docker-php-1    Started                                                                                                                                        1.7s 
 ✔ Container docker-nginx-1  Started                                                                                                                                        1.7s 

4. メモリ容量設定を確認する

$ php -i | grep memory_limit
memory_limit => 256M => 256M

告知

最後にお知らせとなりますが、イーディーエーでは一緒に働くエンジニアを
募集しております。詳しくは採用情報ページをご確認ください。

みなさまからのご応募をお待ちしております。

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?