|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi everyone,
i have been trying to set up my IIS to be able to execute .asp files but it just can't do it. whenever i try to execute .asp files through http://localhost/Asptest/Test3.asp , it always give me this error, "The server has encountered an error while loading an application during the processing of your request. Please refer to the event log for more detail information. Please contact the server administrator for assistance." i have try changing the user setting, the directory security, but it just cannot be solve. other files like html, htm can be execute perfectly. Pls assists as i really need help. Thanks. |
|
#2
|
|||
|
|||
|
my frens told me abt the globa.asa file but i cannot seems to locate it. even in my C:\Inetpub\wwwroot, its not inside. is this file important?
|
|
#3
|
|||
|
|||
|
Quote:
You should have a Global.asa file for your application as it can help you globalize your variables. Also, to see what your code problem is instead of the generic HTTP 500 page, in Internet Explorer, go to Tools -- Internet Options -- Advanced .... under the 'Browsing' list of options, there's one that says to 'Show Friendly HTTP error messages' ...... uncheck that box and whenever you refresh your browser to debug, the actual line that the error resides will print to the screen, which will give you a better indication as to what your error is.... Here is a sample of the 4 components that a Global.asa file should have... You can copy and paste this into a text file of your own that you can call Global.asa. Make sure the Global.asa file is located in your application's root directory... <SCRIPT LANGUAGE="VBScript" RUNAT="Server"> ' ******************* ' APPLICATION_OnSTART ' ******************* Sub Application_OnStart() application("activevisitors")=0 End Sub ' ******************* ' APPLICATION_OnEND ' ******************* Sub Application_OnEnd() End Sub ' ******************* ' SESSION_OnSTART ' ******************* Sub Session_OnStart() application.lock application("activevisitors")=application("activevisitors")+1 application.unlock If Application("SessionCount") > 2 Then Application.Lock Application("SessionCount") = 0 Application.Unlock Set ObjMyFile = CreateObject("Scripting.FileSystemObject") Set OpenMyFile = ObjMyFile.OpenTextFile(Server.MapPath("last-update.txt")) MyFileValue = OpenMyFile.ReadLine OpenMyFile.Close If DateDiff("h",MyFileValue,NOW) > 6 Then ' Here you would put any code you need to run ' do not surround the code with <% %> tags ' For example you might run a database query that checks for expired accounts Set WriteMyFile = ObjMyFile.CreateTextFile(Server.MapPath("last-update.txt")) WriteMyFile.WriteLine(NOW) WriteMyFile.Close End if End If End Sub ' ******************* ' SESSION_OnEND ' ******************* Sub Session_OnEnd() application.lock application("activevisitors")=application("activevisitors")-1 application.unlock End Sub </SCRIPT> Also, check out www.davesbizarre.com/code.asp for more code samples... Hope that helps. Dave |
![]() |
| Viewing: ASP Free Forums > System Administration > Microsoft IIS > Http 500 Internal Server Error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|