Troubleshooting
Solutions to common problems and debugging techniques for XOOPS CMS.
📋 Quick Diagnosis
Section titled “📋 Quick Diagnosis”Before diving into specific issues, check these common causes:
- File Permissions - Directories need 755, files need 644
- PHP Version - Ensure PHP 7.4+ (8.x recommended)
- Error Logs - Check
xoops_data/logs/and PHP error logs - Cache - Clear cache in Admin → System → Maintenance
🗂️ Section Contents
Section titled “🗂️ Section Contents”Common Issues
Section titled “Common Issues”- White Screen of Death (WSOD)
- Database Connection Errors
- Permission Denied Errors
- Module Installation Failures
- Template Compilation Errors
- Installation FAQ
- Module FAQ
- Theme FAQ
- Performance FAQ
Debugging
Section titled “Debugging”- Enabling Debug Mode
- Using Ray Debugger
- Database Query Debugging
- Smarty Template Debugging
🚨 Common Issues & Solutions
Section titled “🚨 Common Issues & Solutions”White Screen of Death (WSOD)
Section titled “White Screen of Death (WSOD)”Symptoms: Blank white page, no error message
Solutions:
-
Enable PHP error display temporarily:
// Add to mainfile.php temporarilyerror_reporting(E_ALL);ini_set('display_errors', 1); -
Check PHP error log:
Terminal window tail -f /var/log/php/error.log -
Common causes:
- Memory limit exceeded
- Fatal PHP syntax error
- Missing required extension
-
Fix memory issues:
// In mainfile.php or php.iniini_set('memory_limit', '256M');
Database Connection Errors
Section titled “Database Connection Errors”Symptoms: “Unable to connect to database” or similar
Solutions:
-
Verify credentials in mainfile.php:
define('XOOPS_DB_HOST', 'localhost');define('XOOPS_DB_USER', 'your_username');define('XOOPS_DB_PASS', 'your_password');define('XOOPS_DB_NAME', 'your_database'); -
Test connection manually:
<?php$conn = new mysqli('localhost', 'user', 'pass', 'database');if ($conn->connect_error) {die("Connection failed: " . $conn->connect_error);}echo "Connected successfully"; -
Check MySQL service:
Terminal window sudo systemctl status mysqlsudo systemctl restart mysql -
Verify user permissions:
GRANT ALL PRIVILEGES ON xoops.* TO 'user'@'localhost';FLUSH PRIVILEGES;
Permission Denied Errors
Section titled “Permission Denied Errors”Symptoms: Cannot upload files, cannot save settings
Solutions:
-
Set correct permissions:
Terminal window # Directoriesfind /path/to/xoops -type d -exec chmod 755 {} \;# Filesfind /path/to/xoops -type f -exec chmod 644 {} \;# Writable directorieschmod -R 777 xoops_data/chmod -R 777 uploads/ -
Set correct ownership:
Terminal window chown -R www-data:www-data /path/to/xoops -
Check SELinux (CentOS/RHEL):
Terminal window # Check statussestatus# Allow httpd to writesetsebool -P httpd_unified 1
Module Installation Failures
Section titled “Module Installation Failures”Symptoms: Module won’t install, SQL errors
Solutions:
-
Check module requirements:
- PHP version compatibility
- Required PHP extensions
- XOOPS version compatibility
-
Manual SQL installation:
Terminal window mysql -u user -p database < modules/mymodule/sql/mysql.sql -
Clear module cache:
// In xoops_data/caches/rm -rf xoops_cache/*rm -rf smarty_cache/*rm -rf smarty_compile/* -
Check xoops_version.php syntax:
Terminal window php -l modules/mymodule/xoops_version.php
Template Compilation Errors
Section titled “Template Compilation Errors”Symptoms: Smarty errors, template not found
Solutions:
-
Clear Smarty cache:
Terminal window rm -rf xoops_data/caches/smarty_cache/*rm -rf xoops_data/caches/smarty_compile/* -
Check template syntax:
{* Correct *}{$variable}{* Incorrect - missing $ *}{variable} -
Verify template exists:
Terminal window ls modules/mymodule/templates/ -
Regenerate templates:
- Admin → System → Maintenance → Templates → Regenerate
🐛 Debugging Techniques
Section titled “🐛 Debugging Techniques”Enable XOOPS Debug Mode
Section titled “Enable XOOPS Debug Mode”// In mainfile.phpdefine('XOOPS_DEBUG_LEVEL', 2);
// Levels:// 0 = Off// 1 = PHP debug// 2 = PHP + SQL debug// 3 = PHP + SQL + Smarty templatesUsing Ray Debugger
Section titled “Using Ray Debugger”Ray is an excellent debugging tool for PHP:
// Install via Composercomposer require spatie/ray --dev
// Usage in your coderay($variable);ray($object)->expand();ray()->measure();
// Database queriesray($sql)->label('Query');Smarty Debug Console
Section titled “Smarty Debug Console”{* Enable in template *}{debug}
{* Or in PHP *}$xoopsTpl->debugging = true;Database Query Logging
Section titled “Database Query Logging”// Enable query logging$GLOBALS['xoopsDB']->setLogger(new XoopsLogger());
// Get all queries$queries = $GLOBALS['xoopsLogger']->queries;foreach ($queries as $query) { echo $query['sql'] . " - " . $query['time'] . "s\n";}❓ Frequently Asked Questions
Section titled “❓ Frequently Asked Questions”Installation
Section titled “Installation”Q: Installation wizard shows blank page A: Check PHP error logs, ensure PHP has enough memory, verify file permissions.
Q: Cannot write to mainfile.php during installation
A: Set permissions: chmod 666 mainfile.php during installation, then chmod 444 after.
Q: Database tables not created A: Check MySQL user has CREATE TABLE privileges, verify database exists.
Modules
Section titled “Modules”Q: Module admin page is blank A: Clear cache, check module’s admin/menu.php for syntax errors.
Q: Module blocks not showing A: Check block permissions in Admin → Blocks, verify block is assigned to pages.
Q: Module update fails A: Backup database, try manual SQL updates, check version requirements.
Themes
Section titled “Themes”Q: Theme not applying correctly A: Clear Smarty cache, check theme.html exists, verify theme permissions.
Q: Custom CSS not loading A: Check file path, clear browser cache, verify CSS syntax.
Q: Images not displaying A: Check image paths, verify uploads folder permissions.
Performance
Section titled “Performance”Q: Site is very slow A: Enable caching, optimize database, check for slow queries, enable OpCache.
Q: High memory usage A: Increase memory_limit, optimize large queries, implement pagination.
🔧 Maintenance Commands
Section titled “🔧 Maintenance Commands”Clear All Caches
Section titled “Clear All Caches”#!/bin/bashrm -rf xoops_data/caches/xoops_cache/*rm -rf xoops_data/caches/smarty_cache/*rm -rf xoops_data/caches/smarty_compile/*echo "Cache cleared!"Database Optimization
Section titled “Database Optimization”-- Optimize all tablesOPTIMIZE TABLE xoops_config;OPTIMIZE TABLE xoops_users;OPTIMIZE TABLE xoops_session;-- Repeat for other tables
-- Or optimize all at oncemysqlcheck -o -u user -p databaseCheck File Integrity
Section titled “Check File Integrity”# Compare against fresh installdiff -r /path/to/xoops /path/to/fresh-xoops🔗 Related Documentation
Section titled “🔗 Related Documentation”- Getting Started
- Security Best Practices
- XOOPS 4.0 Roadmap
📚 External Resources
Section titled “📚 External Resources”#xoops #troubleshooting #debugging #faq #errors #solutions