
When installing a web application on a Synology NAS for a client, I had a problem with making changes to PHP. And as I struggled to find the solution, I share with you the solution!
I have an ongoing project with a client implementing a web app on a self-hosted NAS. This is vtigerCRM , product of which I already spoke by precisely exposing the installation on a Synology NAS . Only at the installation, the assistant informs me that PHP parameters do not correspond to the prerequisites.
PHP settings
When installing the vtigerCRM product , (on PHP version 5.6.31), I get the following warnings:

In order to meet the prerequisites of the software, you must make the requested changes to the PHP config on the NAS. By means of the PHP parameter modification tool (in WebStation), even after reboot of the PHP package and the web server, then the NAS, the changes were not taken into account.
Well, I say to myself "No big deal, I'm going to put my hands in the grease by manually modifying the file php.ini".
To do this, you must first enable SSH on your Synology NAS.
Then you must connect to your NAS in SSH (via PuTTY or WinSCP for example). You must use a member account of the administrators group, the only one that has the rights to the SSH and Telnet service.

Once connected, I search the file php.ini , and there I find several:
As I am not really comfortable with the management of a web server, and suddenly with all php packages, I simply decide to make a change to each of these files, restart the PHP package and the server web every time, to find in which of these files my installer will look for PHP conf.
For this, it will use the editor vi , the old! Modify the parameter lines exposed by the vtiger installer, and save. (because I am a nice guy, remember that i can switch to insert mode, escape from command mode, and : wq to go out and save.For this specific need, under vim, you should get by with these commands ). Run viwith sudo to have the modification rights.
Only none of these files seem to be taken into account ... But I finally found a solution.
INI directory configuration file
It seems that since the version of PHP 5.3 we can create a directory config file, which takes priority to the main php.ini file the parameters specified therein.
You must enter these commands:
You create a custom config file.
Then specify the following parameter in this file:
You must now create the hidden file .user.ini and fill it with the settings you want to modify for PHP. Here is the config I wanted to set up for my installation of VtigerCRM :

In order for this configuration to be taken into account, it will be necessary to stop and restart the PHP package (and beforehand all the dependent packages, as here in this case VtigerCRM, but the PHP package wizard will specify it).
This solution may not be perfect, and if you have an explanation to change all that simply (by the GUI example!) I am a taker! (The comments are there to exchange!)
But I also think that this solution, coming "above" the main php.ini file, allows to set the specific parameters, which will not a priori not be crushed by a rise in minor version PHP or an upgrade of DSM.
But I also think that this solution, coming "above" the main php.ini file, allows to set the specific parameters, which will not a priori not be crushed by a rise in minor version PHP or an upgrade of DSM.
In any case, it works!
No comments