Welcome! Log In Create A New Profile

Advanced

basic guide on 0.8.4 with php on windows?

Posted by smok3 
basic guide on 0.8.4 with php on windows?
July 13, 2009 07:19AM
I need a basic guide on how to setup nginx (0.8.4) with php on windows, preferably the setup should not use any sort of absolute paths (like c:\php). Thanks in advance.

(p.s. basically what I'am looking for are two bat files: starteverything.bat and killeverything.bat)



Edited 2 time(s). Last edit at 07/13/2009 07:21AM by smok3.
basic guide on 0.8.5 with php on windows
July 17, 2009 06:46PM
well, my 1st try with 0.8.5;

a. unpack the content of nginx-0.8.5.zip to some folder
b. unpack php into the same folder, so your structure is like
conf\
contrib\
docs\
html\
logs\
php\
temp\
nginx.exe
c. google a bit and add Process.exe and RunHiddenConsole.exe to the same folder
d. write a new text file named start.bat, that may look like:
@ECHO OFF
ECHO Starting PHP FastCGI...
RunHiddenConsole.exe PHP\php-cgi.exe -b 127.0.0.1:10000
ECHO Starting nginx...
RunHiddenConsole.exe nginx.exe
::ECHO Starting MySQL...
::RunHiddenConsole.exe "C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt" --defaults-file="C:\Program Files\MySQL\MySQL Server 5.0\my.ini"
SLEEP 1
EXIT
(i is a slightly modified code like found on some blog, i don't need mysql so i edited that out)
e. write a new text file named stop.bat
@ECHO OFF
::ECHO Stopping MySQL...
::process -k mysqld-nt.exe >nul
ECHO Stopping nginx...
process -k nginx.exe >nul
process -k nginx.exe >nul
process -k nginx.exe >nul
process -k nginx.exe >nul
ECHO Stopping PHP FastCGI...
process -k php-cgi.exe >nul
SLEEP 1
EXIT
f. and optional deleteLogs.bat
del autoindex.acess.txt
del logs\access.log
del logs\error.log
g. conf/nginx.conf
under server add
			location / {
			root   html;
			index  index.php index.html index.htm autoindex.php;
		}
and
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:10000
		location ~ \.php$ {
		root           html;
		fastcgi_pass   127.0.0.1:10000;
		fastcgi_index  index.php;
		fastcgi_param  SCRIPT_FILENAME  ./html/$fastcgi_script_name;
		include        fastcgi_params;
		}

h. your final structure should look like
conf\
contrib\
docs\
html\
logs\
php\
temp\
deleteLogs.bat
nginx.exe
Process.exe
RunHiddenConsole.exe
start.bat
stop.bat


run start.bat and it should work.

p.s. autoindex.php is just a script i like to use for indexing directories, you can skip the parts that are reffered to it.
p.s.2. ideas to improve this, will be appriciated



Edited 1 time(s). Last edit at 07/17/2009 06:47PM by smok3.
Re: basic guide on 0.8.5 with php on windows
July 17, 2009 07:20PM
p.s.3. forgot to mention, that your php.ini should be in php folder (obviously, as we want this to be portable)
Re: basic guide on 0.8.4 with php on windows?
July 21, 2009 01:07PM
p.s.4. in start.bat you may want to change
RunHiddenConsole.exe nginx.exe

to
start nginx.exe

restart.bat may look like
@ECHO OFF
start /wait stop.bat
start.bat
Re: basic guide on 0.8.4 with php on windows?
July 23, 2009 07:31PM
such a vibrant community aren't we ? :)
маыбе и шоулд старт леарнинг соме Цыриллиц?
Re: basic guide on 0.8.4 with php on windows?
July 23, 2009 08:47PM
Maybe you should consider that nginx on Windows does not exactly have a "vibrant" following and you're asking for "a basic guide on how to setup nginx" in your first post.

There are plenty of "basic guides" available, and this is something I don't like saying, but since you started, I will: "Google is your friend" when it comes to "basic guides".

There are people who might be willing to answer specific questions should you have them, and should they have the specific knowledge. Since you didn't ask my opinion of running nginx on a Windows box, I won't give it, but you won't see me offering help on the subject since it is something I can't ever imagine doing.

Jim
Re: basic guide on 0.8.4 with php on windows?
July 26, 2009 10:03AM
so this 'problem' should be easily resolved with deleting the win version that you people offer? (especially if you think that most people develop web apps on nix boxes?)
(anyway i did my share of community work, so i have answered my own question, maybe you missed that part?)

ok, i will ask now then :
a. what is your opinion on running nginx on win box?
b. what is best distro to run nginx on?
c. what is in your opinion best distro to run virtualbox with multiple best distros for nginx?

thanks for your time.

p.s. no mail was sent from this board.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 79
Record Number of Users: 10 on August 27, 2010
Record Number of Guests: 177 on August 21, 2010
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by MySQL