gpt4 book ai didi

php - sed 无法编辑 ssl.conf "Permission denied"

转载 作者:行者123 更新时间:2023-12-04 19:32:20 25 4
gpt4 key购买 nike

我正在尝试使用从 PHP exec 调用的 bash 文件编辑/etc/httpd/conf.d/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并获得 a+xw 的许可的 ssl.conf文件,但它没有帮助。
任何想法 ?

最佳答案

sed 尝试创建一个临时文件...查看错误...并且无权写入目录( /etc/httpd/conf.d )

sed command creates randomly named files寻找其他可能的解决方案

关于php - sed 无法编辑 ssl.conf "Permission denied",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18488035/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com