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
[code]
conf\
contrib\
docs\
html\
logs\
php\
temp\
nginx.exe
[/code]
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:
[code]
@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
[/code]
(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
[code]
@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
[/code]
f. and optional deleteLogs.bat
[code]
del autoindex.acess.txt
del logs\access.log
del logs\error.log
[/code]
g. conf/nginx.conf
under server add
[code]
location / {
root html;
index index.php index.html index.htm autoindex.php;
}
[/code]
and
[code]
# 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;
}
[/code]

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


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
[code]
RunHiddenConsole.exe nginx.exe
[/code]

to
[code]
start nginx.exe
[/code]

restart.bat may look like
[code]
@ECHO OFF
start /wait stop.bat
start.bat
[/code]
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 Ohlstein
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: 98
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready