|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2012-03-01 16:45 UTC] 4yuinfo at gmail dot com
Description:
------------
update php 5.3.5 to php 5.3.10
php-fpm oci can't run
Test script:
---------------
cat a.php
---------------------------------------------------------
<?php
print oci_connect('login_id', 'login_pw', 'oracle_db');
---------------------------------------------------------
#command line
php -q a.php
Resource id #5
#nginx+php-fpm
502 bad gateway
#apache + perfork
Resource id #3
Expected result:
----------------
oci8 run to php-fpm can work
Actual result:
--------------
oci8 run to php-fpm can't work
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 00:00:01 2025 UTC |
cat b.php #------------------------------------------------------------------- <?php if (@oci_connect('login_id', 'login_pw', 'oracle_db')) { print 'right'; } else { print 'error'; } #------------------------------------------------------------------- #command line php -q b.php right #apache curl http://127.0.0.1:80/b.php right #ngixn + php-fpm curl http://127.0.0.1:81/b.php 502 bad gateway => but remove remi 5.3.10 rpm => reinstall remi 5.3.5 rpm show right string is work #------------------------------------------------------------------- #1.download CentOS-6.2-x86_64-minimal.iso #2.install CentOS-6.2-x86_64-minimal.iso #3.yum add repo remi and nginx yum install php-* --skip-broken php-mysql #no install php-pecl* and php-pear* yum install nginx #4.set nginx and php-fpm #5.download oracle client oracle-instantclient-11.2.0.1.0*.rpm #6.rpm -ivh oracle-instantclient-11.2.0.1.0*.rpm #7.set oracle environment variables in the bashrc and php-fpm #======================================================================== #-------------------------- # php-fpm.conf #-------------------------- [global] pid = /var/run/php-fpm/php-fpm.pid emergency_restart_threshold = 1 emergency_restart_interval = 20m process_control_timeout = 15m [test] listen = 127.0.0.1:5101 listen.allowed_clients = 127.0.0.1 user = nginx group = nginx pm = static pm.max_children = 20 pm.max_requests = 0 pm.status_path = /php-fpm/status ping.path = /php-fpm/ping ping.response = pong request_terminate_timeout = 10m request_slowlog_timeout = 0 rlimit_files = 65530 rlimit_core = 0 env[HOSTNAME] = $HOSTNAME env[ORACLE_HOME] = /usr/lib/oracle/11.2/client64/ env[LD_LIBRARY_PATH] = /usr/lib/oracle/11.2/client64/lib/ env[NLS_LANG] = "TRADITIONAL CHINESE_TAIWAN.UTF8" env[TNS_ADMIN] = /etc/oracle php_admin_flag[short_open_tag] = on php_admin_flag[display_errors] = on #======================================================================== # command line add oracle client environment variables #======================================================================== echo -e "export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib/\nexport NLS_LANG=\"TRADITIONAL CHINESE_TAIWAN.UTF8\"\nexport TNS_ADMIN=/etc/oracle" >> /etc/sysconfig/httpd echo -e "export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib/\nexport NLS_LANG=\"TRADITIONAL CHINESE_TAIWAN.UTF8\"\nexport TNS_ADMIN=/etc/oracle" >> /etc/bashrc echo -e "export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib/\nexport NLS_LANG=\"TRADITIONAL CHINESE_TAIWAN.UTF8\"\nexport TNS_ADMIN=/etc/oracle" >> /etc/profile #========================================================================