PhpSysInfo is a PHP-based system information tool that displays information about your server including hardware, operating system, and software details. It provides a web-based interface for viewing system statistics.
| File/Directory | Path | Purpose |
|---|---|---|
| Main config | /var/www/html/phpsysinfo/config.php |
Main configuration |
| Config template | /var/www/html/phpsysinfo/config.php.new |
Configuration template |
| Plugins | /var/www/html/phpsysinfo/plugins/ |
Plugin directory |
| Templates | /var/www/html/phpsysinfo/templates/ |
UI templates |
| Language files | /var/www/html/phpsysinfo/lang/ |
Translations |
| Web config | /etc/nginx/sites-available/phpsysinfo |
Nginx configuration |
<?php
// /var/www/html/phpsysinfo/config.php
// Prevent direct access
defined('PSI_ROOT_PATH') or die('Direct access not permitted');
/*
* ============================================================================
* GENERAL SETTINGS
* ============================================================================
*/
// Default language
define('PSI_DEFAULT_LANGUAGE', 'en');
// Supported languages
define('PSI_SUPPORTED_LANGUAGES', 'en,de,fr,es,it,pt,ru,zh,ja,ko');
// Default template
define('PSI_DEFAULT_TEMPLATE', 'bootstrap');
// Supported templates
define('PSI_SUPPORTED_TEMPLATES', 'bootstrap,original,metal,plastic');
// Timezone
define('PSI_TIMEZONE', 'UTC');
// Date format
define('PSI_DATE_FORMAT', 'Y-m-d H:i:s');
/*
* ============================================================================
* SYSTEM SETTINGS
* ============================================================================
*/
// Hostname override
define('PSI_HOSTNAME', '');
// Display hostname
define('PSI_DISPLAY_HOSTNAME', true);
// Display IP address
define('PSI_DISPLAY_IP', true);
// Display kernel version
define('PSI_DISPLAY_KERNEL', true);
// Display OS version
define('PSI_DISPLAY_OS', true);
// Display uptime
define('PSI_DISPLAY_UPTIME', true);
// Display load average
define('PSI_DISPLAY_LOAD', true);
// Display CPU information
define('PSI_DISPLAY_CPU', true);
// Display memory information
define('PSI_DISPLAY_MEMORY', true);
// Display filesystem information
define('PSI_DISPLAY_FILESYSTEM', true);
// Display network information
define('PSI_DISPLAY_NETWORK', true);
// Display hardware information
define('PSI_DISPLAY_HARDWARE', true);
// Display devices
define('PSI_DISPLAY_DEVICES', true);
// Display processes
define('PSI_DISPLAY_PROCESSES', true);
// Display process count
define('PSI_DISPLAY_PROCESS_COUNT', true);
/*
* ============================================================================
* HARDWARE SETTINGS
* ============================================================================
*/
// Display CPU details
define('PSI_CPU_DETAIL', true);
// Display CPU temperature
define('PSI_CPU_TEMP', false);
// Display CPU frequency
define('PSI_CPU_FREQUENCY', true);
// Display memory details
define('PSI_MEMORY_DETAIL', true);
// Display swap
define('PSI_DISPLAY_SWAP', true);
// Display cache
define('PSI_DISPLAY_CACHE', true);
// Display buffers
define('PSI_DISPLAY_BUFFERS', true);
/*
* ============================================================================
* FILESYSTEM SETTINGS
* ============================================================================
*/
// Filesystem mount points to display
define('PSI_FILESYSTEM_MOUNT_POINTS', '/, /home, /var, /data');
// Filesystem types to exclude
define('PSI_FILESYSTEM_EXCLUDE_TYPES', 'tmpfs,devtmpfs,overlay,squashfs,proc,sysfs');
// Filesystem mount points to exclude
define('PSI_FILESYSTEM_EXCLUDE_MOUNTS', '/proc,/sys,/dev,/run');
// Display filesystem usage bar
define('PSI_FILESYSTEM_USAGE_BAR', true);
// Display filesystem inodes
define('PSI_FILESYSTEM_INODES', true);
// Display filesystem I/O
define('PSI_FILESYSTEM_IO', false);
// Filesystem threshold for warning (percentage)
define('PSI_FILESYSTEM_WARNING_THRESHOLD', 80);
// Filesystem threshold for critical (percentage)
define('PSI_FILESYSTEM_CRITICAL_THRESHOLD', 90);
/*
* ============================================================================
* NETWORK SETTINGS
* ============================================================================
*/
// Network interfaces to display
define('PSI_NETWORK_INTERFACES', 'eth0,enp0s3,ens18');
// Network interfaces to exclude
define('PSI_NETWORK_EXCLUDE_INTERFACES', 'lo,docker,veth,br-');
// Display network traffic
define('PSI_NETWORK_TRAFFIC', true);
// Display network errors
define('PSI_NETWORK_ERRORS', false);
// Display network speed
define('PSI_NETWORK_SPEED', true);
// Network unit (bits, bytes, auto)
define('PSI_NETWORK_UNIT', 'auto');
/*
* ============================================================================
* PROCESS SETTINGS
* ============================================================================
*/
// Maximum processes to display
define('PSI_PROCESS_MAX_COUNT', 20);
// Process sort order (cpu, memory, name, pid)
define('PSI_PROCESS_SORT_ORDER', 'cpu');
// Display process user
define('PSI_PROCESS_DISPLAY_USER', true);
// Display process PID
define('PSI_PROCESS_DISPLAY_PID', true);
// Display process CPU
define('PSI_PROCESS_DISPLAY_CPU', true);
// Display process memory
define('PSI_PROCESS_DISPLAY_MEMORY', true);
// Display process command
define('PSI_PROCESS_DISPLAY_COMMAND', true);
// Display process status
define('PSI_PROCESS_DISPLAY_STATUS', true);
// Process names to exclude
define('PSI_PROCESS_EXCLUDE_NAMES', 'ps,php,apache,nginx');
/*
* ============================================================================
* SENSOR SETTINGS
* ============================================================================
*/
// Enable sensors
define('PSI_SENSORS_ENABLED', false);
// Display temperature
define('PSI_SENSORS_TEMP', true);
// Display fan speed
define('PSI_SENSORS_FANS', false);
// Display voltage
define('PSI_SENSORS_VOLTAGE', false);
// Sensor chips to monitor
define('PSI_SENSORS_CHIPS', '');
// Temperature threshold for warning
define('PSI_SENSORS_TEMP_WARNING', 70);
// Temperature threshold for critical
define('PSI_SENSORS_TEMP_CRITICAL', 85);
/*
* ============================================================================
* UPS SETTINGS
* ============================================================================
*/
// Enable UPS monitoring
define('PSI_UPS_ENABLED', false);
// UPS command (apcaccess)
define('PSI_UPS_COMMAND', '/usr/sbin/apcaccess');
/*
* ============================================================================
* RAID SETTINGS
* ============================================================================
*/
// Enable RAID monitoring
define('PSI_RAID_ENABLED', false);
// RAID command
define('PSI_RAID_COMMAND', '/usr/bin/cat /proc/mdstat');
/*
* ============================================================================
* DOCKER SETTINGS
* ============================================================================
*/
// Enable Docker monitoring
define('PSI_DOCKER_ENABLED', false);
// Docker socket
define('PSI_DOCKER_SOCKET', '/var/run/docker.sock');
// Display containers
define('PSI_DOCKER_CONTAINERS', true);
// Display images
define('PSI_DOCKER_IMAGES', false);
// Display volumes
define('PSI_DOCKER_VOLUMES', false);
/*
* ============================================================================
* PLUGIN SETTINGS
* ============================================================================
*/
// Enable plugins
define('PSI_PLUGINS_ENABLED', true);
// Enabled plugins
define('PSI_PLUGINS', 'psstatus,upstime,quotas');
// Plugin directory
define('PSI_PLUGIN_PATH', PSI_ROOT_PATH . '/plugins');
/*
* ============================================================================
* SECURITY SETTINGS
* ============================================================================
*/
// Enable authentication
define('PSI_AUTH_ENABLED', false);
// Authentication type (basic, htpasswd)
define('PSI_AUTH_TYPE', 'basic');
// Basic auth username
define('PSI_AUTH_USERNAME', 'admin');
// Basic auth password (hashed)
define('PSI_AUTH_PASSWORD', password_hash('AdminPassword123!', PASSWORD_DEFAULT));
// IP whitelist (comma-separated)
define('PSI_IP_WHITELIST', '127.0.0.1,::1');
// IP blacklist (comma-separated)
define('PSI_IP_BLACKLIST', '');
/*
* ============================================================================
* PERFORMANCE SETTINGS
* ============================================================================
*/
// Enable caching
define('PSI_CACHE_ENABLED', true);
// Cache lifetime (seconds)
define('PSI_CACHE_LIFETIME', 30);
// Cache directory
define('PSI_CACHE_PATH', PSI_ROOT_PATH . '/cache');
/*
* ============================================================================
* LOGGING SETTINGS
* ============================================================================
*/
// Enable logging
define('PSI_LOG_ENABLED', false);
// Log file
define('PSI_LOG_FILE', '/var/log/phpsysinfo/phpsysinfo.log');
// Log level (DEBUG, INFO, WARNING, ERROR)
define('PSI_LOG_LEVEL', 'INFO');
/*
* ============================================================================
* UI SETTINGS
* ============================================================================
*/
// Page title
define('PSI_PAGE_TITLE', 'PhpSysInfo');
// Show refresh button
define('PSI_SHOW_REFRESH', true);
// Auto refresh interval (seconds)
define('PSI_AUTO_REFRESH', 30);
// Show footer
define('PSI_SHOW_FOOTER', true);
// Footer text
define('PSI_FOOTER_TEXT', 'PhpSysInfo');
// Show generated time
define('PSI_SHOW_GENERATED', true);
// Show PHP version
define('PSI_SHOW_PHP_VERSION', false);
// Custom CSS
define('PSI_CUSTOM_CSS', '');
// Custom JavaScript
define('PSI_CUSTOM_JS', '');
/*
* ============================================================================
* API SETTINGS
* ============================================================================
*/
// Enable API
define('PSI_API_ENABLED', true);
// API endpoint
define('PSI_API_ENDPOINT', '/api');
// API authentication
define('PSI_API_AUTH', false);
// API key
define('PSI_API_KEY', 'your-api-key-here');
# /etc/nginx/sites-available/phpsysinfo
server {
listen 80;
server_name phpsysinfo.example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
server_name phpsysinfo.example.com;
# SSL configuration
ssl_certificate /etc/letsencrypt/live/phpsysinfo.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/phpsysinfo.example.com/privkey.pem;
# Security headers
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-XSS-Protection "1; mode=block" always;
# Root directory
root /var/www/html/phpsysinfo;
index index.php;
# Logging
access_log /var/log/nginx/phpsysinfo.access.log;
error_log /var/log/nginx/phpsysinfo.error.log;
# PHP processing
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass unix:/var/run/php/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
}
# Static files
location ~* \.(js|css|png|jpg|gif|ico|svg|woff|woff2)$ {
expires 30d;
add_header Cache-Control "public, immutable";
}
# Deny access to sensitive files
location ~ /\. {
deny all;
}
location ~* /(config\.php|\.git) {
deny all;
}
}
# Check PHP syntax
php -l /var/www/html/phpsysinfo/config.php
# Test configuration
php /var/www/html/phpsysinfo/phpsysinfo.php --test
# Check system access
php /var/www/html/phpsysinfo/phpsysinfo.php --info
# Restart PHP-FPM
sudo systemctl restart php-fpm
# Restart Nginx
sudo systemctl restart nginx
# Check status
sudo systemctl status nginx
sudo systemctl status php-fpm
# Clear cache
rm -rf /var/www/html/phpsysinfo/cache/*
# Set cache permissions
chown -R www-data:www-data /var/www/html/phpsysinfo/cache
chmod -R 755 /var/www/html/phpsysinfo/cache
# Access web interface
curl http://localhost/phpsysinfo/
# Check API
curl http://localhost/phpsysinfo/api/system
# Check JSON output
curl http://localhost/phpsysinfo/index.php?json
# Test system information access
php /var/www/html/phpsysinfo/includes/os/Linux.php
# Check sensor access
cat /sys/class/thermal/thermal_zone0/temp
Squeezing every bit of performance from your phpSysInfo installation? Our experts help with:
Optimize your setup: office@linux-server-admin.com | Contact Us