facebook twitter hatena line email

Vps/kagoya

提供: 初心者エンジニアの簡易メモ
2026年4月13日 (月) 17:22時点におけるAdmin (トーク | 投稿記録)による版 (phpで、smartyテンプレ書き込みで警告が出る場合)

移動: 案内検索

phpで、redisに接続できない場合

php-fpmが、起動しない場合

selinuxが効いてるので解除

$ /usr/sbin/getsebool -a | grep httpd_can_network_connect
httpd_can_network_connect --> on
httpd_can_network_connect_cobbler --> off
httpd_can_network_connect_db --> off
$ sudo /usr/sbin/setsebool -P httpd_can_network_connect on

phpで、smartyテンプレ書き込みで警告が出る場合

エラー詳細

Uncaught SmartyException: unable to write file

対策

dnf reinstall -y \
selinux-policy \
selinux-policy-targeted \
policycoreutils \
policycoreutils-python-utils \
libselinux \
libselinux-utils \
libselinux-python3

キャッシュ再生成

fixfiles onboot

書き込みdirにselinuxの書込設定

chcon -R -t httpd_sys_rw_content_t \
/var/www/zend/project1-test/application/modules/admin/views/templates_c

chcon -R -t httpd_sys_rw_content_t \
/var/www/zend/project1-test/application/modules/default/views/templates_c