2

I am trying to port my Mac config on Windows for some of my clients.

Since Windows is not Mac OS, I have to use php-cgi.exe instead of PHP-FPM. I have tested each component individually and everything seems to work, so I believe it is a config-only problem.

On my Mac, I have this RewriteRule:

RewriteCond %{SERVER_NAME} ^([^.]+)\.([^.]+)\.dev$ RewriteRule ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000%{DOCUMENT_ROOT}/%2/%1/$1" [P] 

I have added the RewriteCond so that you can see where %1 and %2 are coming from.

On my Mac it works fine since %{DOCUMENT_ROOT} begins with /, but on Windows %{DOCUMENT_ROOT} begins with C:.

When testing this config, it produces this error:

Proxy Error

The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /.

Reason: DNS lookup failure for: 127.0.0.1:9000c:

It appears (by looking in error.log) that 127.0.0.1:9000:C: is being considered as a part of an IPv6 address, it is transformed as [127.0.0.1:9000:C:] in the log.

If I try to isolate the two parts with /:

RewriteCond %{SERVER_NAME} ^([^.]+)\.([^.]+)\.dev$ RewriteRule ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/%{DOCUMENT_ROOT}/%2/%1/$1" [P] ^ 

I get this error:

No input file specified.

Actually, I got this error for everything I have tested so far.

Is there a solution?

1
  • Did you tried RewriteRule ^/(.*\.php(/.*)?)$ "fcgi://127.0.0.1:9000/%2/%1/$1" [P] ? Commented Dec 16, 2015 at 14:08

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.