- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Enhanced Security Measures in Place: To ensure a safer experience, we’ve implemented additional, temporary security measures for all users.
on 06-26-2018 12:08 AM - edited on 10-07-2019 08:40 AM by Retired Member
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:
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
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
Once the changes are done, apply them by
sudo service apache2 restart
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...
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
Hello World,
The 'one liner' below - bold text - worked well for me and was a quick and easy way to update both files in one easy swoop. This is using the substitution function 's' in sed (stream editor) with a global replace parameter 'g'. Technically, this is two commands (one for each file) separated by a semicolon.
The ^W command in nano was causing issues for me as I had my VM in a browser, and ^W would close my browser tab instead of do a search in nano. Don't forget to restart Apache afterwards! 🙂
sed -i 's/mysqli.reconnect = Off/mysqli.reconnect = On/g' /etc/php/7.0/apache2/php.ini; sed -i 's/mysqli.reconnect = Off/mysqli.reconnect = On/g' /etc/php/7.0/cli/php.ini