Apache CGI in user directory “End of script output before headers”

后端 未结 8 752
心在旅途
心在旅途 2021-02-04 17:10

I know there are some questions about this topic, but none seems to solve my issue. See this or this or this.

I\'m on Linux, Fedora21, and I\'m trying to enable per user

8条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-04 17:47

    For me, it worked when I changed the shebang line (#!/usr/bin/sh) to #!/usr/bin/env sh. I found that any shebang lines from What is the preferred Bash shebang? seemed to work (however note that sh is different from bash so if you want to use sh stick with it).

    So this code worked for me:

    #!/usr/bin/env sh
    echo "Content-type: text/plain"
    echo ""
    echo "Hello"
    

    Also, according to the post mentioned above, it seems /usr/bin/env sh seems preferred over /bin/sh. I have no idea about the per directory stuff.

提交回复
热议问题