Troubleshooting Botlify, PHP and Telegram Errors

Raw MD
Identify the layer before changing code, credentials, PHP extensions or helper loading.

Identify the failing layer

SymptomLikely layerNext check
Undefined tg_allfun()Bot code spellingUse tg_all_fun();, not tg_allfun();.
Undefined tg_all_fun()Runtime/entrypointNew loader not deployed or standalone PHP without Botlify runtime.
Undefined tg_send()Loader/code pathCall tg_all_fun before the first helper, including cron entrypoints.
chatId must be string, int givenOlder helper signatureDeploy the current int|string-compatible helper runtime; confirm actual server file.
Missing telegram_api_helpers.phpOld deploymentCurrent suite is inside telegram.php; deploy matching runtime files.
Bad Gateway / 5xxAPI/network pathRecord response/time; retry only where the operation is safe to repeat.
Too Many Requests / 429Telegram rate limitRespect parameters.retry_after and reduce/requeue requests.
cURL timeoutNetwork/remote responseInspect elapsed time and connectivity; timeout alone cannot prove non-delivery.
MySQL 1045 Access deniedPlatform DB authenticationVerify deployed username/password/host privately; do not paste credentials.
PHP Startup: snmp.so dependency missingHosting PHP configurationAsk the host to repair the extension/dependency; unrelated to a tg helper call.
Sandbox blocked functionHosted execution rulesUse supported APIs and direct function calls; inspect the reported line.

Loader placement

PHP
<?php
declare(strict_types=1);

tg_all_fun();
// First helper call comes below this line.
tg_send($chatId, 'Hello');

If you choose plain PHP/cURL, remove native helper calls as well as the loader. A helper cannot work while its definition is deliberately absent. The runtime uses normal PHP error handling; do not assume a custom missing-loader message is installed.

Read API responses

PHP
tg_all_fun();
$result = tg_api_get_me();
if (!($result['ok'] ?? false)) {
    $errorCode = $result['error_code'] ?? null;
    $retryAfter = $result['parameters']['retry_after'] ?? null;
    // Log a sanitized diagnostic; choose retry/requeue behavior for the operation.
}

API failures often return an array rather than throwing a PHP exception. Catching Throwable alone does not test result.ok. Conversely, type errors and missing functions are PHP exceptions/errors, not Telegram responses.

Collect a useful report

Include the timestamp, PHP version/SAPI from the actual execution path, command/action, method name, sanitized error code/description and relevant code lines. Remove tokens, passwords, authorization headers and token-containing URLs. Separate historical log entries from errors after the latest deployment. A successful test later in the day can mean an earlier deployment failure is already resolved.

Upload limits are not all the same

PHP upload_max_filesize/post_max_size affect incoming PHP uploads. Telegram API download/media limits are separate, as are hosting storage quotas and timeouts. Increasing a PHP browser-upload setting does not automatically increase Telegram getFile limits. Check the method-specific reference before changing a limit.