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