If it's been a while since you installed php on your NAS, here are some instructions. First, go to the package center.
Type php in the search bar and press enter. When the programs appear, select install php 7.2 or the newest version.
If you have more than one volume available, select the volume to use, which is usually volume one. Select the check box if you want future installs loaded on the volume and select next.
A confirmation screen appears showing the actions to be performed. If everything is correct select apply.
Once the installation is complete, return to the menu and select web station.
The web station status page displays programs that can be configured and used for web station.
Select General Settings. These are settings applied to programs running in the web folder. There is an option to enable personal websites for users of your NAS. I do not recommend using this option because it only runs on Apache 2.2 and php 5.6. Support for Apache 2.2 ended Jan 1, 2018. Support for php 5.6 ended Jan 1, 2019.
Select the back-end server you want to run. If you are going to run WordPress or another program requiring Apache, select Apache 2.4. You can select nginx but it requires setting up configuration files in the NAS. If you are not familiar with setting up linux configuration files select Apache. If you have not setup any versions of php you will be unable to make a selection. If the pull-down selection displays Not configured, select php settings.
Selecting create allows you to create unique profiles for php. You can create more than one profile for the same version of php that only use modules required for a specific website.
After selecting create, the General Settings tab appears. Select the version of php you want to setup from the pull-down menu.
Enter a unique Profile name and Description. To use multiple profiles, for different websites, make each profile name and description different. Be sure to pick names you can easily identify. Enabling php cache allows php to compile code without execution, making the process faster. You may want to enable display errors if you are writing code or think there are issues on your website. Check the box under extensions, which enables ALL extensions.
Scroll down the extension list and uncheck any extensions that are not needed. For example, if you are using MariaDB DO NOT disable any MYSQL extensions but you do not need the PDO_DBLIB extension for Mirosoft servers, PDO_PGSQL and pgsql for PostgreDQL databases or PDO_SQLITE and sqlite3 for SQLite databases.
If you want to use an error log select the core tab. Scroll down to error_log and enter the path and file name you want to use. If you are using multiple profiles make sure the file name or folder is unique.
Return to the General tab, confirm all entries are correct and then press OK. Repeat this procedure for each version of php and profile you want to create.
When complete return to General Settings. Select php and the php profiles you created will appear in the pull-down. Select the version you want to use for the web folder. When finished select apply.
Open File Station and create the log folder for the php error file(s). Make sure the path is the same as the one you entered in the php core. Select OK to create the folder.
If you are using virtual hosts, you can use a unique profile for each one, if needed. In any case, make sure your program is compatible with the version of php specified for the host. Some older programs may not be compatible with php 7.0 or php 7.2 which will generate errors.
Upgrading php on a Synology NAS
1 post • Page 1 of 1
- Posts: 134
- Joined: Sun Oct 01, 2017 3:08 pm
1 post • Page 1 of 1