PHP 7.1 How to disable unused DB resources?

1

In php 7.1 the php.ini (Locaweb original) configuration contains several BD commands that I do not use.

I only use Mysql with PDO.

What can be disabled in php.ini and how to do it?

Below php.ini only with the lines referring to DBs.

[SQL]
sql.safe_mode = Off

[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1

[MySQL]
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off

[MySQLi]
mysqli.max_links = -1
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off

[mSQL]
msql.allow_persistent = On
msql.max_persistent = -1
msql.max_links = -1

[PostgresSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0

[Sybase]
sybase.allow_persistent = On
sybase.max_persistent = -1
sybase.max_links = -1
sybase.min_error_severity = 10
sybase.min_message_severity = 10
sybase.compatability_mode = Off

[Sybase-CT]
sybct.allow_persistent = On
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10

[Informix]
ifx.default_host =
ifx.default_user =
ifx.default_password =
ifx.allow_persistent = On
ifx.max_persistent = -1
ifx.max_links = -1
ifx.textasvarchar = 0
ifx.byteasvarchar = 0
ifx.charasvarchar = 0
ifx.blobinfile = 0
ifx.nullformat = 0

[MSSQL]
mssql.allow_persistent = On
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = Off
mssql.secure_connection = Off
    
asked by anonymous 06.01.2018 / 00:28

1 answer

2

It is not necessary to remove the commands, just disable the add-ons that it will not use, I made a brief explanation about this in:

So assuming you're going to use only PDO with Mysql and you're not going to use mysqli, you could comment on lines like this using ; in php.ini:

If it is Windows Server (or normal Windows):

;extension=php_mongo.dll
;extension=php_mysqli.dll
;extension=php_oauth.dll
;extension=php_oci8.dll
;extension=php_oci8_11g.dll
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_pspell.dll

If it's Unix-like:

;extension=mongo.so
;extension=mysqli.so
;extension=oauth.so
;extension=oci8.so
;extension=oci8_11g.so
extension=openssl.so
;extension=pdo_firebird.so
extension=pdo_mysql.so
;extension=pdo_oci.so
;extension=pdo_odbc.so
;extension=pdo_pgsql.so
;extension=pdo_sqlite.so
;extension=pgsql.so
;extension=pspell.so

If it's PHP7.2:

;extension=mongo
;extension=mysqli
;extension=oauth
;extension=oci8
;extension=oci8_11g
extension=openssl
;extension=pdo_firebird
extension=pdo_mysql
;extension=pdo_oci
;extension=pdo_odbc
;extension=pdo_pgsql
;extension=pdo_sqlite
;extension=pgsql
;extension=pspell

Note lines with ; will be ignored when you restart Apache (wamp, xampp, easyphp) or Ngnix, only lines without loading php extensions >

  

Note: The examples above were from my PHP which is 5.4 and 7.2, are just examples

    
06.01.2018 / 01:17