1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Use Perl or Python scripts
This guide details the use of Perl or Python scripts on sites hosted by Infomaniak.
Run Perl and Python scripts
For security reasons, the use of the Perl & Python language via Apache (and therefore by the CGID module) has been disabled.
Therefore, the execution of these scripts is not possible via Apache with a shared web hosting offer.
Solutions
There are other ways to run Perl and Python scripts, such as running from the command line or through other hosting offerings:
- Perl & Python remain usable in SSH and via PHP commands which launch executables (exec, shell_exec, etc.) with all our paid hosting offers
- CGIWrap is a program that allows you to run CGI scripts as a normal system user, rather than as the Apache user. This can improve security by limiting the permissions of CGI scripts. Python is available for use via CGI, the CGIWrap has been patched to allow the use of the .py extension in addition to .cgi and .pl.
- change your offer to a Cloud Server offer if you are currently on shared web hosting; this is done transparently and everything is detailed in this practical guide
Details
- The location (path) of the python interpreter is /usr/bin/python
- mod_python is not supported
- Running scripts without the pl or cgi extension is not possible however a .pl file may exist and be called via a URL without the extension
If you get the following error message:
CGIWrap Error: Execution of this script not permitted
Execution of that script is not permitted for the following reason:
(1) Script file not found.
Request Data:Extra Path Info: /dossier/wwwdata/collection/vignettes/blabla.PL.12.34.56.gif
while the loaded file is a simple GIF image with a file name of type "blabla.PL.12.34.56.gif" this comes from the name of the files in question. To work around the problem, simply rename your files.