0

I set up a xampp-server using the highest rated answer of this thread: Running Python scripts with Xampp It is supposed to run Python-scripts. Starting a simple python file in the browser:

#!C:/Users/gfranosc/Downloads/Python/python.exe

from LambWaveModes import *


print("Content-Type: text/html\n")
print("Hi")
print('Beliebig viele Sachen')
LWM(Steifmat=[[[3.5,1.5,0],[1.5,3.5,0],[0,0,1]],[[103.08e9,2.8189e9,0],[2.8189e9,5.6469e9,0],[0,0,3.2727e9]]],rho=[1,1490],layer_thickness=[1,1],name="dataset_med",folder='dataset_1',color=0)

print('Hier bin ich nun')

The code runs fine, if i comment out the "from LambWaveModes import *" line. If i dont comment it out i get:

Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at postmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. Apache/2.4.29 (Win32) OpenSSL/1.1.0g PHP/7.2.1 Server at localhost Port 80

How can i solve this problem?

Derdesdoof
  • 47
  • 8
  • `LambWaveModes` is a custom python module not available on PyPI. The error somewhere occurs when importing that python module. Sadly the server error displayed is very cryptic and doesn't help us further. Is it not possible to get a Python error traceback? Also if possible provide the source code for `LambWaveModes`. Does importing other python modules work fine? – Tin Nguyen Mar 03 '20 at 11:02
  • you could run server in console to see all error messages. You could also check errors in log files created by Apache - you should see more details. You could check if server runs code in the same folder where you have file `LambWaveModes.py` - ie. `print( os.getcwd() )` – furas Mar 03 '20 at 11:04
  • @TinNguyen `LambWaveModes` is self written and runs fine while being called from a function, but not on the server. It is very long, how can I attach a file to this thread? Importing other modules works just fine. – Derdesdoof Mar 04 '20 at 08:44
  • @furas Only started it from the control panel before, so I got this error: "2020-03-04 9:45:55 18392 [ERROR] Can't find messagefile 'C:\xampp\mysql\share\errmsg.sys' 2020-03-04 9:45:55 18392 [ERROR] Aborting" So that's another little problem. I used `os.getcwd()` and it showed the folder where all the documents are. – Derdesdoof Mar 04 '20 at 08:51
  • this problem with `errmsg.sys` can gives `500 Internal Server Error` on page - so it can be one and the same problem. – furas Mar 04 '20 at 09:20
  • @furas How would I solve that error then? It's an additional error, cause that error also shows up if I dont import any module – Derdesdoof Mar 04 '20 at 09:27
  • I would use `Google` to find if someone had problem with `errmsg.sys` – furas Mar 04 '20 at 09:34
  • maybe module makes problem and it tries to send message but it can't find `errmsg.sys` and it shows `500 Internal Server Error` – furas Mar 04 '20 at 09:36
  • @furas I seem to find problems, that are close to this, but I can't project their solutions on my problem. My problem is, that 'C:\xampp\mysql\share\errmsg.sys' just isn't the right path, and I don't find how to just change that path – – Derdesdoof Mar 04 '20 at 11:29
  • if you know where is `errmsg.sys` then you could create folder `C:\xampp\mysql\share` and put `errmsg.sys` in this folder to test if it can help. – furas Mar 04 '20 at 11:32
  • @furas I did that. Now it only shows the error from the original thread: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator at postmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log. Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request. ... – Derdesdoof Mar 04 '20 at 11:45
  • apache should save more information in file `error.log` (or similar). Maybe it helps to find problem. Do you get any error message when you run it directly in console without `xampp` ? – furas Mar 04 '20 at 16:27
  • @furas i can't find that file anywhere, where is it saved? How do I run `apache` directly? – Derdesdoof Mar 05 '20 at 08:21
  • I don't use Xampp but if you have Control Panel like [this](https://pl.wikipedia.org/wiki/XAMPP#/media/Plik:XAMPP_Windows_10.PNG) then there is button "Logs"` and it should show you logs. – furas Mar 05 '20 at 09:20

0 Answers0