Skip to main content

Support

Debugging and Troubleshooting

Common Issues and Solutions

Issue: Memory Limit Exceeded

Fatal error: Allowed memory size exhausted

Solutions:

  • Increase memory_limit in php.ini

  • Optimize code to use less memory

  • Implement pagination for large datasets

  • Use generators for processing large files

Issue: Maximum Execution Time Exceeded

Fatal error: Maximum execution time exceeded

Solutions:

  • Increase max_execution_time in php.ini

  • Optimize database queries

  • Implement background job processing

  • Use asynchronous processing

Issue: Database Connection Errors

SQLSTATE[HY000] [2002] Connection refused

Solutions:

  • Verify database server is running

  • Check connection credentials

  • Validate network connectivity

  • Review firewall settings

Debug Tools Configuration

Xdebug Setup

ini

; php.ini configuration for Xdebug
[xdebug]
zend_extension=xdebug.so
xdebug.mode=debug,develop,coverage
xdebug.start_with_request=yes
xdebug.client_host=localhost
xdebug.client_port=9003
xdebug.idekey=PHPSTORM

Error Logging Configuration

php

<?php
// Enhanced error handling
set_error_handler(function($severity, $message, $file, $line) {
$logger = new Logger();
$logger->error("PHP Error: {$message}", [
'severity' => $severity,
'file' => $file,
'line' => $line,
'trace' => debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)
]);
});
set_exception_handler(function($exception) {
$logger = new Logger();
$logger->error("Uncaught Exception: " . $exception->getMessage(), [
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'trace' => $exception->getTraceAsString()
]);
});