php oracle pdo_mysql
来源:互联网 发布:saas软件排名 编辑:程序博客网 时间:2024/05/22 23:15
准备安装环境:
CentOS release 6.3 (Final)
查看linux内核版本、系统信息: uname -a; more /etc/issue; cat /proc/version
php5.3
查看php版本 php -v
nginx1.6
查看nginx版本 nginx -v
需要安装:oracle客户端、pdo_oci扩展、oci8扩展
1.下载oracle客户端:
下载地址:http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
2.安装oracle客户端
rpm -ivh oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm
3.配置oracle
1)添加动态加载器
echo "/usr/lib/oracle/12.1/client64/lib/" > /etc/ld.so.conf.d/oracle_client.conf
/sbin/ldconfig
4.下载oci8
wget http://pecl.php.net/get/oci8-2.0.8.tgz
tar oci8-2.0.8.tgz
cd oci8-2.0.8
5.编译安装
CFLAGS="-I/usr/lib/oracle/12.1/client64"
CXXFLAGS="-I/usr/lib/oracle/12.1/client64"
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-oci8=shared,instantclient,/usr/lib/oracle/12.1/client64/lib
make && make install
6.在php.ini配置文件增加扩展
/usr/local/php/etc/php.ini
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626"
extension = "oci8.so"
7.因为修改了php.ini需要重新加载配置文件,安装完成后需要重启 PHP-FPM (FastCGI Process Manager)
ps -ef |grep 'php-fpm' 查看进程
kill -QUIT 1821 退出
php-fpm -t php.ini 测试php-fpm配置
php-fpm -c php.ini 指定加载php.ini 配置文件
php -i | grep 'oci' 查看是否安装成功
另:如果报这个错:
ORA-24408: could not generate unique server group name
如果设置了主机名需要在 /etc/host 增加:127.0.0.1 localhost.localdomain php-uat01
查看主机名:export
PHP pdo_mysql
1. 找到php的phpize
[root@php1 bin]# cd /opt/php-5.3.28/ext/pdo_mysql
[root@php1 sockets]# /usr/local/php/bin/phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
[root@php1 sockets]#./configure --with-php-config=/usr/local/php/bin/php-config
[root@php1 sockets]#make && make install
----------------------------------------------------------------------
Libraries have been installed in:
/opt/php-5.3.28/ext/pdo_mysql/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,--rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
- php oracle pdo_mysql
- php 5.2 + pdo_mysql安装
- php 添加pdo_mysql扩展
- 安装php pdo_mysql
- php添加pdo_mysql扩展
- 使php支持pdo_mysql
- PHP 扩展pdo_mysql
- 使php支持pdo_mysql
- php 安装 pdo_mysql
- Linux下PHP扩展pdo_mysql
- php扩展之 pdo_mysql.so
- php安装扩展 pdo_mysql.so
- PHP源码编译pdo、pdo_mysql
- Linux下PHP扩展pdo_mysql
- 编译php支持curl和pdo_mysql
- 为macos的php配置pdo_mysql扩展
- PHP extension "pdo_mysql" must be loaded.
- 为php单独编译pdo_mysql.so组件
- navigationController.navigationBar.hiden 导航栏隐藏引发的坐标自动变更
- Android内嵌网页webview点击其中的链接跳转到我们应用内的Activity
- How-to find the SQL that using lots of temp tablespace in Oracle
- JBOSS性能优化
- MyISAM InnoDB 区别
- php oracle pdo_mysql
- 一招搞定win8系统无线网络经常受限问题
- 分享组件集成
- Nginx反向代理中配置gzip压缩
- 【原创】TCP Socket 简单练习 --- 线程池实现并发服务器
- 关于Apple移动设备处理器指令集 armv6、armv7、armv7s及arm64
- .net 获取当前日期是星期几
- 围观围观
- 素数问题