This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name www.diaochayun.cn diaochayun.cn; | |
root "C:/phpStudy/PHPTutorial/WWW/newdiaocha/public"; #把\斜线改为/ | |
location / { | |
index index.html index.htm index.php; | |
#autoindex on; | |
if (!-e $request_filename) { | |
rewrite ^(.*)$ /index.php?s=/$1 last; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/sunnyos/ngrok | |
ngrok一键安装脚本,适用于Centos版本服务器 | |
默认安装路径 | |
git:/usr/local/git | |
go:/usr/local/go | |
ngrok:/usr/local/ngrok | |
#使用说明: chmod +x ngrok.sh | |
sh ./ngrok.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
一个TCP可以包含多个http请求 | |
需要在服务器上设置返回给客户端。其实客户端跨域访问服务器的时候,已经得到返回值了,服务器是不限制跨域的,是浏览器把返回来的数据认为不在同一个服务器上返回的数据不安全,所以给忽略并提示错误 | |
“Access-Control-Allow-Origin”: "*" //允许来之域名为所有的请求 | |
“Access-Control-Allow-Headers", "Origin,No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With, userId, token" | |
”Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE" //请求允许的方法 | |
“Access-Control-Max-Ag", "3600" //身份认证(预检)后,xxS以内发送请求不在需要预检,既可以直接跳过预检,进行请求。 | |
content-type:以下3种类型不需要申请xxs预请求 | |
multipart/form-data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
memcached 是服务器 | |
因为是服务器,只需要安装memcached应用就可以了,具体安装下面有介绍, | |
libmemcached 是客户端 | |
客户端需安装libmemcached库,php的扩展memcached,因为该扩展是依赖libmemcached的API | |
PHP7必须使用这个版本 | |
https://github.com/php-memcached-dev/php-memcached/archive/php7.zip #这个可以指定libmemcached路径 | |
https://github.com/websupport-sk/pecl-memcache/archive/php7.zip #这个不可以指定libmemcached路径 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://blog.chinaunix.net/uid-21977056-id-4310527.html | |
Linux系统下的64位DEB包: http://pan.baidu.com/s/1nt9JW6l | |
Linux系统下的32位DEB包: http://pan.baidu.com/s/1sjk9vhN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------keys操作--------------------- | |
//查询指定key是否存在 | |
exists key | |
//随机返回一个键名 | |
randomkey | |
//删除Key | |
del key1 key2 keyN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.kancloud.cn/shaoguan/phpfunction/379699 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=========================================局部安装============================================== | |
//下载composer.phar | |
wget https://getcomposer.org/download/1.6.4/composer.phar | |
//检查是否下载成功 | |
php composer.phar | |
=========================================全局安装============================================== | |
//请不要使用root身份运行composer命令 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ubuntu下必须安装apt-get -y install libfreetype6-dev | |
//开始安装,首先要下载php-5.4.45.tar.gz源码包。 | |
# tar xzvf php-5.4.45.tar.gz | |
# cd php-5.4.45 | |
# ./configure --prefix=/usr/local/php54 --with-config-file-path=/usr/local/php54/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir=/usr/local/freetype --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --disable-fileinfo --enable-intl --with-xsl | |
# make ZEND_EXTRA_LIBS='-liconv' | |
# make install | |
# cp php.ini-production /usr/local/php/etc/php.ini |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ubuntu php 5.5.38 要安装 swoole 版本1.9.22 | |
cd swoole | |
/usr/local/php5.5.38/bin/phpize | |
./configure --with-php-config=/usr/local/php5.5.38/bin/php-config | |
./configure --enable-openssl --enable-async-redis --enable-coroutine --with-php-config=/usr/local/php/bin/php-config | |
make | |
sudo make install | |
========================================================== |