Giter Club home page Giter Club logo

Comments (12)

abiosoft avatar abiosoft commented on May 21, 2024

I got it to work. Ensure php-fpm has started.

My Caddyfile looks like this

127.0.0.1 

root /path/to/php/dir

fastcgi / 127.0.0.1:9000 php {
    ext .php
    index index.php index.html
}

Hope this helps.

from caddy.

MisterDuval avatar MisterDuval commented on May 21, 2024

Thanks Abiola, this is not working with Caddy Win x86, it outputs this error:
http: multiple response.WriteHeader calls

from caddy.

mholt avatar mholt commented on May 21, 2024

That's interesting @devil1591. It means that more than one middleware thinks it has the floor. In other words, either:

  • one middleware that actually writes the response isn't telling others properly (via return value, maybe?) that it wrote to the response, or
  • a middleware that was told that somebody else wrote to the response still wrote to the response when it shouldn't have.

What kind of response was the client seeing? An error, or a page successfully served?

from caddy.

MisterDuval avatar MisterDuval commented on May 21, 2024

The error is No input file specified. 404 Not Found

from caddy.

mholt avatar mholt commented on May 21, 2024

Do you have Go installed? Could you change line 119 of fastcgi.go to:

return 0, nil

Because I suspect that php-fpm is giving 404 and writing "No input file specified" but the fastcgi handler is incorrectly returning the 404, signaling to Caddy that it needs to handle the error by writing "404 Not Found" - in this case, Caddy should not add anything to the response...

(If you don't have Go, just let me know, I can whip up a binary for you real quick.)

from caddy.

abiosoft avatar abiosoft commented on May 21, 2024

@devil1591 what is your middleware stack ? It could probably be a bug not limited to windows.

from caddy.

MisterDuval avatar MisterDuval commented on May 21, 2024

@mholt sorry, I don't have Go installed.
@abiosoft, I'm using php-cgi.exe (v5.4.40)

from caddy.

mholt avatar mholt commented on May 21, 2024

@devil1591 No problem. Here's a modified binary. I wouldn't expect it to fix the index file issue, but it should no longer say "multiple response.WriteHeader calls" - can you confirm that?

from caddy.

MisterDuval avatar MisterDuval commented on May 21, 2024

That's right, the error is now No input file specified. and there is no error on the console anymore. The index issue is still there.

from caddy.

mholt avatar mholt commented on May 21, 2024

Awesome - 1 down, 1 to go.

@devil1591 Now I need some more details. Could you paste the contents of your Caddyfile? And also the URL exactly as it appears in your browser when that message appears? I need to make sure it ends with a forward slash / character.

from caddy.

MisterDuval avatar MisterDuval commented on May 21, 2024

I confirm that Caddy 0.5.1 fixes the index file issue.
My URL was entered with a trailing slash.
Here is my caddy.conf:

192.168.10.66:80, 0.0.0.0:80
gzip
log logs/access.log
root apache2/htdocs
fastcgi / 127.0.0.1:9123 php {
    ext .php
    index index.php index.html
}

I used both 0.0.0.0 and 192.168.10.66 because 0.0.0.0 wasn't working.

from caddy.

abiosoft avatar abiosoft commented on May 21, 2024

@devil1591 glad to hear that. The are few new improvements to FastCGI middleware coming in the next release. Stay tuned.

from caddy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.