I was trying to solve the mgknight exploit issue, and I somehow bungled my Asterisk install. Freepbx is still working ok (the phones are fine), but when I try to open the management interface I get
"FATAL ERROR
Can not write to cache folder at schmooze-font/cache. Please run (from the CLI): amportal chown
Trace Back
/var/www/html/admin/libraries/BMO/Less.class.php:55 die_freepbx()
[0]: Can not write to cache folder at schmooze-font/cache. Please run (from the CLI): amportal chown
I’m getting the same exact error on a brand new install. Centos 7, Asterisk 13, Freepbx 12 (tried git and latest). The less files are generating something in the cache folder:
ls -al /var/www/html/admin/assets/less/cache
total 7460
drwxrwxr-x. 2 asterisk asterisk 8192 Dec 12 18:06 .
drwxrwxr-x. 9 asterisk asterisk 4096 Dec 12 18:06 …
-rwxrwxr-x. 1 asterisk asterisk 31676 Dec 12 18:06 lessphp_1049n48gluf4wsk08cs0sswogg8kwk0.lesscache
-rwxrwxr-x. 1 asterisk asterisk 4161 Dec 12 18:06 lessphp_112de2ace60845aa90afcd122b9eae58.list
-rwxrwxr-x. 1 asterisk asterisk 142194 Dec 12 18:06 lessphp_a7090345ccc65545f9a8df35579c618538b4e8ba.css
The only additional info I found was in the /var/log/httpd/error_log:
[Fri Dec 12 18:56:36.017162 2014] [:error] [pid 11450] [client 175.180.68.68:52074] PHP Warning: file_put_contents(/var/log/asterisk/freepbx.log): failed to open stream: Permission denied in /var/www/html/admin/libraries/utility.functions.php on line 111
BUT all the permissions are correct, I’ve triple checked…
ls -al /var/log/asterisk
total 632
drwxrwxr-x. 5 asterisk asterisk 4096 Dec 12 05:01 .
drwxr-xr-x. 11 root root 4096 Dec 12 00:15 …
drwxrwxr-x. 2 asterisk asterisk 6 Dec 12 01:05 cdr-csv
drwxrwxr-x. 2 asterisk asterisk 6 Dec 12 01:05 cdr-custom
drwxrwxr-x. 2 asterisk asterisk 6 Dec 12 01:05 cel-custom
-rwxrwxr-x. 1 asterisk asterisk 298611 Dec 12 01:56 freepbx_debug
-rwxrwxr-x. 1 asterisk asterisk 331455 Dec 12 19:08 freepbx.log
-rwxrwxr-x. 1 asterisk asterisk 118 Dec 12 05:03 queue_log
I recently had a problem with permissions where the user “mysql” was the one trying to write data and failing, causing the GUI to fail on any page with a DB call. Try changing a directory’s permissions to 777 temporarily and then changing them back afterward to troubleshoot?
I dont speak english good but i had the same trouble. You can try check upload-max-size in php.ini.Change on 120M.Also try open page freepbx /admin/ and show the last log in /var/log/httpd/error_log
I realize this is bit old and all, but, I just ran into this exact problem. Ultimately, aside from chmod’ing the php session dir (/var/lib/php/session) 0777, the ultimate fix was to run Apache as “asterisk” instead of “apache”.
/etc/httpd/conf/httpd.conf:
#User apache
#Group apache
User asterisk
Group asterisk
I don’t know if this will help anyone else that finds this thread via Google (like I did), but there you go.