nginx-0.7.52 all Windows native working

Chris Cortese cortese.consulting at gmail.com
Wed Apr 22 23:21:07 MSD 2009


Thanks Igor!
Understanding the difference in who is handling which path was my last 
hurdle.  I now have all native nginx, mysql, php running successfully on XP.

Very minor detail/request from Windows people:  I'm not very 
knowledgeable with MS-DOS Batch files.  Can someone tell me how to run 
"start nginx" from within a .bat?  I'm just running it separately from a 
cmd prompt now, which works, just one extra step.

On another note to the folks maintaining the nginx site and docs, I'm 
sure it would be very helpful to M$ people if you took the information 
from the following link, updated it so that it relates to the current 
Windows native binary (and strip the Wordpress-specific stuff), and took 
this information to the nginx site.

http://blogbuildingu.com/wordpress/install-wordpress-wemp

It would also be great if someone wanted to take the time to also add 
the information from the following link, update some info in terms of 
version numbers, etc., and ideally if you can explain how to get crypt() 
to work in cygwin (I never figured this out), this would be very helpful 
to people who want to run nginx on Windows but have everything be in the 
Cygwin environment, build php-fpm and everything from source.

http://www.softwareprojects.com/resources/programming/t-how-to-install-nginx-php-php-fpm-and-mysql-under-1616.html


---


The following is my vhost conf for a very basic site built on Code Igniter:

# note that the "WEMP" stack is not using any cygwin components.  I just have my web PHP code in that directory
# structure still, which is convenient for when I want to use *nix-like environment on my Windows codebase.

server {
  listen   *:80;
  server_name  jobsite.xpdesktop;

  access_log  html/jobsite/logs/jobsite.access.log;
  error_log html/jobsite/logs/jobsite.error.log;

  root /cygwin/home/Chris/www/live/jobsite/trunk/html/public;
  index index.php index.html;

  location / {
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_param SCRIPT_FILENAME c:/cygwin/home/Chris/www/live/jobsite/trunk/html/public/index.php;
    fastcgi_param QUERY_STRING      q=$request_uri;
    include fastcgi_params;
  }

  location ~ /.php$ {
    fastcgi_pass  127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME c:/cygwin/home/Chris/www/live/public$fastcgi_script_name;
    fastcgi_param QUERY_STRING      q=$request_uri;
    include fastcgi_params;
  }
}




Igor Sysoev wrote:
> On Tue, Apr 21, 2009 at 04:34:49PM -0700, Chris Cortese wrote:
>
>   
>> Just to clarify:
>>
>> I'm really wanting to try Igor's latest 0.7.52 native Windows build.  
>> Ignore the part about "cygwin" being part of the pathname.
>> But there is history for why "cygwin" is in my path at all:
>>
>> 1.  I first was trying the cygwin build from the link out there on the 
>> net.  
>> http://www.softwareprojects.com/resources/programming/t-how-to-install-nginx-php-php-fpm-and-mysql-under-1616.html
>> Using that link and a couple other things I had to find / figure out, I 
>> was able to get nginx and php-fpm working on Windows, but I could not 
>> get the crypt() function to understand / do md5.  This meant I couldn't 
>> log in to my local website and so this was kind of useless.
>>
>> 2.  I next tried 0.7.50 from kevinworthington.com.  I think it could 
>> have worked but it insisted on looking for nginx.conf down under the 
>> /cygwin place where I had built nginx from source (see #1, above).  I 
>> could not figure out how to tell it just to use nginx.conf from 
>> c:\nginx\conf\nginx.conf.  I tried uninstalling and reinstalling cygwin 
>> and nginx (but cygwin is not so easy to uninstall).  That was apparently 
>> all that I needed to get that working! (Well, I never got to the point 
>> of testing crypt() on that attempt).
>>
>> 3.  Then Igor releases 0.7.52 native Windows build which I hoped would 
>> avoid both the above problems, and it probably still will, but I am 
>> unclear as to what kind of paths are expected.  Somewhere I read that 
>> for the SCRIPT_FILENAME, I should include the drive letter, but for the 
>> "root" directive, I should not...???  And I did not know if double 
>> quotes should be used, etc.... I can find no documentation on proper 
>> paths for the new 0.7.52 native Windows build nginx.conf.
>>
>> I'll keep trying.  Hope that history explains how I got there and why 
>> "cygwin" still is in my nginx.conf.  I'm no longer trying to use the 
>> cygwin build.   I just happen to have my web codebase still in that 
>> location (I've also tried other locations, like c:\nginx\html\www\...etc)
>>     
>
> The path in SCRIPT_FILENAME is FastCGI server property. You may run nginx
> on Unix host and FastCGI on Windows. And in this case SCRIPT_FILENAME
> should have Windows-style path.
>
> If PHP is Cygwin application, then you should use Cygwin-compatible path.
> If PHP is native Win32 application, then you should use x:\.. style path.
>
>   
>> Thanks!
>> Chris
>>
>>
>> Roger Pack wrote:
>>     
>>>> The message "No input file specified" meanse that PHP can not find file
>>>> on passed path, say:
>>>> "c:/cygwin/home/Chris/www/live/jobsite/trunk/html/public/index.php"
>>>> I do not know how Cygwin translated pathnames, but it may be just
>>>> "/home/Chris/www/live/jobsite/trunk/html/public/index.php"
>>>> therefore you may try
>>>>
>>>> -    fastcgi_param SCRIPT_FILENAME   c:/cygwin/home/Chris....
>>>> +    fastcgi_param SCRIPT_FILENAME   /home/Chris....
>>>>    
>>>>         
>>> if it's cygwin it might be something like /cygdrive/c/...
>>>  
>>>       
>
>   






More information about the nginx mailing list