Interal Server Error 500 - session_start() [英] Interal Server Error 500 - session_start()

查看:366
本文介绍了Interal Server Error 500 - session_start()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗯,我发现很多线程都是 ISE 500 ,但是没有一个解决方案适用于我。

Well, I found quite a lot of threads with ISE 500, but none of the solutions worked for me.

我开发了我们的客户端的Facebook应用程序提供一些音箱,当然,希望通过每个app_data参数传递一些参数到应用程序。所以我集成了 facebook sdk 3.1.1。做了一切正确连接到Facebook。

I developed a facebook app for our client to present some audiotracks and, of course, would like to pass some parameters to the application per app_data param. So I integrated the facebook sdk 3.1.1. did everything to connect properly to facebook.

在我的本地xampp上,所有的工作都很好,我们公司webserver也运行应用程序没有任何问题,我的私有网络空间也是如此。但是当我将应用程序上传到客户端服务器时,会收到500:内部服务器错误。为了排除我身边的任何奇怪的脚本错误,我试图执行sdk随附的example.php。同样的错误。即使我只是试图实例化这样的Facebook类:

On my local xampp everythings works fine, our companys webserver also runs the application without any problems, so does my private webspace. But when I upload the application to the clients server I get a 500: Internal Server Error. To rule out any weird scripting errors on my side I tried to execute the example.php that comes with the sdk. Same error. Even when I just tried to instantiate the Facebook class like this:

<?php

require '../src/facebook.php';

$facebook = new Facebook(array(
  'appId'  => '???',
  'secret' => '??????',
));
?>

我已经查看了服务器错误日志。这是唯一提到的是:

I already looked at the servers error logs. The only thing it mentions is this:

脚本头的过早结束:example.php

我还使用了广泛推荐的 error_reporting(E_ALL); ,以避免在服务器端发生错误的错误处理。没有。服务器不会告诉我什么问题。

I also used the widely suggested error_reporting(E_ALL); to avoid wrong errorhandling on the serverside. Nothing. The server just wont tell me whats wrong.

我发现很多原因导致其他人收到这个错误,最突出的是:

I found quite a lot of reasons why other people got this error, the most prominent ones:


  • 在facebook.php / base_facebook.php中缺少?> 标签

  • 多个实例的 Facebook - 和 FacebookApiException

  • Missing ?> tag in the facebook.php / base_facebook.php
  • Multiple instances of the Facebook- and FacebookApiException

...没有一个提供的解决方案适用于我。

...none of the provided solutions worked for me.

所以我试图比较两者的phpinfos,客户端和我们公司的服务器。当然有一些区别,但对我来说并不明显。我在论坛上寻找与ISE 500相关联的基本知识,如 cURL扩展 php版本(5.3.9)。我不是一个服务器管理员,我只有一个非常基本的服务器配置知识。所以为了确保有些东西丢失,我试图找到Facebook sdk的服务器要求...

So I tried to compare the phpinfos of both, the client and our companys server. Of course there were some differences, but nothing obvious to me. I looked for the basic things people at the forums had already associated with a ISE 500 like the cURL extension, php version (5.3.9). I am not a server-admin, I only got a very basic knowledge of server configurations. So to be sure that something is missing i tried to find server requirements for the facebook sdk...

...但整个网站不会告诉我服务器的要求为facebook sdk。即使是Facebook文档也没有提到任何内容。所以我希望可能有人在这里可以帮助我。

...but the whole web won't tell me server requirements for the facebook sdk. Even the facebook documentation doesn't mention anything. So i hope there might be someone around here who can help me with this.

是的,我已经问服务器管理员的帮助,他只是看着我有两个问号在他的眼睛...是的...我必须使用客户端服务器:( sigh

And yes... i already asked the server-admin for help, he just looked at me with two questionmarks in his eyes... and yes... i have to use the clients server :( sigh

感谢你预期...

更新:

我将列出我尝试回应你的建议的事情:

UPDATE:
I will list the things i tried in response to your suggestions:

服务器:

- 安装cURL扩展名(7.20.1)

- php版本是5.3.9。

- 试图包含其他文件,工作正常。似乎没有路径问题

- 服务器错误日志只是显示过早结束脚本标题:example.php

- 启用log_errors error_log表示无值

- 尝试 ini_set(display_errors,true); 用于错误跟踪...无效

Server:
- cURL extension is installed (7.20.1)
- php version is 5.3.9.
- tried to include other files, works fine. Doesnt seem to be a path-problem
- Server error logs just show "Premature end of script headers: example.php"
- log_errors is enabled. error_log says 'no value'
- tried ini_set("display_errors", true); for bug tracking... no effect

更新2

所以我能够识别问题检查Facebook文件逐行。尝试启动会话后,内部服务器错误500会在开始时抛出:

So I was able to identify the problem after checking the facebook files row by row. The Internal Server Error 500 is thrown right at the start after trying to start a session:

if(!session_id())
{
    session_start();
}

我将此信息转发到服务器管理员和客户端...我现在猜猜它的手,我会更新这个帖子,当我得到一个答案。感谢您的反馈意见:)

I forwarded this info to the server-admin and the client... i guess its out of my hands now, i will update this post when i get an answer. Thanks for your feedback guys :)

解决方案

确定server-admin现在确定了问题。 session.save_handler设置为'user',他将其更改为'files',现在一切正常。

Ok the server-admin now identified the problem. The session.save_handler was set to 'user', He changed it to 'files', now everything works.:

session.save_handler = files

再次感谢帮助!

推荐答案

phpinfo()有答案。在会话下,save_handler参数必须从

The phpinfo() had the answer. Under session, the save_handler parameter had to be set from:

session.save_handler = user

session.save_handler = user

to:

session.save_handler = files

这篇关于Interal Server Error 500 - session_start()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆