在万网虚拟主机下创建wordpress,打开各种网页出现Internal Server Error(500错误)解决办法

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/Sunriseydy/article/details/72639121

本人最近搞了个万网的虚拟主机,把之前买的域名解析过来打算建个wordpress博客。由于是第一次搞服务器和网站,出现了很多错误,现在就把建站过程中的问题和解决方法写出来供大家参考。

进入wordpress的后台或者主题设置、更新等任意页面时出现Internal Server ErrorThe server encountered an internal error or...错误,一开始我认为是/wp-admin权限不够,于是将wp-admin文件夹权限改为755,发现可以访问后台,但是主题和更新等页面仍然出现相同错误。改了/wp-admin/themes文件夹的权限为755、777都不行。折腾了好久,百度也看了好多方法,最终参考了一个百度经验的方法成功了,链接:点击打开链接,也就是把主机的php版本改为5.5就行了。万网虚拟主机设置步骤如下:

1,打开主机管理控制台,点击侧边高级环境设置,点击PHP版本设置



2.选择php5.5即可



最后附上我的博客地址,欢迎来访

日出一点一


展开阅读全文

javamail Internal Server Error

06-20

使用javamail写的发送邮件程序,使用本机的邮件服务器,发送没有总是,但是换成163的邮箱后,发生错误.程序有两部分1\jsp页面.2\servlet程序.rn1\jsp程序rnrn rn说我内容太多,以下省....rn 2\servlet程序rnpackage testmail;rnimport javax.servlet.*;rnimport javax.servlet.http.*;rnimport java.io.*;rnimport javax.mail.*;rnimport javax.mail.internet.*;rnimport java.util.*;rnimport javax.activation.*;rnclass Auth extends Authenticatorrnrn String username="";rn String password="";rn public Auth(String username,String password)rn this.username=username;rn this.password=password;rn rn public PasswordAuthentication getPasswordAuthentication()rn rn return new PasswordAuthentication(username,password);rn rnrnrnpublic class SendMail extends HttpServlet rn private static final String CONTENT_TYPE = "text/html; charset=GB18030";rnrn //Initialize global variablesrn public void init() throws ServletException rn rnrn //Process the HTTP Get requestrn public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException rn response.setContentType(CONTENT_TYPE);rn PrintWriter out = response.getWriter();rn tryrn Properties props=new Properties();rn Session sendMailSession;rn Store store;rn Transport transport;rn props.put("mail.smtp.host","smtp.163.com");rn props.put("mail.smtp.auth","true");rn Auth auth=new Auth("test","test");rn sendMailSession=Session.getDefaultInstance(props,(Authenticator)auth);rn Message newMessage=new MimeMessage(sendMailSession);rn newMessage.setFrom(new InternetAddress(request.getParameter("from")));rn newMessage.setRecipient(Message.RecipientType.TO,new InternetAddress(request.getParameter("to")));rn newMessage.setSubject(new String(request.getParameter("subject").getBytes("iso-8859-1")));rn newMessage.setSentDate(new Date());rn newMessage.setText(new String(request.getParameter("text").getBytes("iso-8859-1")));rnrn Transport.send(newMessage);rn out.println("the Email send sucess!");rn rn catch(MessagingException m)rn rn out.print(m.toString());rn rn rnrn public void destroy() rnrn protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOExceptionrn doPost(request,response) ;rn rnrn用户名和密码没问题的,大家不用担心rn错误信息:rntype Exception reportmessage Internal Server Errordescription The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.exception javax.servlet.ServletException: Error instantiating servlet class testmail.SendMailrn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:895)rn at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:655)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)rn at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)rn at java.lang.Thread.run(Thread.java:534)rnroot cause java.lang.NoClassDefFoundError: testmail/Authrn at java.lang.Class.getDeclaredConstructors0(Native Method)rn at java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)rn at java.lang.Class.getConstructor0(Class.java:1922)rn at java.lang.Class.newInstance0(Class.java:278)rn at java.lang.Class.newInstance(Class.java:261)rn at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:886)rn at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:655)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)rn at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)rn at java.lang.Thread.run(Thread.java:534)rnrn看了网上有类似的问题,但他们说是mail.jar包找不到或者是activation.jar,我用的是JBuildX,在Tomcat的目录下能看到那个两包.请大家帮忙看看. 论坛

The server encountered an internal error ()

01-01

请问这个问题要怎么解决?rn我的代码是:rn[code=Java]<%@ page contentType="text/html;Charset=GB2312" %>rn<%@ import="java.sql.*" %>rn<%rn Connection con;rn Statement sql;rn tryrn rn Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();rn rn catch (Exception e)rn rn e.printStackTrace();rn rn tryrn rn String url="jdbc:sqlserver://127.0.0.1:1433;DatabaseName=book";rn String user="sa";rn String password="sa";rn con=DriverManager.getConnection(url,user,password);rn sql=con.createStatement();rn ResultSet rs_sale=sql.executeQuery("SELECT top 3 CID,Name,Price,author,IMG,info FROM books");rn int sale_ID=0;rn String s_goodsname="";rn float s_price=0;rn String s_introduce="";rn String s_picture="";rn ResultSet rs_new=conn.executeQuery("SELECT top 4 CID,Name,Price,author,IMG,info FROM books");rn int new_ID=0;rn String new_goodsname="";rn float new_nowprice=0;rn String new_picture="";rn rn catch (SQLException e1)rn rn e1.printStackTrace();rn rn%>rn[/code]rnrn错误提示:rnHTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnorg.apache.jasper.JasperException: /JSP/index.jsp(2,4) Invalid directivern org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)rn org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)rn org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)rn org.apache.jasper.compiler.Parser.parseDirective(Parser.java:516)rn org.apache.jasper.compiler.Parser.parseElements(Parser.java:1557)rn org.apache.jasper.compiler.Parser.parse(Parser.java:127)rn org.apache.jasper.compiler.ParserController.doParse(ParserController.java:212)rn org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)rn org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:156)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:296)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)rn org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)rn org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)rn org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)rn org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)rn org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:803)rnrnrnnote The full stack trace of the root cause is available in the Apache Tomcat/5.5.26 logs.rnrnrn--------------------------------------------------------------------------------rnrnApache Tomcat/5.5.26 论坛

没有更多推荐了,返回首页