在不關閉selinux的狀況下使httpd+php+KingbaseES正常使用
1.正常設置php、apache
除了正常流程外還須要在/etc/sysconfig/httpd最後追加LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/opt/Kingbase/ES/V7/bin:/opt/Kingbase/ES/V7/lib:/opt/Kingbase/ES/V7/unixodbc/lib:$LD_LIBRARY_PATH
2.設置selinux策略,使重啓httpd服務時不會報libuuid和libkci找不到的錯誤
chcon -R -h -t httpd_sys_script_exec_t /opt/Kingbase/ES/V7/
chcon -R -h -t httpd_sys_rw_content_t /opt/Kingbase/ES/V7/
3.在頁面中可正常訪問訪問,不會再錯誤日誌中報 kdb_connect(): Unable to connect to KingbaseES server: could not connect to server: Permission denied
setsebool -P httpd_can_network_connect 1
setsebool httpd_can_network_connect_db onphp
3.在頁面中可正常訪問訪問,不會再錯誤日誌中報 kdb_connect(): Unable to connect to KingbaseES server: could not connect to server: Permission denied
service httpd stop
service kingbase7d stop
setsebool -P httpd_can_network_connect 1
setsebool httpd_can_network_connect_db on
service httpd start
service kingbase7d start
第三部要先把服務都停了而後再設置selinuxlinux