Install nginx + PHP in Ubuntu 10.10
I have been installing the system for a while, and I haven't installed it yet. I plan to use Ubuntu for development at work today. So I just installed nginx and it was a great deal of fun on the company's computer!
Installation tutorial address here: http://www.cnblogs.com/breg
Of course, Baidu and Google are basically similar,
When I got home, I installed my book too! Who knows that the company's computer is smoothly on the laptop, and finally solved the problem with a lot of time and mental power!
In fact, the specifics are quite simple, just pay attention to several configuration issues!
The main configurations are as follows:
1. sudo gedit/etc/nginx/sites-available/Default
Server {Listen 80; # Listen for ipv4listen [:]: 80 default defaults 6only = on; # Listen for ipv6server_name localhost; access_log/var/log/nginx/localhost. access. log; Location/{root/var/www/nginx-default; index index.html index.htm index. PHP;} location/DOC {root/usr/share; Autoindex on; allow 127.0.0.1; deny all;} location/images {root/usr/share; Autoindex on ;} error_page 404/404 .html; # redirect server er Ror pages to the static page/50x.html # error_page 500 502 503 x.html; location =/50x.html {root/var/www/nginx-default ;} # proxy the PHP scripts to Apache listening on 127.0.0.1: 80 # location ~ \. Php $ {# proxy_pass http: // 127.0.0.1; #}# pass the PHP scripts to FastCGI server listening on 127.0.0.1: 9000 location ~ \. PHP $ {fastcgi_pass 127.0.0.1: 9000; fastcgi_index index. PHP; fastcgi_param script_filename/var/www/nginx-default $ fastcgi_script_name; # Replace the website path. Otherwise, the input error include fastcgi_params should be reported. # note that there is a space here, there is no space in the original file. If nginx cannot be started, I forgot to change it here} # deny access. htaccess files, if Apache's document root # concurs with nginx's one # location ~ /\. Ht {# deny all ;#}}
2. sudo gedit/etc/PhP5/cgi/PHP. ini
; Zend installation [Zend optimizer] zend_optimizer.optimization_level = 1zend_extension = "/etc/Zend/zendoptimizer. So"; replace the quote path with your own path; remove the comment CGI. fix_pathinfo = 1;