ILIAS 9 for Ubuntu 22.04

General PHP config

  • Because of the fact that the can switch between several PHP versions we have also several files called php.ini
  • The php.ini is the central control file for PHP
  • Lets have a look what we have got:
    • ls /etc/php
  • In my case:
    • 7.1  7.4  8.0  8.2  8.3
  • Remeber. We can switch the PHP version using:
    • update-alternatives --config php
  • Everytime you switch you have to check the accoirding php.ini
  • Here we configure PHP8.2:
cd /etc/php/8.2/apache2
sudo -u www-data mkdir /opt/iliasdata/sessions
mv php.ini php.ini.ori
nano php.ini
  • Paste this in, save and exit:
; Maximum allowed script execution time (e.g., for large file uploads/downloads)
max_execution_time = 3600
output_buffering = 4096
 
; Maximum number of input variables (useful for large forms)
max_input_vars = 10000
 
; Maximum amount of memory a script may consume
memory_limit = 2G
 
; Maximum size of POST data (e.g., for file uploads)
post_max_size = 1G
 
; Maximum file size for uploaded files
upload_max_filesize = 1G
 
; Error reporting settings for better security in production environments
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE
display_errors = Off
 
; Session handling settings
session.gc_probability = 1
session.gc_divisor = 100
session.gc_maxlifetime = 14400
session.hash_function = 0
session.cookie_httponly = On
session.cookie_secure = On
session.save_handler = files
 
; Allow opening URLs (important for certain functionalities in ILIAS)
allow_url_fopen = 1
 
; OPcache settings for better performance
opcache.enable = 1
opcache.enable_cli = 0
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 20000
opcache.memory_consumption = 256
opcache.save_comments = 1
opcache.revalidate_freq = 1
 
apc.enabled = 1
apc.shm_size = 1024M ; Beibehalten – gut für große ILIAS-Installationen
apc.ttl = 3600 ; Bietet eine gute Balance zwischen Cache-Hit-Rate und Speicherverbrauch
apc.ttl_max = 7200 ; Setzen, um eine maximale Lebensdauer von Cache-Elementen zu definieren
apc.enable_cli = Off
apc.gc_ttl = 1800 ; Verhindert Speicherfragmentierung durch alte Einträge
apc.entries_hint = 16384 ; Beibehalten – gute Anzahl für eine große Anzahl von Cache-Einträgen
apc.slam_defense = On
apc.serializer = php ; Beibehalten – stabiler als igbinary für ILIAS
apc.mmap_file_mask = "/tmp/apc.XXXXXX" ; Beibehalten – stabil für Memory-Mapping
apc.use_request_time = On ; Beibehalten – verhindert Cache-Inkonsistenzen
apc.lazy_classes = 1 ; Reduziert Speicherverbrauch durch verzögertes Laden von Klassen
apc.lazy_functions = 1 ; Reduziert Speicherverbrauch durch verzögertes Laden von Funktionen
 
 
; Logging settings to improve debugging (optional, adjust as needed)
log_errors = On
session_save_path="/opt/iliasdata/sessions"
error_log="/opt/iliasdata/log/php_error.log"
systemctl restart apache2
  • Repeat this for all PHP versions you could use. Its to simple to forget this.
  • If the folder apache2 does not exist, just create it by yourselfe!
cp php.ini /etc/php/8.3/apache2/
 
cp: cannot create regular file '/etc/php/8.3/apache2/': No such file or directory
 
mkdir -p /etc/php/8.3/apache2/


No comment has been posted yet.