G
G
Gikerven2022-04-15 19:38:13
PHP
Gikerven, 2022-04-15 19:38:13

How to host two PHP telegram bots on the same hosting?

Good afternoon. There is a telegram bot that works via Webhook.

When I run it from the root directory of the site, it works, but when I create an additional folder on the hosting and access to the index.php file starts to have the path: primer.ru/folder/index.php, the bot stops working. Moreover, if I place the main file in primer.ru/index.php, the bot functions again.

Is it possible to somehow host two bots on the same site and hosting?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmistass, 2022-04-15
@Dmistass

Write two bots in one program

D
Drno, 2022-04-15
@Drno

Well, either correctly indicate to the bot where it is located and should work (I don’t know if this is possible)
Or use a VPS, raise your web server there and set up at least 20 bots

T
TheAndrey7, 2022-04-15
@TheAndrey7

It is possible and is done in an elementary way. It can be placed in different directories, it can be placed on different sites (a subdomain is considered a separate site).
If your bot doesn't work when placed in a directory, it's badly written. Should be able to detect its directory automatically.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question