0

I have migrated from php 7.x to PHP 8.1 and just noticed that my screen exec() are no longer working. They were working fine before. I can see the screens running with screen -ls but it’s like the exec() in the php file is no longer executed. It works if I run the php file via URL though, can you please help?

Here is the exec function inside the screen.php file:

exec('screen -S aggiornamento_clicks_DB_Bitly -dm bash -c "cd /var/www/html/Telegram_bot/Daniele/condividi_nel_gruppo_bot; while true; do php aggiorna_clicks.php; sleep 300; done;"');

It supposed to load/execute the aggiorna_click.php file.

i Tried to manually load the php script file and it worked. I tried to reboot the server with no avail.

Kevin C
  • 4,851
  • 8
  • 30
  • 64
Daniele
  • 3
  • 2
  • Try to break it up in multiple pieces to see where the issue is. The module itself hasn't changed: https://www.php.net/manual/en/function.exec.php – Kevin C Nov 16 '22 at 06:58
  • The code itself works, because when I run the script via the browser URL it works fine, I believe something changed here after the upgrade to php 8.1: exec('screen -S aggiornamento_clicks_DB_Bitly -dm bash -c "cd /var/www/html/Telegram_bot/Daniele/condividi_nel_gruppo_bot; while true; do php aggiorna_clicks.php; sleep 300; done;"'); otherwise, it will not work either via URL, right? – Daniele Nov 16 '22 at 08:32
  • I have found out the mysqli_connect is no longer working with php 8.1, does anyone know how to fix this? – Daniele Nov 16 '22 at 21:32

0 Answers0