The application displays this generic error:
“اتصال تلگرام برقرار نشد؛ توکن خصوصی، cURL، دسترسی HTTPS هاست و اجرای زمانبندی را بررسی کنید.”
Translation: “Could not connect to Telegram; check the private token, cURL, hosting HTTPS access and scheduled execution.”
No detailed cURL error or HTTP status is currently displayed.
Other Information
Hello. My PHP website fails when I manually trigger a server-side request to the Telegram Bot API using PHP cURL.
Could you confirm whether outbound HTTPS connections to api.telegram.org on port 443 are permitted on free hosting, and whether PHP cURL with TLS certificate verification is supported?
The bot token is stored in private server configuration. I am not sharing it here. The application only shows a generic connection error, so I have not yet identified whether this is an authentication, DNS, TLS or network issue.
Separately, is PHP CLI cron available for automatically processing notifications?
Welcome to the InfinityFree community forum! Good to have you here.
Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
Solving an issue is a joint effort. Try the suggestions you get and report back what happened.
Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.
Telegram is blocked on our free hosting, so your site can’t reach the Telegram Bot API. That’s most likely why the connection fails.
Our knowledge base article on outbound connections lists port 443 as allowed, and cURL works for outbound requests. But it also lists Telegram, including bots, as blocked entirely, even on the allowed ports:
For blocked services, the article says the host name may not resolve at all. You’d see something like cURL error 6: Could not resolve host. Your app hides the real cURL error, so I can’t tell you that’s what’s happening. If you print curl_error($ch) and curl_errno($ch), you should see the host name error. The article suggests premium hosting or an alternative service if you need a blocked service.
A staff answer on a similar request says the same: access to the Telegram API is blocked on our hosting because of abuse and spam.
On cron, I only found an older staff answer. It says free hosting doesn’t support command-line cron jobs, so PHP CLI cron isn’t available.