• <tfoot id='CIsr8'></tfoot>
  • <i id='CIsr8'><tr id='CIsr8'><dt id='CIsr8'><q id='CIsr8'><span id='CIsr8'><b id='CIsr8'><form id='CIsr8'><ins id='CIsr8'></ins><ul id='CIsr8'></ul><sub id='CIsr8'></sub></form><legend id='CIsr8'></legend><bdo id='CIsr8'><pre id='CIsr8'><center id='CIsr8'></center></pre></bdo></b><th id='CIsr8'></th></span></q></dt></tr></i><div id='CIsr8'><tfoot id='CIsr8'></tfoot><dl id='CIsr8'><fieldset id='CIsr8'></fieldset></dl></div>

      <bdo id='CIsr8'></bdo><ul id='CIsr8'></ul>

      <small id='CIsr8'></small><noframes id='CIsr8'>

      1. <legend id='CIsr8'><style id='CIsr8'><dir id='CIsr8'><q id='CIsr8'></q></dir></style></legend>

        PHP:fopen() 权限被拒绝

        PHP: fopen() Permission denied(PHP:fopen() 权限被拒绝)

          <legend id='9MNcz'><style id='9MNcz'><dir id='9MNcz'><q id='9MNcz'></q></dir></style></legend>

              <i id='9MNcz'><tr id='9MNcz'><dt id='9MNcz'><q id='9MNcz'><span id='9MNcz'><b id='9MNcz'><form id='9MNcz'><ins id='9MNcz'></ins><ul id='9MNcz'></ul><sub id='9MNcz'></sub></form><legend id='9MNcz'></legend><bdo id='9MNcz'><pre id='9MNcz'><center id='9MNcz'></center></pre></bdo></b><th id='9MNcz'></th></span></q></dt></tr></i><div id='9MNcz'><tfoot id='9MNcz'></tfoot><dl id='9MNcz'><fieldset id='9MNcz'></fieldset></dl></div>
                <bdo id='9MNcz'></bdo><ul id='9MNcz'></ul>

              • <small id='9MNcz'></small><noframes id='9MNcz'>

                <tfoot id='9MNcz'></tfoot>

                    <tbody id='9MNcz'></tbody>
                  本文介绍了PHP:fopen() 权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我对这段代码感到困惑:

                  I am confused with this code:

                  test.php:

                  fopen('test.txt','a+');
                  

                  当我执行它时,我收到一个错误:

                  when I execute it, I get an error:

                  Warning: fopen(test.txt): failed to open stream:
                       Permission denied in /var/www/html/yuelu3/mobile/text.php on line 2
                  

                  test.txt:

                  -rwxrwxrwx. 1 jt jt     87 10月  7 20:58 test.txt
                  

                  问题出在哪里?

                  非常感谢!我已经找到问题了,我用的是FC13,因为SELinux的保护,一些动作被拒绝了.所以,我只需要摆脱保护.

                  Thanks a lot!I have found the problem,I use FC13,because of the protect of SELinux,some action is denied.So, I just need to get rid of the protect.

                  推荐答案

                  这个问题也可能是因为启用了 SELinux.这可以使用以下方法解决:

                  This issue can also be a result of having SELinux enabled. This can be solved using:

                  chown -R apache:apache /var/www/html/directory_to_write
                  chcon -R -t httpd_sys_content_t /var/www/html/directory_to_write
                  chcon -R -t httpd_sys_rw_content_t /var/www/html/directory_to_write
                  

                  您可以在 https://web.archive.org/web/20150927091100/https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/sect-Managing_Confined_Services-The_Apache_HTTP_Server-Types.html或 https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/managing_confined_services/sect-managing_confined_services-the_apache_http_server-types

                  但是,如果您使用的是 Redhat 8 或更新版本,则可能需要关注 https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/using_selinux/configuring-selinux-for-applications-and-services-with-non-standard-configurations_using-selinux#customizing-the-selinux-policy-for-the-apache-http-server-in-a-non-standard-configuration_configuring-selinux-for-applications-and-services-with-non-standard-configurations

                  However if you are on anything like Redhat 8 or newer, you might want to follow https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/using_selinux/configuring-selinux-for-applications-and-services-with-non-standard-configurations_using-selinux#customizing-the-selinux-policy-for-the-apache-http-server-in-a-non-standard-configuration_configuring-selinux-for-applications-and-services-with-non-standard-configurations

                  这篇关于PHP:fopen() 权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Appending GET parameters to URL from lt;formgt; action(将 GET 参数附加到来自 lt;formgt; 的 URL行动)
                  Forcing quot;Save Asquot; dialog via jQuery GET(强制“另存为通过 jQuery GET 对话框)
                  PHP - get certain word from string(PHP - 从字符串中获取某个单词)
                  How to debug a get request in php using curl(如何使用 curl 在 php 中调试 get 请求)
                  get a # from a url in php(从 php 中的 url 获取 #)
                  PHP - include() file not working when variables are put in url?(PHP - 将变量放入 url 时,include() 文件不起作用?)

                          <tbody id='yErii'></tbody>
                        <i id='yErii'><tr id='yErii'><dt id='yErii'><q id='yErii'><span id='yErii'><b id='yErii'><form id='yErii'><ins id='yErii'></ins><ul id='yErii'></ul><sub id='yErii'></sub></form><legend id='yErii'></legend><bdo id='yErii'><pre id='yErii'><center id='yErii'></center></pre></bdo></b><th id='yErii'></th></span></q></dt></tr></i><div id='yErii'><tfoot id='yErii'></tfoot><dl id='yErii'><fieldset id='yErii'></fieldset></dl></div>
                      1. <legend id='yErii'><style id='yErii'><dir id='yErii'><q id='yErii'></q></dir></style></legend>
                          <bdo id='yErii'></bdo><ul id='yErii'></ul>
                          • <small id='yErii'></small><noframes id='yErii'>

                            <tfoot id='yErii'></tfoot>