简体   繁体   English

require_once(“ facebook-sdk / facebook.php”)引发警告“无法打开流:权限被拒绝”

[英]require_once(“facebook-sdk/facebook.php”) throws a warning “failed to open stream:Permission denied”

I'm trying out the tutorials for Facebook developers. 我正在尝试针对Facebook开发人员的教程。 However, I can't include the Facebook PHP SDK successfully in my code. 但是,我无法在代码中成功包含Facebook PHP SDK。 As stated, require_once("facebook_sdk/facebook.php"); 如前所述, require_once("facebook_sdk/facebook.php"); throws the following error: 引发以下错误:

Warning: require_once(facebook_sdk/facebook.php) [function.require-once]: failed to
open stream: Permission denied in /opt/lampp/htdocs/awesome/plas.php on line 2

Fatal error: require_once() [function.require]: Failed opening required 'facebook_sdk/facebook.php'
(include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/awesome/plas.php on line 2

I am developing under Lucid Lynx. 我在Lucid Lynx下开发。 I tried doing chmod 777 facebook.php but the problem persists. 我尝试做chmod 777 facebook.php但问题仍然存在。 I found this SO question but the resolution arrived at (renaming the file, as it may be conflicting with one of PHP's own) does not work for me. 我发现了这个问题,但是解决方法(重新命名文件,因为可能与PHP自己的文件冲突)对我不起作用。 (Come to think of it, how will a file named facebook.php conflict with internal PHP files?!) Even if I switch to plain require , the same warnings are thrown. (想一想,名为facebook.php的文件将与内部PHP文件发生冲突吗?!)即使我切换到普通的require ,也会引发相同的警告。

Curiously, if I copy the files ( facebook.php and base_facebook.php ) outside of facebook_sdk and change the require_once line accordingly, the require succeeds. 奇怪的是,如果我的文件(复制facebook.phpbase_facebook.php )之外facebook_sdk和改变require_once相应的路线,需要成功。 Any thoughts? 有什么想法吗?

Your web server needs read access right to facebook_sdk/facebook.php . 您的Web服务器需要对facebook_sdk/facebook.php读取访问权限。 You can do it by chown ing the directory to the web server user. 你可以做到这一点chown荷兰国际集团的目录到Web服务器的用户。 chmod 777 is not a good practice. chmod 777不是一个好习惯。

Also make sure for each of include path, facebook_sdk/facebook.php exists. 还要确保每个include路径都存在facebook_sdk/facebook.php

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PHP require_once 无法打开流权限被拒绝 - PHP require_once failed to open stream permission denied 警告无法打开流权限拒绝致命错误require_once PHP + NginX + RHEL in VMware - Warning failed to open stream permission denied fatal error require_once PHP + NginX + RHEL in VMware require_once:无法打开流:权限被拒绝(lampp) - require_once: failed to open stream: Permission denied(lampp) require_once(../../ path / to / script.php)打开流权限被拒绝 - require_once(../../path/to/script.php) failed to open stream permission denied PHP 警告:require_once 无法打开流:中没有这样的文件或目录 - PHP Warning: require_once failed to open stream: No such file or directory in PHP警告:require_once:无法打开流:在目录中没有这样的文件或目录 - PHP Warning: require_once: failed to open stream: No such file or directory in PHP 警告:require_once(/var/www/html/wp-config.php):无法打开流:第 37 行 /var/www/html/wp-load.php 中的权限被拒绝 - PHP Warning: require_once(/var/www/html/wp-config.php): failed to open stream: Permission denied in /var/www/html/wp-load.php on line 37 警告:require_once(../initialize.php):无法打开 stream 和致命错误:require_once():无法打开所需的问题 - Warning: require_once(../initialize.php): failed to open stream and Fatal error: require_once(): Failed opening required problem 警告:require_once():无法打开 stream:没有这样的文件或目录 - Warning: require_once(): failed to open stream: No such file or directory in (PHP):警告:include_once,无法打开流:权限被拒绝 - (PHP): Warning: include_once, failed to open stream: Permission denied
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM