1.虚拟机复制后,更改的相关配置javascript
答:1.从新分配mac地址,点击网络适配器--高级--从新分配mac。php
2.linux里的设置:css
2.1 更改/etc/udev/rule.d/70-perxxxx-net.rules文件,只保留最后的一个,把eth1改为eth0,记住machtml
2.2 更改/etc/sysconfig/network-script/ifcfg-eth0,把HWADDR改为刚才的macjava
2.3 重启mysql
2.yum安装mysql,php增长mysql扩展的时候,提示找不到mysql handlelinux
答:ln -s /usr/lib64/mysql/libmysqlclient.so.16.0.0 /usr/lib/libmysqlclient.songinx
--with-mysql=/usrweb
2.1继续安装pdo_mysql扩展redis
进入pdo_mysql目录下,phpize,
./configure --with-php-config=/usr/lib64/php/bin/php-config --with-pdo-mysql=/usr/
3.php编译的时候通常配置
./configure --prefix=/usr/lib64/php --enable-mbstring --enable-soap --enable-fpm --enable-maintainer-zts -enable-inline-optimization --enable-pcntl --with-openssl --with-curl -enable-sockets=shared --with-mysql=shared,mysqlnd --enable-opcache --enable-ftp
4. composer中国镜像
答:https://toran.reimu.io/ http://packagist.jp/ http://composer-proxy.jp/
5. linux修改环境变量
/etc/profile export PATH=$PATH:$JAVA_HOME/bin:~/.composer/vendor/bin
source /etc/profile
6.php安装mcrpyt扩展
答:首先须要安装libcrypt,若是是yum安装的libcrypt,则还要安装libcrypt-devel
再回到PHP-5.5.13解压缩的ext目录的mcrypt里面
7.命名空间理解
答:命名空间不会自动加载!!!所以须要用某个命名空间时,要包含进来,或者自动加载
做用:一个命名空间就至关于一个大的房间(文件夹),在里面能够定义任何名称的方法(文件),在A文件里包含后,若是A文件里有和命名空间中相同的方法,是不会冲突的,若是没有命名空间,就会冲突;
8.遮罩层快速实现
1 <style type="text/css"> 2 #bg{ display: none; position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index:1001; -moz-opacity: 0.7; opacity:.70; filter: alpha(opacity=70);} 3 #show{display: none; position: absolute; top: 25%; left: 22%; width: 53%; height: 49%; padding: 8px; border: 8px solid #E8E9F7; background-color: white; z-index:1002; overflow: auto;} 4 </style> 5 <div id="bg"></div> 6 <div id="show">测试 7 <input id="btnclose" type="button" value="Close" onclick="hidediv();"/> 8 </div> 9 10 <script language="javascript" type="text/javascript"> 11 function showdiv() { 12 document.getElementById("bg").style.display ="block"; 13 document.getElementById("show").style.display ="block"; 14 } 15 function hidediv() { 16 document.getElementById("bg").style.display ='none'; 17 document.getElementById("show").style.display ='none'; 18 } 19 </script>
9. 安装pdo_mysql扩展
./configure --with-php-config=/usr/local/php/bin/php-config --with-pdo-mysql=/data/mysql/bin/mysql_config
10.MySQL int型长度
最近在使用mysql时才真正搞清楚int(11)中11的真正含义,之前只是简单的觉得是用来表示存储最大为11位长的整数,其实没有那么简单,
int类型规定只占用4个字节,最长也就是32位,当用有符号数表示时最大值为2147483647,无符号数表示时最大值位4294729693,
因而可知,这个数字只是指定最大显示长度,因此int(10)、int(11)、int(12)应该没有什么区别,由于最大数值也就是10位。
另外,若是用php中的intval转换mysql中的int(11)表示的数值时,最大也只能转换2147483647,再大的话就会溢出。看来php和mysql仍是一致的。
11.unix环境高级编程apue
apue.h头文件为做者本身编写而非系统自带,故须要自行添加!
第一:打开网站 http://www.apuebook.com/
第二:选择合适的版本(一共有三个版本,根据书的版本选择)下载源码source code
解压: tar -zxvf src.2e.tar.gz
获得apue.2e
复制apue.h 到 /usr/include/下: cp ./apue.2e/include/apue.h /usr/include/
复制error.c 到 /usr/include/下: cp ./apue.2e/lib/error.c /usr/include/
第三:编辑/usr/include/apue.h文件
在文件最后#endif前加上包含error.c代码: #include "error.c"
12.通常php配置php.ini
function utf8Substr($str, $from, $len) { return preg_replace('#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$from.'}'. '((?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){0,'.$len.'}).*#s', '$1',$str); }
14.经常使用端口占用
21 ftp
22 ssl
23 telnet
80 web
3306 mysql
6379 redis
9000 php-fpm
4730 gearman
15.ASCII字符能够以\x##
形式的十六进制表示,
'\x41' 彻底等同于 'A'
用\u####
表示一个Unicode字符:
'\u4e2d\u6587'; // 彻底等同于 '中文'
16.rsa公钥私钥生成
genrsa -out rsa_private_key.pem 1024
生成私钥
rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem
生成公钥
17.nginx安装ssl模块configure时要指定开启ssl,并且须要依赖openssl./configure --with-http_ssl_module --with-openssl=/home/kang/Downloads/openssl-1.0.1sopenssl地址不是安装目录,是源码目录genrsa -out rsa_private_key.pem 1024rsa -in rsa_private_key.pem -pubout -out rsa_public_key.pem