我想在bash的文件,我從PHP exec
叫編輯/etc/httpd/conf.d/ssl.conf:的sed不能編輯ssl.conf中拒絕 「權限」
#comment those lines in ssl.conf
sed -i 's/^SSLCertificateFile/#SSLCertificateFile/g' /etc/httpd/conf.d/ssl.conf
sed -i 's/^SSLCertificateKeyFile/#SSLCertificateKeyFile/g' /etc/httpd/conf.d/ssl.conf
#uncomment those lines in ssl.conf
sed -i 's/^#SSLCertificateFile/SSLCertificateFile/g' /etc/httpd/conf.d/ssl.conf
sed -i 's/^#SSLCertificateKeyFile/SSLCertificateKeyFile/g' /etc/httpd/conf.d/ssl.conf
但我得到這個錯誤:
sed: couldn't open temporary file /etc/httpd/conf.d/sed3nRibG: Permission denied
sed: couldn't open temporary file /etc/httpd/conf.d/sed2ASgeG: Permission denied
我改變了所有者apache
和權限的ssl.conf
文件a+xw
,但它並沒有幫助。
有什麼想法?