Home >Backend Development >PHP Tutorial >安装PHP的mysql扩展

安装PHP的mysql扩展

WBOY
WBOYOriginal
2016-06-23 14:29:021125browse

wget http://blog.s135.com/soft/linux/nginx_php/pdo/PDO_MYSQL-1.0.2.tgz#wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgztar zxvf PDO_MYSQL-1.0.2.tgzcd PDO_MYSQL-1.0.2//usr/local/webserver/php/bin/phpize./configure --with-php-config=/usr/local/webserver/php/bin/php-config --with-pdo-mysql=/usr/local/webserver/mysqlmakemake installcd ../

修改php.ini,添加"extension = pdo_mysql.so"

<?php $pdo = new PDO(     'mysql:host=hostname;dbname=defaultDbName',     'username',     'password',     array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8") ); ?> 



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:开始学习PHP了.Next article:[php]安装nanoweb笔记