Laravel Sqlsrv Works In Tinker Mode But Not In Browser
I have a Laravel 5 project (on a CentOS 7 machine) that connects to an external MSSQL database. I followed the setup outlined here using FreeTDS. When I hit the page using a browse
Solution 1:
SELinux is blocking your outgoing connection to MSSQL.
The proper solution is to allow apache to make the connection:
setsebool -P httpd_can_network_connect_db 1
The -P flag makes the rule persistent, otherwise the rule is lost after a reboot.
Solution 2:
It turns out it wasn't a Laravel problem but a SELinux problem. I disabled SELinux by following this guide then I was able to access my project in a browser.
I know this is not the best solution but it works for my purpose.
Post a Comment for "Laravel Sqlsrv Works In Tinker Mode But Not In Browser"