Skip to content

Commit b1b8585

Browse files
authored
Merge pull request laradock#738 from winfried-van-loon/master
Adding option to install Php5 MySQL extension
2 parents b083124 + e861348 commit b1b8585

3 files changed

Lines changed: 73 additions & 0 deletions

File tree

env-example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ PHP_FPM_INSTALL_OPCACHE=false
4646
PHP_FPM_INSTALL_EXIF=false
4747
PHP_FPM_INSTALL_AEROSPIKE_EXTENSION=false
4848
PHP_FPM_INSTALL_MYSQLI=false
49+
PHP_FPM_INSTALL_MYSQL=false
4950
PHP_FPM_INSTALL_TOKENIZER=false
5051
PHP_FPM_INSTALL_INTL=false
5152

php-fpm/Dockerfile-56

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,20 @@ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
108108
docker-php-ext-enable memcached \
109109
;fi
110110

111+
#####################################
112+
# PHP MySQL:
113+
#####################################
114+
115+
ARG INSTALL_MYSQL=false
116+
COPY ./mysql.ini /usr/local/etc/php/conf.d/mysql.ini
117+
RUN if [ ${INSTALL_MYSQL} = true ]; then \
118+
# Install the php mysql extension
119+
docker-php-ext-install mysql && \
120+
docker-php-ext-install mysqli && \
121+
docker-php-ext-enable mysql && \
122+
docker-php-ext-enable mysqli \
123+
;fi
124+
111125
#####################################
112126
# PHP Aerospike:
113127
#####################################

php-fpm/mysql.ini

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[MySQL]
2+
; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
3+
; http://php.net/mysql.allow_local_infile
4+
mysql.allow_local_infile = On
5+
6+
; Allow or prevent persistent links.
7+
; http://php.net/mysql.allow-persistent
8+
mysql.allow_persistent = On
9+
10+
; If mysqlnd is used: Number of cache slots for the internal result set cache
11+
; http://php.net/mysql.cache_size
12+
mysql.cache_size = 2000
13+
14+
; Maximum number of persistent links. -1 means no limit.
15+
; http://php.net/mysql.max-persistent
16+
mysql.max_persistent = -1
17+
18+
; Maximum number of links (persistent + non-persistent). -1 means no limit.
19+
; http://php.net/mysql.max-links
20+
mysql.max_links = -1
21+
22+
; Default port number for mysql_connect(). If unset, mysql_connect() will use
23+
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
24+
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
25+
; at MYSQL_PORT.
26+
; http://php.net/mysql.default-port
27+
mysql.default_port =
28+
29+
; Default socket name for local MySQL connects. If empty, uses the built-in
30+
; MySQL defaults.
31+
; http://php.net/mysql.default-socket
32+
mysql.default_socket =
33+
34+
; Default host for mysql_connect() (doesn't apply in safe mode).
35+
; http://php.net/mysql.default-host
36+
mysql.default_host =
37+
38+
; Default user for mysql_connect() (doesn't apply in safe mode).
39+
; http://php.net/mysql.default-user
40+
mysql.default_user =
41+
42+
; Default password for mysql_connect() (doesn't apply in safe mode).
43+
; Note that this is generally a *bad* idea to store passwords in this file.
44+
; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
45+
; and reveal this password! And of course, any users with read access to this
46+
; file will be able to reveal the password as well.
47+
; http://php.net/mysql.default-password
48+
mysql.default_password =
49+
50+
; Maximum time (in seconds) for connect timeout. -1 means no limit
51+
; http://php.net/mysql.connect-timeout
52+
mysql.connect_timeout = 60
53+
54+
; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
55+
; SQL-Errors will be displayed.
56+
; http://php.net/mysql.trace-mode
57+
mysql.trace_mode = Off
58+

0 commit comments

Comments
 (0)