Skip to main content

๐Ÿ›  ZTeraDB Troubleshooting Guide

If you see errors like:

Connection failed
Invalid configuration
FilterCondition error
PHP Fatal error: Class not found
Could not connect to host

This guide will help you fix them quickly.


๐Ÿ”‘ 1. Configuration Errors

โŒ Error:โ€‹

Missing or invalid client_key / access_key / secret_key

โœ” Fix:โ€‹

Make sure your .env contains all required fields:

CLIENT_KEY=your-client-key
ACCESS_KEY=your-access-key
SECRET_KEY=your-secret-key
DATABASE_ID=your-database-id

ZTERADB_HOST=db1.zteradb.com
ZTERADB_PORT=7777

And load them correctly:

getenv('CLIENT_KEY');

โŒ Error:โ€‹

Invalid value for env

โœ” Allowed values:

dev
staging
qa
prod

๐ŸŒ 2. Connection Errors

โŒ Error:โ€‹

Connection refused

โœ” Fix:โ€‹

  • Check host
    Should be something like:
    db1.zteradb.com
  • Check port
    Usually: 7777
  • Ensure WiFi / VPN / Firewall is not blocking outbound TCP

โŒ Error:โ€‹

Connection timeout (ETIMEDOUT)

โœ” Fix:โ€‹

  • Retry
  • Ensure server is reachable
  • Try simple curl test
    curl http://db1.zteradb.com:7777

๐Ÿ“ฆ 3. Class / Import Errors

โŒ Error:โ€‹

PHP Fatal error: Class "ZTeraDB\Config\ZTeraDBConfig" not found

โœ” Fix:โ€‹

Run:

composer dump-autoload

Ensure autoload is included:

require_once "vendor/autoload.php";

๐Ÿงฑ 4. Query Errors

โŒ Error:โ€‹

Missing query type: select / insert / update / delete

โœ” Fix:

(new ZTeraDBQuery("user"))->select();

โŒ Error:โ€‹

Fields are required for INSERT or UPDATE

โœ” Fix:

$query->insert()->fields(['email' => 'test@test.com']);

๐Ÿ” 5. FilterCondition Errors

โŒ Error:โ€‹

Invalid parameters passed to ZTMUL

โœ” Fix: Always pass arrays:

ZTMUL(['price', 'quantity']);

โŒ Error:โ€‹

Invalid filter: expected array

โœ” Fix:

ZTAND([$condition1, $condition2]);

๐Ÿงช 7. Debugging Tips

โœ” Tip 1 โ€” Print Raw Queryโ€‹

echo $query->generate();

โœ” Tip 2 โ€” Try a Simple Queryโ€‹

(new ZTeraDBQuery("user"))->select();

โœ” Tip 3 โ€” Re-check Keysโ€‹

Most errors come from wrong credentials.


๐Ÿ†˜ If Still Not Working

Share the error message, and Weโ€™ll fix it immediately.