我的 apache/bin 文件夹中不存在 php.ini,但我收到错误?
我一直在试图找出如何用我创建的所有新页面来解决这个错误:
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500
localhost
2011/11/28 13:36:56
Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
嗯,我想,这一切都是从我通过设置更多密码来提高 MySQL 的安全性开始的。我想如果我在 php.ini
中打开错误报告,我会得到更好的错误报告,但它不在我的 /apache/bin
文件夹中。
好吧,所以我不知道该怎么办。我还在 xampp 中得到了这一行:MySQL database DEACTIVATED
。
知道会发生什么吗?另外,请告诉我这是否应该交给超级用户。
I've been trying to figure out how to resolve this error with all the new pages I create:
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500
localhost
2011/11/28 13:36:56
Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1
Well, it all started when I increased the security on MySQL by setting some more passwords, I think. I figured I'd get a better error report if I turned error reporting on in php.ini
, but it's not in my /apache/bin
folder.
Alright, so I have no idea what to do. I've also got this line in xampp: MySQL database DEACTIVATED
.
Any idea what might be happening? Also, please let me know if this should go to superuser.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您使用的是 Linux,请尝试“查找”,如下所示:
另一种方法是在 Apache DocumentRoot 文件夹中创建一个“phpinfo.php”,然后让 PHP 告诉您应该将 php.ini 放在哪里:
If you're on Linux, try a "find", like this:
Another approach is to create a "phpinfo.php" in your Apache DocumentRoot folder, and let PHP tell you where you should put your php.ini:
使用 Linux 中的
find
功能(由 paulsm4 指定)来查找php.ini
。在 Windows 中使用
ctrl+f
并搜索文件和文件夹 -> php.ini
在 Windows 中找到它。我建议您从 Web 服务器的根目录而不是其他位置执行此操作;否则可能会失败。如果您遇到 500 错误,您应该检查您的 Apache 日志文件。我相信它们可以在
/apache/logs
文件夹中的error.log
文件中找到。我清空了该文件,然后导致错误将其隔离。这些信息引导我找到答案。就我而言,收到 500 错误的原因是我的
.htaccess
文件引用了不存在的.htpasswrd
文件。我更改了.htaccess
文件中针对.htpasswrd
文件的代码行,以定位我想要的现有.htpasswrd
文件使用。不过,我可以尽快复制一个格式正确的.htpasswrd
文件或从头开始制作一个文件。我从多个来源了解到,500 个错误有很多原因。因此,这些步骤都不能保证对您有用。如果没有,我祝您好运,并且希望您能发表回复,告诉我您是如何修复 500 错误的,或者提供有关 500 错误的已解决问题的链接。
Use the
find
feature in Linux, as specified by paulsm4 to findphp.ini
.Use
ctrl+f
in Windows and search forfiles and folders -> php.ini
to find it in Windows. I recommend you do this from your web server's root directory rather than from some other location; otherwise, it may fail.If you're experiencing a 500 error, you should check your Apache log files. They can be found in the
/apache/logs
folder in the fileerror.log
, I believe. I emptied the file and then caused the error to isolate it. The information lead me to the answer.In my case, the reason I was getting a 500 error was because my
.htaccess
file was referencing a.htpasswrd
file that did not exist. I changed the line of code in the.htaccess
file that was targeting the.htpasswrd
file to target an existing.htpasswrd
file that I wanted to use. I could have just as soon copied a properly formatted.htpasswrd
file or made one from scratch, though.I've read at multiple sources that 500 errors have many causes. So, none of these steps are guaranteed to work for you. If they do not, I wish you luck, and I hope that you will post a reply telling me how you fixed your 500 error, too--or, a link to a resolved question about a 500 error.