博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
PHP xdebug配置和php及nginx网站启用方式
阅读量:7050 次
发布时间:2019-06-28

本文共 3145 字,大约阅读时间需要 10 分钟。

1)通过不同的php版本下载不同版本的xdbug,如php版本为php-5.4.15-Win32-VC9-x86,可参考下载php_xdebug-2.2.1-5.4-vc9.dll,放置在php/ext目录下.
注:不同的xdebug有
分nts版本和无nts版本.
2)在php.ini文件末尾添加
;onload Xdebug
;注意:
zend_extension_nts ="F:/php/ext/php_xdebug-2.2.2-5.4-vc9-nts.dll"
zend_extension="F:/php/ext/php_xdebug-2.2.1-5.4-vc9.dll"
 
;xdebug configuration
[Xdebug]
 
xdebug.auto_trace = On
 
xdebug.show_exception_trace = On
 
xdebug.remote_autostart = On
 
xdebug.remote_enable = On
 
xdebug.collect_vars = On
 
xdebug.collect_return = On
 
xdebug.collect_params = On
3)在eclipse->window->Preferences针对xdebug调试进行Debug\PHP Executables\PHP Servers选项进行配置,
默认xdebug调试端口为9000
4)网站启用配置采用Nginx和php配合,使用方法如下:
F:\nginx-1.5.0\nginx.exe;
f:/php/php-cgi.exe -b 127.0.0.1:9999 -c f:/php/php.ini
二者后台运行,同时配置nginx/conf中的nginx.conf文件,如下:
worker_processes 1;
error_log  f:/nubia/www/logs/nginx_error.log  error;
pid        f:/nubia/www/logs/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 1024;
events
{
  worker_connections 64;
}
http
{
    include       mime.types;
    default_type  application/octet-stream;
    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';
    #access_log  logs/access.log  main;
    
    tcp_nodelay     on;
    sendfile        on;
    tcp_nopush     on;
    
    server_tokens off;     #关闭版本显示
    keepalive_timeout  60;
    #设定请求缓冲
    server_names_hash_bucket_size 128;
    client_header_buffer_size    16k;
    large_client_header_buffers  4 64k;
    client_max_body_size 8m;
    
    proxy_connect_timeout   300;
    proxy_send_timeout      300;
    proxy_read_timeout      300;
    proxy_buffer_size       128k;
    proxy_buffers           4 256k;
    proxy_busy_buffers_size 256k;
    proxy_temp_file_write_size 64m; 
    proxy_ignore_client_abort on;
    
    open_file_cache max=204800 inactive=20s;
    open_file_cache_min_uses 1;
    open_file_cache_valid 30s;
  
    #开启gzip模块
    gzip on;
    gzip_min_length  1k;
    gzip_http_version 1.1;
    gzip_buffers     4 16k;
    gzip_comp_level 2; #0-9 默认值为1,值越大压缩率越高,消耗的cpu资源越多,传输量减小
    gzip_types       text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    gzip_vary on;
    
    #gzip_static on;
    gzip_proxied        any;
    gzip_disable    "MSIE [1-6]\.";
    
    output_buffers   1 32k;
    postpone_output  1460; 
server {
listen          80;
include        rewrite_nubia.conf;
access_log   off;
location / {
index  index.html index.htm index.php;
root   F:/nubia/www/zte_bbs;
expires      30d;
}
location ~ \.php$ {
fastcgi_pass   127.0.0.1:9999;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME  F:/nubia/www/zte_bbs$fastcgi_script_name;
include        fastcgi_params;
}
}
server {
listen          8180;
access_log   off;
location / {
index  index.html index.htm index.php;
root   F:/Discuz_X2.5_SC_UTF8/upload;
expires      30d;
}
location ~ \.php$ {
fastcgi_pass   127.0.0.1:9000;
fastcgi_index  index.php;
fastcgi_param  SCRIPT_FILENAME  F:/Discuz_X2.5_SC_UTF8/upload$fastcgi_script_name;
include        fastcgi_params;
}
}
 
}
nginx支持多server启用,通过访问不同端口启用不同网站
5)
在使用php和nginx即可通过网址访问后台,但在加入xdebug后发现网址无法访问,nginx 504 gateway Timeout(网关超时),后通过nginx.conf中的error_log路径查看错误log,发现在使用php-cgi.exe端口配置为9000,与上述xdebug默认端口冲突,重新修改下php-cgi端口即可.

转载于:https://www.cnblogs.com/wangtale/archive/2013/06/05/3119092.html

你可能感兴趣的文章
rsync文件同步工具介绍 、常用选项 、通过ssh同步
查看>>
防御ddos攻击的常见方法
查看>>
线下工坊|Blockchain Coding Day:零基础教你开发DAPP(北京)
查看>>
设计模式——策略模式
查看>>
依存句法分析器的简单实现
查看>>
用node.js开发Fabric链码
查看>>
加密解密
查看>>
企业分布式微服务云SpringCloud SpringBoot mybatis (十四)服务注册(consul)
查看>>
df命令,du命令,磁盘分区
查看>>
JNDI到底是什么
查看>>
JS 学习笔记
查看>>
渣渣菜鸡为什么要看 ElasticSearch 源码?
查看>>
JavaEE的13种核心技术
查看>>
spring mvc +mybatis + KafKa+Flume+Zookeeper分布式架构
查看>>
css3的设置颜色透明度的笔记
查看>>
Selenium WebDriver API 进阶使用,模块化参数化进行自动化测试设计
查看>>
用jQuery打造个性网站
查看>>
JQuery-zTree.js使用范例
查看>>
分布式消息通信ActiveMQ
查看>>
LAMP架构介绍以及MySQL安装
查看>>