When I want to play or save a fresh recorded message, FreePBX can not connect with Asterisk.
The fault is caused by /var/www/html/admin/libraries/media/Media/Driver/Drivers/AsteriskShell.php which can not find the lock file in /var/run/asterisk/asterisk.ctl.
Which is correct because Asterisk writes his lock file in /run/asterisk/asterisk.ctl
This is also the case when I try to listen to a recorded call trough the CDR.
Asterisk is looking for the lock file and can’t find it. Asteriskshell.php executes asterisk itself which throws the error about the lock file. There is nothing wrong in asteriskshell.php
This means your asterisk is not properly configured. You should try out the distro.