1.yii通過phpmailer傳送郵件
$max_len=80; //60
//----------------
$mailer->subject =$subject;
//$body= preg_replace('/\\\\/','', $body);
$mailer->body =$body;
//$mailer->altbody ="不支援html顯示.\r\n".$body;
$mailer->addaddress($send_mail); // 收件人郵箱和姓名 //,get_email_name($send_mail)
//--------------------
//---------------
$attachment=trim($attachment);
//$attachment=strtoupper($attachment);
if(count($attachments)>0)else
}
}
//--------------------
if(strlen($subject)<=0) return 'error:主題為空.';
if(strlen($body)<=0) return 'error:內容為空.';
if(strlen($body)>$max_len)
//-----------------
if(!$mailer->send()) return $mailer->errorinfo;
else return true;
環境php54w
2.php安裝phalcon框架
#ubuntu
sudo apt-get install gcc make git-core libpcre3-dev php5-dev
#suse
sudo yast -i gcc make php5-devel
#orsudo zypper install gcc make php5-devel
#centos/fedora/rhel
sudo yum install git gcc make pcre-devel php-devel
如果還是報錯
yum install php54w-devel
#solaris
pkg install gcc-45 php-53 apache-php53
3.安裝cphalcon
git clone git:
cd cphalcon/build
sudo ./install
4.在/etc/php.d資料夾下新建乙個檔案phalcon.ini檔案內容如下:
extension=pdo.so
5.重啟tengine 與 php-fpm兩個服務
windows下安裝
2.放到ext資料夾下就可以了
3.重啟apache與php服務
php_pdo_sqlsrv_52_nts.dll
php_pdo_sqlsrv_52_ts.dll
sql server native client這個驅動程式,根據資料庫版本來,目前我用的是sql server 2008,對應的sql server native client 11.0
重啟apache就好了
1.安裝編譯工具及驅動程式
yum install make apr* autoconf automake gcc gcc-c++ wget
2.安裝unixodbc驅動程式
yum -y install unixodbc unixodbc-devel
3.安裝freetds
cd /usr/local/src
gunzip freetds-stable.tgz #解壓
tar -xvf freetds-stable.tar
cd freetds-0.91
./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --with-unixodbc=/usr --enable-msdblib #配置
make #編譯
make install #安裝
4.配置freetds
cp /usr/local/freetds/etc/freetds.conf /usr/local/freetds/etc/freetds.confbak
vi /usr/local/freetds/etc/freetds.conf #在最後位置修改編輯以下內容
[192.168.21.134]
host = 192.168.21.134 #sql server 2000伺服器位址
port = 1433 #sql server 2000資料庫埠
tds version = 8.0 #8.0代表資料庫版本為sql server 2000
client charset = utf-8 #設定字符集為utf-8
#client charset = gbk #設定字符集為gbk
PHP相關知識
mysql命令符 首先登入mysql伺服器 資料夾所在位置 登入mysql命令 1,mysql uroot proot,2,mysql u root p,3,mysql uroot p 實際上都差不多的,大同小異。選中資料庫 use 資料庫名 檢視資料庫中的表 show tables 然後我們可以建...
php相關知識,PHP基礎知識
1.單引號,雙引號 當雙引號中包含變數時,變數會與雙引號中的內容連線在一起 當單引號中包含變數時,變數會被當做字串輸出。world world str1 hello,world hello,world str2 hello,world hello,world echo str1 echo echo ...
PHP配置相關知識集錦
變數名 php.ini development php.ini production error reporting e all e all e deprecated e strict display errors onoff display startup errors onoff track e...