facebook twitter hatena line email

「Vps/kagoya」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
行8: 行8:
 
  httpd_can_network_connect_db --> off
 
  httpd_can_network_connect_db --> off
 
  $ sudo /usr/sbin/setsebool -P httpd_can_network_connect on
 
  $ sudo /usr/sbin/setsebool -P httpd_can_network_connect on
 +
 +
==phpで、smartyテンプレ書き込みで警告が出る場合==
 +
 +
エラー詳細
 +
Uncaught SmartyException: unable to write file
 +
 +
対策
 +
<pre>
 +
dnf reinstall -y \
 +
selinux-policy \
 +
selinux-policy-targeted \
 +
policycoreutils \
 +
policycoreutils-python-utils \
 +
libselinux \
 +
libselinux-utils \
 +
libselinux-python3
 +
</pre>
 +
 +
キャッシュ再生成
 +
fixfiles onboot
 +
 +
書き込みdirにselinuxの書込設定
 +
<pre>
 +
chcon -R -t httpd_sys_rw_content_t \
 +
/var/www/zend/project1-test/application/modules/admin/views/templates_c
 +
</pre>

2026年4月13日 (月) 17:19時点における版

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