Premature end of script headers
Asked Answered
A

2

-1

Today I tried to use BrookFramework with Lazarus 2.0.6 on Windows 10. It compiled everything just fine (I tried the simple FastCGI application), but when I try to open the file "http://localhost/cgi-bin/test.fbf" it says "Error 500: Premature end of script headers". All other scripts work just fine.

I am using XAMPP, which I just installed so everything there should be running on the most recent version. I guess I missed to configure something, but I can't find it.

Thanks

Amethist answered 4/3, 2020 at 15:55 Comment(3)
Present your code that you have already tried to reach a solution?Cero
I didn't write any code yet, I just created the project with the standard code inside.Amethist
Additionally should know, that the message came from the perl-interpreter.Clyburn
A
0

I solved it that way: I copied the "Hello World" example to my project folder and renamed it. Now it works. It's the exact same code, so I guess I missed a configuration inside Lazarus.

Amethist answered 6/3, 2020 at 8:10 Comment(0)
S
0

there is a fastest way to run / compile+run .pas scripts on an apache +php . with the folder "c:\htdocs\myapp" created and these files inside:

index.php

<?php
!file_exists('index.exe') and exec('c:\lazarus\fpc\3.2.2\bin\x86_64-win64\fpc.exe '.realpath('.').'\index.pas');
system('index.exe');
?>

and index.pas

program p;
begin
writeln('hehehe');
end.

just call http://localhost/myapp and will compile first your .pas then will execute the exe produced .. and it's works even without sending header Content-type: text/html\r\n first !

Stroh answered 7/4, 2022 at 10:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.