In many ways, Synology NAS is a powerful device that serves as cloud storage, personal and business server, etc. The multi-purpose system can serve as a powerful centralized hub with multiple functionalities.
Synology NAS can be used as photo cloud storage with their Synology Photo app, CCTV monitoring hud using the surveillance station, etc. For developers, it can be used as a web server for hosting webiste and other applications with the help of docker and other packages.
In this artcile, we will check how to install and activate PHP on the Synology webserver so that you can run the application from within the Synology NAS.
How to Install PHP on Synology NAS
To install PHP and run the websites from the Synology NAS, you must ensure the web station and Apache are running on your NAS. If the web station is not installed on the Synology NAS, follow the below steps.
Step 1: Open the Control Panel on your Synology NAS once logged in as the admin.
Step 2: Goto the Package Center and select All Packages from the left pane.
Step 3: Install Webstation from the list. Once the web station is installed, you can proceed further with installing the Apache Server and PHP.
Step 4: Once the web station is installed, you must install the Apache Server from the Package Center. Sometimes, you may see multiple versions of Apache; you can select the one you wish.
Step 5: Once the Apache server is installed, you can proceed further to Install the PHP.
Step 6: Like the other application, you can install the PHP from the package center. PHP is also available in multiple versions; you can install the latest one of stable PHP like PHP 7.4, etc.
Once done with the above steps, all the required applications and services for running the PHP webiste are made. However, you won’t be able to run any PHP files by placing the same in the web folder. The reason is that your PHP installation is not yet enabled for the web station.
How to Enable and Activate PHP on Synology NAS
After installing PHP, you need to do some configuration to run the PHP files or webiste on Synology NAS. If you see that the PHP files are not working on your Synology NAS, the PHP was not enabled for the webserver even after the installation. Once enabled, you can go to the files station and upload any PHP file or webiste to the web folder.
To activate PHP on Synology NAS, follow the below steps.
Step 1: From the control panel, open the web station.
Step 2: Select Scripting Language Settings from the left list.
Step 3: Under the PHP option, click on Create button.
Step 4: In the Create PHP Profile, provide a Profile name, Description and Select the Php version (the one you installed previously)
Step 5: Finally, click the Create Button to save the profile.
Step 6: Once done, you can see the PHP profile in the list.
Now, the PHP is configured successfully, and you can upload the PHP files to the web folder, and it should work without any issue.