php 包含在 .htaccess 中未设置
我正在尝试在 htaccess 文件中设置 php 的包含路径。它在我的本地计算机上工作,但在我的开发服务器上不起作用。两个 ubuntun 都运行 apache2.2 这是我的 .htaccess 文件:
AddType application/x-httpd-php .html .htm .php
# ---------------------------------------------------------------------------
# PHP.INI VALUES
# Upload Variables, Include Path, Etc
# ---------------------------------------------------------------------------
php_value include_path "/var/www/includes:.:/usr/local/lib/php:/var/www/"
php_value upload_max_filesize 5242880
php_value post_max_size 5242880
php_value memory_limit 32M
# ---------------------------------------------------------------------------
# Prepend File
# ---------------------------------------------------------------------------
php_value auto_prepend_file "/var/www/includes/prepend.php"
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
我不知道为什么这不起作用。有什么想法吗?
apache 错误是这样的: PHP 致命错误:require_once(): 无法在线打开 /var/www/concert2.php 中所需的 'db.inc.php' (include_oath='.:/usr/share/php:/usr/share/pear') 3
I am trying to set the include path for php in my htaccess file. It works on my local computer but on my dev server it doesn't work. Both ubuntun running apache2.2 Here is my .htaccess file:
AddType application/x-httpd-php .html .htm .php
# ---------------------------------------------------------------------------
# PHP.INI VALUES
# Upload Variables, Include Path, Etc
# ---------------------------------------------------------------------------
php_value include_path "/var/www/includes:.:/usr/local/lib/php:/var/www/"
php_value upload_max_filesize 5242880
php_value post_max_size 5242880
php_value memory_limit 32M
# ---------------------------------------------------------------------------
# Prepend File
# ---------------------------------------------------------------------------
php_value auto_prepend_file "/var/www/includes/prepend.php"
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
I am lost as to why this isn't working. Any ideas?
The apache error is saying:
PHP Fatal error: require_once(): Failed opening required 'db.inc.php' (include_oath='.:/usr/share/php:/usr/share/pear') in /var/www/concert2.php on line 3
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查:
这篇相关文章可能会有所帮助:
PHP 致命错误无法打开所需文件
根据我的经验,这些问题是几乎总是与路径相关(您实际上没有指向您认为指向的位置)或与权限相关。
Check:
This related article might help:
PHP Fatal Error Failed opening required File
In my experience, these problems are almost always either path related (you're not actually pointing where you think you're pointing) or permissions related.