Skip to content

Commit a307747

Browse files
committed
PHP7.1に対応, index.php に phpinfoを追加
1 parent f5d916a commit a307747

File tree

7 files changed

+30
-2
lines changed

7 files changed

+30
-2
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,17 @@ Stop:
3636
$ docker-compose stop
3737
```
3838

39+
## Switch PHP Version 5.6
40+
41+
You can switch PHP version 5.6.
42+
43+
If you want to use PHP 5.6, write below on `docker-compose.yml`.
44+
45+
```diff
46+
< build: ./php-fpm71
47+
> build: ./php-fpm56
48+
```
49+
3950
## License
4051

4152
This software is released under the MIT License, see [LICENSE](https://github.com/koni/docker-php-nginx-mysql-memcached/blob/master/LICENSE).

docker/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ services:
3535
container_name: nginx
3636

3737
web:
38-
build: ./php-fpm
38+
build: ./php-fpm71
39+
# build: ./php-fpm56 <- if you want to use PHP5.6
3940
volumes:
4041
- ../:/var/www/html
4142
links:
File renamed without changes.
File renamed without changes.

docker/php-fpm71/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM php:7.1.9-fpm
2+
3+
ADD php.ini /usr/local/etc/php/conf.d/php.ini
4+
5+
RUN apt-get update \
6+
&& docker-php-ext-install pdo_mysql mysqli mbstring
7+
8+
RUN apt-get update \
9+
&& apt-get install -y libmemcached-dev zlib1g-dev \
10+
&& pecl install memcached-3.0.3 \
11+
&& docker-php-ext-enable memcached opcache

docker/php-fpm71/php.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
date.timezone = "Etc/Utc"
2+
3+
opcache.revalidate_freq=0

public/index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@
2121

2222
var_dump($result);
2323

24-
mysqli_close($mysql);
24+
mysqli_close($mysql);
25+
26+
phpinfo();

0 commit comments

Comments
 (0)