Knowledge base
1000 FAQs, 500 tutorials and instructional videos. Here, there are only solutions!
Use a Perl or Python script
This guide details the use of Perl or Python scripts on Infomaniak hosting and the management of their modules.
Prerequisites
- Shared Web Hosting: the CGI module is no longer available; therefore, running Perl and Python scripts is not supported.
- It is necessary to migrate to a Cloud Server.
- Managed Cloud Servers: to benefit from the latest technologies, it is possible to upgrade your Cloud Server.
Web Configuration (Apache/CGI)
To run Python or Perl scripts via Apache on a Cloud Server, the interpretation of files with the .py and .pl extensions is not enabled by default.
Using your FTP software/client or the Web FTP, add and adapt the following directive to the .htaccess file located in the folder containing your scripts:
AddHandler cgi-script .pl .cgi .py
Options +ExecCGI
Installing additional modules
On a Cloud Server, you have the option to install third-party libraries that are not included by default.
Python
- Installation is done via
PIP, which is a package manager used to install and manage packages written in Python. - Infomaniak offers
PIPandPIP3via the Fast Installer tool. - Once PIP is installed, you can install Python modules by specifying
--userwhen running the command. For example: pip3 install mysql-connector-python --user
Perl
- Perl modules can also be added via SSH (console). They need to be installed in the user directory, and their full path must be defined within the scripts.
Important technical information
- Interpreter path:
/usr/bin/python - Extensions: Scripts must have the
.pl,.cgi, or.pyextension. - Limitations: The
mod_pythonmodule is not supported.
Troubleshooting (CGIWrap)
If you encounter the following error when uploading an image:
CGIWrap Error: Execution of this script not permitted
Request Data:Extra Path Info: /dossier/.../image.PL.12.34.gifThe server interprets the file as a script because it contains ".PL" (or .PY) in its name. Solution: Simply rename the file to remove this extension (example: image-12-34.gif).
Link to this FAQ: https://faq.infomaniak.com/1307
Has this FAQ been helpful?