Modifying mysqli.reconnect value

by dgildelaig ‎06-26-2018 12:08 AM - edited ‎06-26-2018 12:13 AM (7,833 Views)

 

Expedition uses PHP to perform the backend actions. Some of those require interactions with MariaDB databases and use mysqli as a driver to connect to these databases.

 

In order to ensure that connections to the database are alive, we want to modify one of the PHP System parameters that allows reconnections to the database once those are lost.

 

Open a terminal to Expedition and edit the following files:

 

1- php.ini for Apache

Edit the php.ini file for Apache with the following command

sudo nano /etc/php/7.0/apache2/php.ini

change (you can use the Search feature with ^W)

mysqli.reconnect = Off

to

mysqli.reconnect = On

Write the changes with ^O and exit nano with ^X

 

 

2- php.ini for CLI

Edit the php.ini file for Apache with the following command

sudo nano /etc/php/7.0/cli/php.ini

change (you can use the Search feature with ^W)

mysqli.reconnect = Off

to

mysqli.reconnect = On

 Write the changes with ^O and exit nano with ^X

 

 

3- Apply the changes

Once the changes are done, apply them by

sudo service apache2 restart

Comments
by dgildelaig
on ‎07-23-2018 03:35 AM

Did you modify the file

/etc/php/7.0/apache2/php.ini

or could it be that you only modified

/etc/php/7.0/cli/php.ini?

Some information about the process at
https://live.paloaltonetworks.com/t5/Expedition-Articles/Modifying-mysqli-reconnect-value/ta-p/21922...

 

by bagherib
on ‎10-30-2018 05:54 AM

I have modifed this file and saved it yet it still shows red when I load Expedition.  This is my only remaining red X on the introduction page.  I'm on version 1.0.107.

by alestevez
on ‎11-07-2018 09:00 AM

Have you restarted apache?

 

sudo systemctl restart apache2
by bagherib
on ‎11-07-2018 12:05 PM

I ended up going back to my snapshot right after I upgraded to 1.0.107.  Then I went back to edit the failes with Nano and this time I went to the "Off" and backspaced three times and typed "On".  Saved it and exited and restared the entire appliance and this time I have 100% green.   Not sure what happened.  Before when I edited it showed "On" but was not working.  I did it again with the process above and it worked.


Thanks,

Bob

Ask Questions Get Answers Join the Live Community
Contributors