Comments (6)
This typically happens when the right version of php is not installed. The latest versions of the cgi router in my packages is using php3.0.
Is it installed on your Synology?
from synopackages.
Thank you very much for the prompt answer. We have PHP 7.3 installed and this is what router.cgi script is using /usr/local/bin/php73-cgi
(https://github.com/vletroye/SynoPackages/blob/master/MODS%20Sample%20-%20Simple%20CGI/package/ui/router.cgi#L54).
Ist 7.3 is what you mean by php3.0? There is no PHP 3.0 package in Synology Packet Center. I see your last commit in MODS Web Console is named "Fix php page being downloaded instead of executed" and this package is working just fine with our DSM configuration. Should I apply these changes to Simple CGI?
from synopackages.
Oh yes, sorry.... I was meaning php7.3.
I just reinstalled the latest MODS_Sample_Simple_CGI.spk to be sure... and it's working fine on my Synology...
Another reason why the script is sometimes downloaded : an error during the execution.. Ex.: due to an access denied.
This can happen if the log file may not be written... : LOG="/var/log/@SYNOPKG_PKGNAME@"
Could you check that the two log files exist via ls -la /var/log
-rw-r--rw- 1 root root 333 Jan 8 18:44 MODS_Sample_Simple_CGI
-rw-r--rw- 1 root root 0 Jan 8 18:44 MODS_Sample_Simple_CGI_ERR
Notice: you may only access /var/log if your are connected as root via ssh
drwxr-x--- 16 system log 4096 Jan 8 18:44 log
The execution will also fail if the ini file does not exist: ls -la /usr/local/etc/php73/cli/php.ini
-rw-r--r-- 1 root root 8072 Oct 29 22:06 /usr/local/etc/php73/cli/php.ini
You can do a quick test. As a second line of the router.cgi, type: exit
Now, if the router.cgi is correctly called, you should see a message "Sorry, the page you are looking for is not found." instead of the getting the file downloaded
If you get the message, than the issue is with the router.cgi. Simply comment the line declaring the LOG so you won't have access issue with it.
#LOG="/var/log/@SYNOPKG_PKGNAME@"
Next, try to execute the script (index.php) directly in the console ssh:
/usr/local/bin/php73-cgi -c /usr/local/etc/php73/cli/php.ini -d open_basedir=none /var/packages/MODS_Sample_Simple_CGI/target/ui/index.php
You should get the html page:
Content-type: text/html; charset=UTF-8
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Home | Simple PHP Website</title>
etc....
if you didn't see the message "Sorry, the page you are looking for is not found." but still got the file downloaded, then the pblm is with the web server nor redirecting the call to the router.
First check that you are using Nginx and not apache, as HTTP back-end server.
If you are using Nginx, then check that the custom config of the package, for Nginx, is linked to the right location: ls -la /usr/syno/share/nginx/conf.d/dsm.MODS_Sample_Simple_CGI.conf
lrwxrwxrwx 1 root root 57 Jan 8 18:44 /usr/syno/share/nginx/conf.d/dsm.MODS_Sample_Simple_CGI.conf -> /volume1/@appstore/MODS_Sample_Simple_CGI/ui/dsm.cgi.conf
If it is there, then it seems to be not load properly. Restart first Nginx to be sure: synoservicecfg --restart nginx
If it still does not work, did you customize Nginx ? its config should load all dsm.*.conf files under /usr/syno/share/nginx/conf.d/ as you can see via: cat /etc/nginx/nginx.conf | grep syno
include /usr/syno/share/nginx/conf.d/dsm.*.conf;
If all these are fine... I would reboot at least once the Synology...
V.
from synopackages.
Another stupid trick which worked for me : clear your cache (Ex. within Chrome : your browsing data).
This is especially valid if you installed/uninstalled/re-installed the package and tried it several times...
from synopackages.
Oh, wow. Thanks for the detailed answer, I appreciate it. I'll check tomorrow and report.
from synopackages.
I had myself a lot of issues when I wrote and tested this technique with nginx ;)
from synopackages.
Related Issues (17)
- MODS Web Console - web console not found HOT 5
- MODS Package Manager - Can't open normally, it happens nothing with blank window. HOT 5
- MOD GateOne not compatible with DSM 6 HOT 7
- DS218Play not supported by MODS GateOne HOT 6
- Package is not supported on the platform of DiskStation or incompatible with current DSM version HOT 7
- MOD GateOne package - Not placing the link to launch GateOne in DSM HOT 2
- DSM 6.2.4 Authentication changes, Filebot-Runner HOT 2
- MODS package manager show a blank page XPEnology DSM6.2.2 DS918+ HOT 13
- MODS package manager not supported bij DSM 7 HOT 6
- Vulnerability warning for MODS_WebConsole
- Cannot install MODS GateOne on a DS920+ HOT 1
- MODS Gateone - How can I install it? I am novice HOT 1
- MODS GateOne default port open to all HOT 1
- MODS Package Manager, when opened,it said this page is not fount. The same as browse and else. HOT 1
- Invalid format file HOT 2
- MODS package manager show a blank page and a download window with a file of mvpkg.php in synology in DSM6.2.2 DS918+
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from synopackages.