嗯。很有用,抄袭过来保存到

1.使用PHP+Swoole实现的网页即时聊天工具

git地址:https://github.com/matyhtf/php-webim.git

连接地址::https://github.com/matyhtf/php-webim


2.linux安装swoole扩展

git下载地址:https://github.com/swoole/swoole-src.git

扩展安装地址:https://my.oschina.net/surjur/blog/309664

3.linux安装nignx、php、mongodb环境

1.epel扩展源

rpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/7/x86_64/e/epel-release-7-9.noarch.rpm

2.php-remi源

rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

3.nginx源

rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm(数据源可以更换)

4.安装php+extensions+redis+other

yum --enablerepo=remi-php56 install php php-fpm php-opcache php-mongo php-redis php-mbstring php-mcrypt php-geoip php-gd

5.安装nginx

yum install nginx

6.安装sockets扩展

yum install --enablerepo=remi-php56  php-sockets

7.修改nginx配置文件

vi /etc/nginx/conf.d/virtual.conf

```
//配置一:普通http配置
   server {
            listen       80;
            server_name  localhost;
            root  /var/www/html;
            location / {
                if (!-f $request_filename) {
                        rewrite ^([^\?]+)$ /index.php?q=$1 last;
                    }
                }
                location = / {
                    rewrite .*? /index.html last;
                }
                location ~ \.php$ {
                root           /var/www/html;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME $document_root/$fastcgi_script_name;
                include        fastcgi_params;
            }
        }

//配置一:https配置
//(1)标准https配置
    server {
            listen 443 ssl;
            ssl on;
            ssl_certificate  /etc/nginx/conf.d/server.crt;
            ssl_certificate_key  /etc/nginx/conf.d/server_nopwd.key;
            server_name  www.zhoubianshuo.cn;
            root  /var/www/html1/momo;
            client_max_body_size    100m;
            location / {
                if (!-f $request_filename) {
                        rewrite ^([^\?]+)$ /index.php?q=$1 last;
                    }
                }
                location = / {
                    rewrite .*? /index.html last;
                }
                location ~ \.php$ { 
                root           /var/www/html1/momo;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME $document_root/$fastcgi_script_name;
                include        fastcgi_params;
            }
        }
    //(2)http访问需进行跳转,资源不跳转
    server {
            listen  80;
            server_name  www.zhoubianshuo.cn;
            root  /var/www/html1/momo;
            client_max_body_size    100m;
            location / {
                #若不是资源  则进行跳转
                rewrite ^/(.*)$ https://$host/$1 redirect;
                    if (!-f $request_filename) {
                    rewrite ^([^\?]+)$ /index.php?q=$1 last;

                }

            }
            location = / {
                rewrite .*? /index.html last;
            }


            location ~ \.php$ {
                    root           /var/www/html1/momo;
                    fastcgi_pass   127.0.0.1:9000;
                    fastcgi_index  index.php;
                    fastcgi_param  SCRIPT_FILENAME $document_root/$fastcgi_script_name;
                    include        fastcgi_params;
                }
                location /static {
                    #若是资源则不跳转
                    #       rewrite ^/(.*)$ https://$host/$1 redirect;
            }

        } 


    server {
            listen       81;
            root   /var/www/momo;
            client_max_body_size  50M;
            server_name  www.wv5.com.cn;
            #   server_name  localhost;

            location   ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico)$
                {
                    expires       30d;
                    if (!-f $request_filename) {
                         #     rewrite ^([^\?]+)$ /index.php?q=$1 last;
                    }
            }

            location / {
                rewrite ^/(.*)$ https://$host:444/$1 redirect;

            }
        }

8.备份配置

mv /etc/nginx/conf.d/default.conf{,.bak}

9.启动操作

1. 启动/重启nginx

    nginx -t  测试重启是否正常
    service nginx restart/start 

2.启动/重启php

    service php-fpm restart/start 

3.启动/重启 mongodb

    service mongod restart/start 

4.Mongodb 单独安装

(1)mongodb单独安装:http://my.oschina.net/newlooper/blog/598268

(2)进入shell
Mongo


5.linux dns服务器地址

vi /etc/resolv.conf

6.nginx 编译安装(文艺青年)

http://www.169it.com/article/14124376353258130009.html


7.websocket原理解析(2B青年版)

https://www.zhihu.com/question/20215561


8.nginx搭建https服务器

http://www.cnblogs.com/tintin1926/archive/2012/07/12/2587311.html


9.nginx系统的网络服务与此版本的网络管理器不兼容解决办法

http://www.2cto.com/os/201303/194713.html

1.简化操作

NetworkManager

10.部分协议https请求规则重写

http://www.linuxidc.com/Linux/2013-08/88272.htm

1.https server下加入如下配置:

  1. if ($uri !~* "/logging.php$")
  2. {
  3. rewrite ^/(.*)$ http://$host/$1 redirect;
  4. }

2.在http server下加入如下配置:

  1. if ($uri ~* "/logging.php$")
  2. {
  3. rewrite ^/(.*)$ https://$host/$1 redirect;
  4. }
结果:最后结果就是,用户会且只会在访问logging.php的情况下,才会通过https访问。有效地避免了arp欺骗、嗅探等方法盗取账号密码的行为。

11.跨站攻击思路


12.数据库并发锁处理 (数据库锁及文件锁的差异)

13.绕过WAF防火墙思路,sqlmap(神器)


14.linux 临时开放80端口


15.php连接MONGODB出现的”Permission denied”

  • setsebool httpd_can_network_connect
  • setsebool httpd_can_network_connect_db 1

16.防止页面刷新重复提交

  • 1、提交页面
  1. <?php
  2. session_start();
  3. $t=mktime();
  4. $_SESSION['conn_id']=$t;
  5. $_SESSION['conn']=$t;
  6. var_dump($_SESSION);
  7. var_dump($_COOKIE);
  8. ?>
  9. <html>
  10. <head>
  11. <title>防止刷新提交或者重新提交</title>
  12. </head>
  13. <body>
  14. <form method="POST" action="get.php">
  15. <span>username:</span><input type="text" name="username" id="username"><br>
  16. <input type="hidden" name="hidden" id="hidden" value="<?php echo $_SESSION['conn_id']?>">
  17. <span>message:</span><input type="text" name="message" id="message"><br>
  18. <input type="submit" value="submit">
  19. </form>
  20. </body>
  21. </html>
  • 2、服务器端接收页面
  1. <?php
  2. session_start();
  3. $username = $_POST['username']."<br>";
  4. $message = $_POST['message'];
  5. $hide = $_POST['hidden'];
  6. var_dump($_SESSION);
  7. if($hide==$_SESSION['conn'])
  8. {
  9. echo "亲,提交成功了哦";
  10. }else
  11. {
  12. echo "<script>alert('亲!就知道你会刷新提交,stop 你已经提交成功啦');</script>";
  13. echo "<script>window.location.href='index.php';</script>";
  14. }
  15. session_destroy();
  16. ?>

17.书籍推荐

18.php7 操作mongodb示例

19.mongdob修改数据库表名称

  1. db.adminCommand({renameCollection: "douban.movie", to: "douban.test2"})

20.猫眼电影api(最低至座位信息)

21.隐藏ip

22.post get等请求模拟工具

  • Chrome中的插件PostMan

23.PHP字符处理函数

  • stripos –获取一字符串在另一字符串中首次出现的位置(不区分大小写,返回位置)例如:
    1. $s =stripos("You love php, I love php too!","PHP");
    2. //返回9
  • mb_substr –截取一字符串其中一部分
    例如:

    1. $s = mb_substr("You love php, I love php too!",4,5);
    2. //返回"love "
    3. //4为起始位置。5为长度,可以不用。
  • preg_match –匹配正则
    例如:
  1. $data = "Content-Type: image/jpeg";
  2. //php中,正则开始结束需用 /正则/ 包含。
  3. $z = "/Content-Type:\s\w+\S\w+/";
  4. preg_match($z, $data, $sum);
  5. //$z为正则,$data为字符串,$sum为匹配结束后将匹配字符串存入变量(可没有),该函数若出现匹配值则为1,否则为0
  • strlen –获取字符串长度

24.二进制文件头,转十六进制判断文件类型

25.文件锁及数据库锁

(1)电商抢购并发的硝烟

26.网络状况api

27.ios推送

28.php多线程pthreads安装

28.linux权限操作

赋予用户文件写权限
  1. chown -R gongyu:gongyu /var/www/html/
  2. 安装pecl
  3. yum install php-pear php-devel

29.微信二次开发

30.及时消息 多台服务器互通

30 php与c++通信

安装Protobuf(3.2对php有bug 需要使用2.6)
– [x] http://hello1010.com/php-protobuf
– [x]

31 php xdebug安装分析工具

32 php闭包基本

33 定时任务

  1. crontab e

34.php位运算符

  1. 1.http://www.111cn.net/phper/php/44197.htm

《嗯。很有用,抄袭过来保存到》有628个想法

  1. I feel that is among the so much significant information for me. And i’m glad studying your article. However should observation on few general issues, The website taste is ideal, the articles is in point of fact excellent D. Just right activity, cheers acaecdbddgcf

  2. Fantastic website. A lot of useful information here. I’m sending it to a few pals ans also sharing in delicious. And naturally, thank you in your sweat! cgkcckddeeke

  3. I really appreciate this post. I have been looking everywhere for this! Thank goodness I found it on Bing. You have made my day! Thx again! kkeckfcfdbdg

  4. That s one of the main things that will get mrs two4you s panties moist.
    She had to grip the lower end of his hard rod with one hand and hold his balls in the other so
    that he wouldn t drive them both down her throat.

  5. [url=http://bupropionsr150mg.us.org/]Bupropion SR 150 Mg[/url] [url=http://viagra247.us.com/]generic viagra online[/url] [url=http://fluoxetine20mg.us.org/]fluoxetine 20 mg[/url]

  6. [url=http://buyclindamycin.shop/]clindamycin[/url] [url=http://buyantabuse.reisen/]antabuse[/url] [url=http://buyanafranil.shop/]anafranil for depression[/url] [url=http://seroquel.directory/]seroquel[/url]

  7. [url=http://buyantabuse.shop/]antabuse without prescription[/url] [url=http://buy-sildalis.shop/]buy sildalis[/url] [url=http://buyzoloft.shop/]zoloft generic brand[/url]

  8. [url=http://lisinopril20mg.us.org/]Lisinopril 20mg[/url] [url=http://bupropionsr150mg.us.org/]bupropion without script[/url] [url=http://trazodone247.us.com/]trazodone 100mg[/url]

  9. [url=http://lisinopril20mg.us.org/]lisinopril buy online[/url] [url=http://effexorxr.us.org/]effexor xr[/url] [url=http://doxycyclineprice.us.org/]doxycycline without a prescription[/url]

  10. [url=http://fluoxetine20mg.us.org/]fluoxetine tablets[/url] [url=http://indocin247.us.com/]indocin[/url] [url=http://hydrochlorothiazide12.us.org/]hydrochlorothiazide[/url]

  11. [url=http://buy-sildenafil.reisen/]buy sildenafil online[/url] [url=http://atenolol.fail/]atenolol 25 mg tablet[/url] [url=http://genericvaltrex.pro/]valtrex[/url] [url=http://buy-rimonabant.shop/]acomplia 20mg rimonabant[/url]

  12. [url=http://effexorxr.us.org/]effexor xr[/url] [url=http://cheapvardenafil365.us.com/]continue reading[/url] [url=http://erythromycin500mg.us.org/]Erythromycin[/url]

  13. [url=http://buy-tretinoin.work/]renova tretinoin cream 0.02[/url] [url=http://buydoxycycline.work/]where to buy doxycycline[/url] [url=http://diclofenac.schule/]diclofenac[/url] [url=http://buyviagrasoft.reisen/]viagra soft[/url]

  14. [url=http://cymbaltageneric.us.org/]generic cymbalta[/url] [url=http://doxycycline100mg.us.org/]buy Doxycycline[/url] [url=http://medrolpack.us.org/]iv solu-medrol[/url]

  15. [url=http://wellbutrinsr.pro/]wellbutrin[/url] [url=http://tetracycline.fund/]tetracycline[/url] [url=http://buystromectol.reisen/]buy stromectol[/url] [url=http://genericlasix.pro/]lasix[/url]

  16. [url=http://kamagra.fund/]kamagra tablets[/url] [url=http://amoxicillin875mg.pro/]amoxicillin[/url] [url=http://clomidcost.pro/]clomid purchase[/url] [url=http://buyaugmentin.reisen/]augmentin[/url]

  17. [url=http://cialis365.us.com/]Order Cialis[/url] [url=http://bupropionsr150mg.us.org/]Bupropion SR 150 Mg[/url] [url=http://fluoxetine247.us.com/]order fluoxetine[/url]

  18. [url=http://buy-celebrex.store/]cost of celebrex[/url] [url=http://tamoxifen.systems/]buy tamoxifen online[/url] [url=http://seroquel.directory/]seroquel[/url] [url=http://sildalis.store/]sildalis[/url]

  19. [url=http://doxycyclineprice.us.org/]cheap doxycycline[/url] [url=http://erythromycin500mg.us.org/]erythromycin 500 mg[/url] [url=http://cephalexin250mg.us.org/]cephalexin[/url]

  20. [url=http://priceoflevitra.pro/]price levitra[/url] [url=http://buy-inderal.store/]buy inderal[/url] [url=http://buyfluoxetine.store/]fluoxetine[/url] [url=http://buy-lipitor.store/]lipitor[/url]

  21. [url=http://avodart.store/]avodart[/url] [url=http://sildalisonline.pro/]sildalis online[/url] [url=http://propranololonline.pro/]propranolol[/url] [url=http://seroquel.directory/]50mg seroquel[/url]

  22. [url=http://buy-rimonabant.shop/]rimonabant[/url] [url=http://buy-ampicillin.store/]ampicillin trihydrate[/url] [url=http://buy-propecia.reisen/]propecia[/url] [url=http://doxycycline100mg.pro/]doxycycline 100 mg forsale outside the us[/url]

  23. [url=http://cephalexin.reisen/]cephalexin[/url] [url=http://buy-rimonabant.shop/]rimonabant[/url] [url=http://buy-provera.reisen/]buy provera[/url] [url=http://buyviagrasoft.reisen/]viagra soft[/url]

  24. [url=http://citalopramhbr20mg.store/]citalopram hbr tabs 20mg[/url] [url=http://buyzoloft.shop/]zoloft[/url] [url=http://buyatarax.store/]atarax 25 mg[/url] [url=http://buy-phenergan.shop/]phenergan without a prescription[/url]

  25. [url=http://lisinopril20mg.us.org/]lisinopril[/url] [url=http://cymbaltageneric.us.org/]cymbalta[/url] [url=http://viagra247.us.com/]order generic viagra online[/url]

  26. [url=http://strattera.shop/]strattera[/url] [url=http://retina.fund/]retin-a[/url] [url=http://tetracycline.tools/]tetracycline[/url] [url=http://tadalafil.reisen/]cialis generic tadalafil[/url]

  27. [url=http://erythromycin500mg.us.org/]erythromycin 500 mg[/url] [url=http://bupropionsr150mg.us.org/]Bupropion 150 mg[/url] [url=http://cephalexin250mg.us.org/]Cephalexin Pills[/url]

  28. Xenical Without Prescription [url=http://cialtobuy.com ]cialis[/url] Order Now Macrobid 100mg Internet France On Line
    Aricept Hong Kong
    Cod Generic Levaquin Drugs Direct Mastercard Accepted Store cialis Cialis 10mg Generique

  29. [url=http://hydrochlorothiazide12.us.org/]hydrochlorothiazide mastercard[/url] [url=http://cephalexin250mg.us.org/]buy cephalexin[/url] [url=http://viagra247.us.com/]generic viagra online[/url]

  30. [url=http://colchicine247.us.com/]buy colchicine[/url] [url=http://effexorxr.us.org/]effexor xr[/url] [url=http://hydrochlorothiazide12.us.org/]hydrochlorothiazide.5 mg[/url]

  31. [url=http://erythromycin500mg.us.org/]example[/url] [url=http://lisinopril20mg.us.org/]lisinopril 20mg[/url] [url=http://bupropionsr150mg.us.org/]bupropion sr 150 mg[/url]