【问题标题】:httpd does not open index.php in folder, mounted like tmpfshttpd 不会在文件夹中打开 index.php,像 tmpfs 一样挂载
【发布时间】:2015-05-25 15:02:04
【问题描述】:

我有一个问题: 我挂载文件夹/var/www/html/testram

mount -t tmpfs -o size=5m,mode=0755 tmpfs /var/www/html/testram

并将文件 index.php 与一些文本放在一起。 当我从网络浏览器打开网站时,我看不到任何文字。 我有什么:

drwxrwxrwx.  2 root    root     60 May 25 17:42 testram  
-rwxrwxrwx.  1 root    root 132723 May 25 17:18 index.php

在日志中我有错误:

PHP 警告:

Unknown: failed to open stream: Permission denied in Unknown on line 0

PHP Fatal error:  Unknown: Failed opening required '/var/www/html/testram/index.php' (include_path='.:/usr/share/pear:/usr/share/php') in Unknown on line 0

我做了一个实验,只创建一个文件夹

drwxr-xr-x. 2 root root     22 May 25 17:25 testfolder

并创建文件

-rw-r--r--. 1 root root 132723 May 25 17:12 index.php 

使用相同的文字。

当我从网络浏览器打开这个 index.php 时,我看到了文本。

为什么我在 tmpfs 中没有看到来自 index.php 的任何文本。

谢谢

chown apache.apache -R testram 有什么作用

【问题讨论】:

  • 我找到了这个主题link 并尝试在httpd 的conf 中使用Options FollowSymLinks。但我没有得到任何效果
  • 也许你需要知道,我尝试在 Amazon ec2 服务器中完成所有这些操作

标签: apache tmpfs


【解决方案1】:

您应该在 httpd.conf.htaccess 中启用符号链接:

Options +FollowSymlinks

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-10-16
    • 2019-01-28
    • 1970-01-01
    • 1970-01-01
    • 2017-07-31
    • 2021-10-17
    • 2020-02-06
    • 2019-04-04
    相关资源
    最近更新 更多