系统ubuntu11.10
sudo apt-get install nginx
sudo apt-get install php5 php5-cli php5-cgi php5-mysql php5-fpm
sudo vim /etc/php5/fpm/php.ini
找到
;cgi.fix_pathinfo=1选项, 修改为:
cgi.fix_pathinfo=1
启动 nginx 和 php-fpm
sudo service nginx start sudo service php5-fpm start
P.S. 除fpm的另一种方法:Nginx和spawn-fcgi配合运行
在/etc/nginx/fastcgi_params 文件最后, 加入一行, 可以用 sudo vim /etc/nginx/fastcgi_params 在文件末尾加入此行: fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 另外需要在PHP-CGI的配置文件(Ubuntu 上此配置文件位于/etc/php5/cgi/php.ini)中, sudo vim /etc/php5/cgi/php.ini 找到 ;cgi.fix_pathinfo=1 选项, 修改为: cgi.fix_pathinfo=1; 这样php-cgi方能正常使用SCRIPT_FILENAME这个变量。 启动 fast-cgi 命令 sudo /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid 设置开机启动fast-cgi进程 sudo vim /etc/rc.local 把启动 fast-cgi 的命令添加到在 exit 0 上面就完成了 我们在配置 php.ini 之后需要重启 nginx 和 php-cgi 的命令, 分别是 nginx : sudo service nginx restart php-cgi: # 先杀死进程 sudo killall -HUP php5-cgi # 再启动 sudo /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 5 -u www-data -g www-data -f /usr/bin/php5-cgi -P /var/run/fastcgi-php.pid 参数含义如下 * -f 指定调用FastCGI的进程的执行程序位置, 根据系统上所装的PHP的情况具体设置 * -a 绑定到地址addr * -p 绑定到端口port * -s 绑定到unix socket的路径path * -C 指定产生的FastCGI的进程数, 默认为5(仅用于PHP) * -P 指定产生的进程的PID文件路径 * -u和-g FastCGI使用什么身份(-u 用户 -g 用户组)运行, Ubuntu下可以使用www-data, 其他的根据情况配置, 如nobody、apache等
ubuntu系统中放置server的位置在
/etc/nginx/conf.d/我们在里面添加一个default.conf, 内容如下
server { listen 127.0.0.1:80; server_name localhost; root /data/www; location / { index index.php index.html index.htm; } location ~ \.php { include /etc/nginx/fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; set $path_info ""; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?.php)(/.+)$") { set $script_name $1; set $path_info $2; } fastcgi_param SCRIPT_NAME $script_name; fastcgi_param PATH_INFO $path_info; fastcgi_index index.php; fastcgi_pass 127.0.0.1:9000; } }重启nginx
sudo service nginx restart
location ~ \.php { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; } # 伪静态 if (!-e $request_filename) { rewrite ^/(.*)$ /index.php/$1 last; }
cat > /data/www/index.php << "EOF" <?php phpinfo(); EOF
地址栏输入localhost/index.php
有了吗?
Tue Jun 21 11:22:14 CST 2011
今天吴伟遇到这个问题, 我之前用Ubuntu也遇到过这个问题.这个应该是Compiz没有正常启动造成的.
这样解决的, 运行完重启OK.
sudo apt-get install unity-2d
我的系统 ubuntu 10.10
1. 安装wine
sudo apt-get install wine
处理中文汉字前二个子为方块的bug
打开wine配置, 在函数库中的"新增函数库顶替"项中输入 oleaut32.dll
2. 配置wine
sudo add-apt-repository ppa:wine-cn/ppa sudo apt-get update sudo apt-get install winetricks winetricks msxml3 gdiplus riched20 riched30 ie6 vcrun6 vcrun2005sp1 vcrun6sp6 vb6run ln -s /usr/share/fonts/truetype/wqy/wqy-microhei.ttc ~/.wine/drive_c/windows/Fonts/ cat > ifont.reg << "EOF" REGEDIT4 [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes] "Arial"="WenQuanYi Micro Hei" "Arial CE,238"="WenQuanYi Micro Hei" "Arial CYR,204"="WenQuanYi Micro Hei" "Arial Greek,161"="WenQuanYi Micro Hei" "Arial TUR,162"="WenQuanYi Micro Hei" "Courier New"="WenQuanYi Micro Hei" "Courier New CE,238"="WenQuanYi Micro Hei" "Courier New CYR,204"="WenQuanYi Micro Hei" "Courier New Greek,161"="WenQuanYi Micro Hei" "Courier New TUR,162"="WenQuanYi Micro Hei" "FixedSys"="WenQuanYi Micro Hei" "Helv"="WenQuanYi Micro Hei" "Helvetica"="WenQuanYi Micro Hei" "MS Sans Serif"="WenQuanYi Micro Hei" "MS Shell Dlg"="WenQuanYi Micro Hei" "MS Shell Dlg 2"="WenQuanYi Micro Hei" "System"="WenQuanYi Micro Hei" "Tahoma"="WenQuanYi Micro Hei" "Times"="WenQuanYi Micro Hei" "Times New Roman CE,238"="WenQuanYi Micro Hei" "Times New Roman CYR,204"="WenQuanYi Micro Hei" "Times New Roman Greek,161"="WenQuanYi Micro Hei" "Times New Roman TUR,162"="WenQuanYi Micro Hei" "Tms Rmn"="WenQuanYi Micro Hei" EOF regedit ifont.reg
3. rtx2010
wget -c http://dl_dir.qq.com/qqfile/rtx/rtxclient2010formal.exe wine rtxclient2010formal
你如果习惯了Tortoisesvn, 那么这个软件应该非常适合你-RabbitVCS
用管理员权限打开文件
sudo vim /etc/apt/sources.list
deb http://ppa.launchpad.net/rabbitvcs/ppa/ubuntu karmic main
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 34EF4A35
sudo apt-get update sudo apt-get install rabbitvcs-cli rabbitvcs-core rabbitvcs-gedit rabbitvcs-nautilus rabbitvcs-thunar thunarx-python
安装完毕后, 注销以下, 重新登录, 在文件夹和文件夹内点击鼠标右键就用RabbitVCS操作工具了。重启 nginx