简体   繁体   English

错误500,不在本地而是在服务器上

[英]Error 500, not on local but on server

I've made this page and it loads normally while on local development but when I try to access it on the server I have an Error 500, can somebody help me ? 我已经制作了此页面,并且在进行本地开发时可以正常加载,但是当我尝试在服务器上访问它时出现错误500,有人可以帮助我吗?

I have erased my .htaccess, looked in the log and I have nothing really interesting 我已经删除了.htaccess文件,查看了日志,但没有任何真正有趣的东西

 <?php /** * Template Name: Actus * * @link https://codex.wordpress.org/Template_Hierarchy * */ get_header('other'); ?> <section id ="page-title" class="col-md-12"> <div class="container"> <div class="container"> <header class="row extra-bottom-padding"> <div class="section_title col-lg-12 col-sm-12 col-sm-12 top-buffer"> <h1 class="title">Actus</h1> <hr class="divider_blue"> </div> </header> <? $args = array("posts_per_page" => "12", "category_name" => "actus, cest-fait"); $the_query = new WP_Query ($args); $x = 1; foreach ($args as $arg) if($x % 4 == 0) echo '<div class="row">'; while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <div class="col-md-4 col-lg-4 col-sm-6 col-xs-12"> <div class="le_post_entier"> <? the_post_thumbnail('actus'); ?> <div class="col-md-12 postbody"> <div class="col-md-12 post-title"> <? the_title(); ?> </div> </div> <a class="cta" href="#" style='color:#39c8d8; font-weight:bold;'>DÉCOUVRIR &#8594;</a> </div> </div> <?php endwhile; ?><? $x++; if($x % 4 == 0) echo '</div>'; ?> </div> </section> 

Please check module mod_rewrite.so is enabled in your apache configuration. 请检查您的apache配置中是否启用了mod_rewrite.so模块。

Open httpd.conf generally located in Apache installation directory in windows 打开Windows中通常位于Apache安装目录中的httpd.conf

/apache/conf/httpd.conf /apache/conf/httpd.conf

and

/etc/httpd/httpd.conf /etc/httpd/httpd.conf

Search for the module mod_rewrite.so or (mod_rewrite.c in rare cases). 搜索模块mod_rewrite.so或(在极少数情况下为mod_rewrite.c)。

#LoadModule rewrite_module modules/mod_rewrite.*

Here # character represents that it is commented or disabled. 此处的#字符表示已被注释或禁用。

LoadModule rewrite_module modules/mod_rewrite.*

Remove # and restart the Apache Http Server 删除#并重新启动Apache Http Server

Also check your apache error logs for possible reason. 还要检查您的apache错误日志,以了解可能的原因。

Try adding .htaccess file on server. 尝试在服务器上添加.htaccess文件。

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Ok.... I want to cry but the error was amazingly simple 好吧....我想哭,但错误非常简单

I needed to add 我需要添加

php after of <? PHP<?

Hope this will help someone 希望这会帮助某人

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM