Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 内部服务器错误apache问题_Php_Apache_.htaccess - Fatal编程技术网

Php 内部服务器错误apache问题

Php 内部服务器错误apache问题,php,apache,.htaccess,Php,Apache,.htaccess,我在尝试向网站添加页面时遇到了一个奇怪的问题 实际上,我正试图在我的目录中创建一个“test.php”,但当我试图访问它时,我得到了 Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, contact@mywebsite

我在尝试向网站添加页面时遇到了一个奇怪的问题

实际上,我正试图在我的目录中创建一个“test.php”,但当我试图访问它时,我得到了

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, contact@mywebsite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
我的.htaccess如下所示:

 RewriteEngine on
 RewriteCond %{HTTP_HOST} ^www\.mywebsite\.com [NC]
 RewriteRule (.*) http://mywebsite.com/$1 [R=301,L]

好的,现在根据你发布的错误,它看起来像是所有权问题。从命令行浏览web目录,看看会发生什么

chown -R apache: /home/krokoweb/public_html/
注意:我使用了用户“
apache
”作为示例。无论您的web用户是什么,都可以将其用于您的文件。e、 g.
www-data
apache
httpd


看看结果如何

首先,您应该始终查看日志文件。因为这就是服务器告诉您问题所在的地方。照它说的去做服务器错误日志中可能提供了有关此错误的更多信息。以找出问题所在。您是否检查了重写模块是否已安装/激活?@ZenCodeWebdesign如果未安装,那么为什么该文件会导致错误?@arkascha,因为它将使用无法识别的模块,因此会导致服务器错误。通常使用条件
,以便在未启用该条件时不会使服务器停机。但他似乎没有用这个。不过,这个错误可能与此无关,他需要检查他的日志。好的,谢谢你给我指出了正确的方向:我的目录属于我的apache用户,但不是我的test.php。它现在工作得很好!但是,当我上传一个文件时,有没有一种方法可以自动更改这些权限?很好。不完全是这样,使用普通的ssh/scp等,它以您登录的用户身份上传,并且该用户具有写入目录的权限。有些客户可能能够做到这一点。我从来都不需要它。我的文件归我的sftp用户所有。但是看看这个哦,是的,我很笨。我在FTP上以root用户身份登录。。。好了,现在一切都清楚了,非常感谢!