解决【FastCGI 进程超过了配置的活动超时时限】
近日,需要满足测试需求,进行大数据并发测试时,报出【HTTP 错误 500.0 – Internal Server Error E:\PHP\php-cgi.exe – FastCGI 进程超过了配置的活动超时时限】 解决办法: IIS7->FastCGI设置->双击"php-cgi.exe"->"活动超时" 项默认是设置为70(秒),改为600(10分钟,此处根据需求设置可以略高~) from:http://blog.csdn.net/abandonship/article/details/8730524
View Details在Mac如何启动MySQL
安装好MySQL服务后(安装步骤可以参考系列经验1)。打开“系统偏好设置”,单击下端的“MySQL”图标。 在“MySQL”对话框中,单击“启动MySQL服务”按钮。 在弹出的窗口中,输入管理员密码,然后单击“好”按钮。 在“MySQL”对话框中,MySQL服务的状态显示为:如下状态表示MySQL服务已经启动。 使用终端登录MySQL: 在Finder的侧边栏中单击“应用程序”,然后在“实用工具”中,双击启动“终端”命令。 在终端中输入添加MySQL路径的命令: PATH="$PATH":/usr/local/mysql/bin 在终端登录到MySQL的命令如下:mysql -u root -p 然后输入密码,如果没有设置密码,直接按enter键。 如果显示的内容如下,即是已经成功登录到MySQL服务。
View DetailsMac下启动Apache
1.启动 sudo apachectl -k start 2.重新启动 sudo apachectl -k restart //——————————————————————— 设置Apache容器默认目录(不会命令行的朋友可以参考下面的常用命令) 1.Apache配置文件所在目录 cd /etc/apache2/ 2.修改Apache配置文件 sudo vim httpd.conf 3.查找 DocumentRoot 字符串。“/”为查找定位的意思 /DocumentRoot 4. 将上述查找到的木木修改为自己想要的目录即可。 5.重新启动Apache。 //———————————————————————-- 常用命令:
1 2 3 4 5 6 7 8 9 10 11 12 |
vim中有两种模式 命令模式,用于输入命令(注意输入法要在英文状态) shift+V 可以选中一行 y 复制一行 p 在当前行下方粘贴复制的内容 d$ 删除到行尾 x 删除一个字符 :wq 保存退出 :q! 不保存退出 i 进入编辑模式 编辑模式:用于编辑按ESC可以切换回命令模式 |
//—————————————————————- 若要支持PHP,执行如下: 1. cd /etc/apache2 sudo vim httpd.conf /php #LoadModule php5_module … 2.按字母x,删除#,然后按ESC,输入:wq退出编辑器 cd /etc/ 3.复制一份php.ini sudo cp php.ini.default php.ini 4.重新启动Apache服务器 命令回顾说明:
1 2 3 4 5 |
cd /etc/apache2/ 进入apache的配置文件目录 sudo cp file1 file2 将file1复制到file2 sudo vim httpd.conf 使用vim打开httpd.conf文件 sudo apachectl -k start 启动apache sudo apachectl -k restart 重新启动apache |
from:http://www.cnblogs.com/surge/p/4168220.html
View Detailsmac配置nginx+php
系统: OS X Yosemite 10.10.1 系统自带php和php-fpm 路径备注:
1 2 3 4 |
php.ini: /etc/ php-fpm.conf:/etc/ nginx.conf:/usr/local/etc/nginx/nginx.conf nginx 默认root:/usr/local/opt/nginx/html |
1.安装nginx,我使用了brew
1 |
brew install nginx |
2.启动php-fpm
1 |
sudo php-fpm |
如果报错的话,复制php-fpm.conf.default一份,修改php-fpm.conf的error_log 存放的路径或启动的端口 3.打开nginx.conf 开启php的注释,配置好自己的root
1 2 3 4 5 6 7 |
location ~ \.php$ { root /Users/maming/php; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } |
注意
1 2 3 4 5 |
SCRIPT_FILENAME /script$fastcgi_script_name; 要改成 SCRIPT_FILENAME $document_root$fastcgi_script_name; |
否则回报文件不存在的。 4.开启nginx
1 2 3 4 |
sudo nginx 或重启 sudo nginx -s reload |
from:http://www.2cto.com/os/201504/390021.html
View DetailsNginx配置文件nginx.conf中文详解
#定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为等于CPU总核心数。 worker_processes 8; #全局错误日志定义类型,[ debug | info | notice | warn | error | crit ] error_log /var/log/nginx/error.log info; #进程文件 pid /var/run/nginx.pid; #一个nginx进程打开的最多文件描述符数目,理论值应该是最多打开文件数(系统的值ulimit -n)与nginx进程数相除,但是nginx分配请求并不均匀,所以建议与ulimit -n的值保持一致。 worker_rlimit_nofile 65535; #工作模式与连接数上限 events { #参考事件模型,use [ kqueue | rtsig | epoll | /dev/poll | select | poll ]; epoll模型是Linux 2.6以上版本内核中的高性能网络I/O模型,如果跑在FreeBSD上面,就用kqueue模型。 use epoll; #单个进程最大连接数(最大连接数=连接数*进程数) worker_connections 65535; } #设定http服务器 http { include mime.types; #文件扩展名与文件类型映射表 default_type application/octet-stream; #默认文件类型 #charset utf-8; #默认编码 server_names_hash_bucket_size 128; #服务器名字的hash表大小 client_header_buffer_size 32k; #上传文件大小限制 large_client_header_buffers 4 64k; #设定请求缓 client_max_body_size 8m; #设定请求缓 sendfile on; #开启高效文件传输模式,sendfile指令指定nginx是否调用sendfile函数来输出文件,对于普通应用设为 on,如果用来进行下载等应用磁盘IO重负载应用,可设置为off,以平衡磁盘与网络I/O处理速度,降低系统的负载。注意:如果图片显示不正常把这个改成off。 autoindex on; #开启目录列表访问,合适下载服务器,默认关闭。 […]
View DetailsMac下编译php,Configure Error: Please specify the install prefix of iconv with --with-iconv=
Configure Error: Please specify the install prefix of iconv with --with-iconv=<DIR> 解决: ./configure --without-iconv
View DetailsMac OS X下重启apache
打开终端 重启apache:sudo /usr/sbin/apachectl restart 关闭apache:sudo /usr/sbin/apachectl stop 开启apache:sudo /usr/sbin/apachectl start from:http://blog.csdn.net/nightelve/article/details/7935795
View DetailsMAC OSX 10.10 下安装PHP环境
Apache和PHP已经在系统里面预装好了,只要你开启即可使用。这篇文章给大家介绍如何开启并设置好PHP开发环境。 1.开启默认Apache服务 打开终端命令行,输入如下命令就会开启Apache了.然后输入top命令查看进程是否含有http。
1 |
sudo apachectl start |
2.修改Apache配置文件 在Finder右键点击“前往文件夹”后输入“/etc/apache2/ ”然后打开httpd.conf。我们要修改开启PHP组件和虚拟目录。 去掉在168、169行的#号
1 2 |
LoadModule rewrite_module libexec/apache2/mod_rewrite.so LoadModule php5_module libexec/apache2/libphp5.so |
211行前面加上#号
1 |
#Require all denied |
修改默认目录
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
DocumentRoot "/Users/wise/site/default" <Directory "/Users/wise/site/default"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options FollowSymLinks Multiviews MultiviewsMatch Any # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # AllowOverride FileInfo AuthConfig Limit # AllowOverride All # # Controls who can get stuff from this server. # Require all granted </Directory> |
虚拟目录,修改文件/etc/apache2/extra/httpd-vhosts.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
#默认目录 <VirtualHost *:80> DocumentRoot "/Users/wise/site/default" ServerName default </VirtualHost> #工具 <VirtualHost *:80> DocumentRoot "/Users/wise/site/db" ServerName db </VirtualHost> #个人项目 <VirtualHost *:80> DocumentRoot "/Users/wise/site/jinzhe" ServerName jinzhe <Directory "/Users/wise/site/jinzhe"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot "/Users/wise/site/yckit" ServerName yckit <Directory "/Users/wise/site/yckit"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot "/Users/wise/site/dmku" ServerName dmku <Directory "/Users/wise/site/dmku"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> #私人项目 <VirtualHost *:80> DocumentRoot "/Users/wise/site/sms" ServerName sms </VirtualHost> <VirtualHost *:80> DocumentRoot "/Users/wise/site/icrobot" ServerName icrobot <Directory "/Users/wise/site/icrobot"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot "/Users/wise/site/lbdlq" ServerName lbdlq <Directory "/Users/wise/site/lbdlq"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> <VirtualHost *:80> DocumentRoot "/Users/wise/site/baidu" ServerName baidu <Directory "/Users/wise/site/baidut"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> #公司项目 <VirtualHost *:80> DocumentRoot "/Users/wise/site/fishernuts" ServerName fishernuts <Directory "/Users/wise/site/fishernuts"> Options FollowSymLinks AllowOverride All Require all granted </Directory> </VirtualHost> |
3.修改HOSTS文件 在Finder右键点击“前往文件夹”后输入“/etc ”然后打开hosts。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
#工具 127.0.0.1 db #个人项目 127.0.0.1 jinzhe 127.0.0.1 dmku 127.0.0.1 yckit 127.0.0.1 yckit.api #私单项目 127.0.0.1 sms 127.0.0.1 icrobot 127.0.0.1 lbdlq 127.0.0.1 baidu 127.0.0.1 jcm #公司项目 127.0.0.1 fishernuts |
4.安装MYSQL 到官网下载:http://dev.mysql.com/downloads/mysql/ 选DMG格式的就好了。他会帮你一键安装好。 复制出一份。php.ini
1 |
cp /etc/php.ini.default /etc/php.ini |
创建mysql socket(不设置这个无法连接phpmyadmin)
1 2 |
sudo mkdir /var/mysql sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock |
然后修改php.ini中的内容(原因是连接时候php默认去找/var/mysql/mysql.sock了,但是MAC版本的MYSQL改动了文件的位置,放在/tmp下了。)
1 |
mysql.default_socket = /tmp/mysql.sock |
设置别名和密码
1 2 3 |
alias mysql='/usr/local/mysql/bin/mysql' alias mysqladmin='/usr/local/mysql/bin/mysqladmin' mysqladmin -u root password "123456" |
from:http://jinzhe.net/post/32.html
View Details在Mac上安装Nginx
1. 安装PCRE Download latest PCRE. After download go to download directory from terminal. $ cd ~/Download $ tar xvzf pcre-8.12.tar.gz $ cd pcre-8.12 $ sudo ./configure --prefix=/usr/local $ sudo make $ sudo install 2. 安装Nginx Download latest nginx from Nginx.org. After download, let install $ cd ~/Download $ tar xvzf nginx-1.0.0.tar.gz $ cd nginx-1.0.0 $ sudo ./configure --prefix=/usr/local --with-http_ssl_module --with-ld-opt="-L /usr/local/lib" $ sudo make $ sudo make install 3. 运行Nginx $ cd /usr/local/sbin $ sudo ./nginx 访问http://localhost 4. 关闭Nginx $ cd /usr/local/sbin $ sudo […]
View DetailsMac OS X 中快速访问系统根目录的四种方法
就像其他Unix系统一样,Mac OS X的根目录也是/,Finder中的根目录就是硬盘目录,也就是Macintosh HD。新版本的OS X系统开始隐藏根目录,因为大多数用户不需要访问。下面为大家介绍四种快速访问根目录的方法。 1:通过“前往文件夹”快捷键组合 “前往文件夹”可能是OS X系统Finder中最常用的操作了,用户只需点击左上角的“前往”菜单,然后选择“前往文件夹…”功能。使用快捷键+Shift+G也可以快速激活“前往文件夹”功能,窗口打开后,输入“/”并回车即可。 2:将Macintosh HD快捷方式放入Finder侧边栏 对于经常要访问根目录的用户来说,将Macintosh HD快捷方式会更高效一些。在任何文件夹内(除了“我的所有文件”)右键点击标题栏,然后选择Macintosh HD。最后将Macintosh HD左侧的硬盘图标拖拽至侧边栏即可完成操作。以后需要访问根目录时,只需点击侧边栏的快捷方式即可。 3:在桌面上显示硬盘 打开Finder的“偏好设置”,在“通用”模式下在“硬盘”前面的方块内勾选即可。这样桌面上就会有Macintosh HD,双击即可访问。 4:使用命令行迅速导航 打开终端应用,然后输入下面的命令即可迅速导航至根目录。 cd / 复制代码 上面的命令是在终端中访问根目录,如果你想通过终端打开Finder的根目录,只需下面的命令即可: open / 复制代码 from:http://www.macx.cn/thread-2080254-1-1.html
View Details