zoukankan      html  css  js  c++  java
  • php访问mysql接口pdo-mysql安装

    php编译的时候加了这个--with-pdo-mysql=mysqlnd和--with-mysql=mysqlnd了,如果php编译时候加了就不用安装;如下说明已经安装了,有了,就不需要安装了,安装了也不会错误的,两个兼容的。

    [root@web01 opcache]# /application/php/bin/php -i|grep configure

    Configure Command =>  './configure'  '--prefix=/application/php5.5.32' '--with-mysql=/application/mysql/' '--with-pdo-mysql=mysqlnd' '--with-iconv-dir=/usr/local/libiconv' '--with-freetype-dir' '--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-fpm' '--enable-mbstring' '--with-mcrypt' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-xmlrpc' '--enable-soap' '--enable-short-tags' '--enable-static' '--with-xsl' '--with-fpm-user=www' '--with-fpm-group=www' '--enable-ftp' '--enable-opcache=no'

    PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0

    [root@web01 opcache]#

    手动安装也不冲突:安装如下:

    wget -q http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz

    tar xf PDO_MYSQL-1.0.2.tgz 

    cd PDO_MYSQL-1.0.2/

    /application/php/bin/phpize

    ./configure  --with-php-config=/application/php/bin/php-config --with-pdo-mysql=/application/mysql

    make

    make install

    ll /application/php5.5.32/lib/php/extensions/no-debug-non-zts-20121212/

    [root@web01 PDO_MYSQL-1.0.2]# make

    /home/oldboy/tools/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:25:19: error: mysql.h: No such file or directory

    In file included from /home/oldboy/tools/PDO_MYSQL-1.0.2/pdo_mysql.c:31:

    /home/oldboy/tools/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:36: error: expected specifier-qualifier-list before 'MYSQL'

    /home/oldboy/tools/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:48: error: expected specifier-qualifier-list before 'MYSQL_FIELD'

    /home/oldboy/tools/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:53: error: expected specifier-qualifier-list before 'MYSQL_RES'

    make: *** [pdo_mysql.lo] Error 1

    这是因为这是因为在编译时需要 MySQL 的头的文件。而它按默认搜索找不到头文件的位置,所以才出现这个问题。通过软连接把MySQL头文件对应到/usr/local/include/下就好
    比如你的MySQL安装文件位于/application/mysql,

    ,那么就执行以下命令:

    [root@web01 PDO_MYSQL-1.0.2]# ln -s /application/mysql/include/* /usr/local/include/

    [root@web01 PDO_MYSQL-1.0.2]# ll /application/php5.5.32/lib/php/extensions/no-debug-non-zts-20121212/

    total 1624

    -rwxr-xr-x 1 root root 258088 Mar  1 10:50 memcache.so

    -rwxr-xr-x 1 root root 543497 Mar 18 18:41 opcache.so

    -rwxr-xr-x 1 root root 158884 Mar 18 20:02 pdo_mysql.so

    -rwxr-xr-x 1 root root 692884 Mar 18 18:19 xcache.so

  • 相关阅读:
    【NumPy】 之常见运算(np.around、np.floor、np.ceil、np.where)(转)
    python3中collections模块(转)
    numpy.random模块用法小结
    生成模型和判别模型(《统计学习方法》截图)
    linux(Ubuntu)下机器学习/深度学习环境配置
    sklearn中predict_proba的用法例子(转)
    机器学习案例实战之信用卡欺诈检测——收获的技术
    分析长期治疗数据显示TNF拮抗剂似乎并未增加严重感染和肿瘤发生风险
    超声在鉴别诊断RA与PsA中的应用价值
    结合超声计数炎症关节的改良版DAS28的临床应用
  • 原文地址:https://www.cnblogs.com/sandshell/p/8597185.html
Copyright © 2011-2022 走看看