oci8 + php cgi 不工作

发布于 2024-11-27 15:19:43 字数 9788 浏览 3 评论 0原文

我已按照本指南成功安装了 oci8 模块:

http://orfeogpl.info/wiki/index.php /Ubuntu_Oci8_Php5

oci8 正在通过 php cli 工作,但不是通过 cgi /http

有谁知道我可以解决这个问题吗?我的操作系统是否缺少 oci8 所需的 php 包?

Apache 错误日志:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.11.1: failed to map segment from shared object: Permission denied in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.11.1: failed to map segment from shared object: Permission denied in Unknown on line 0

ldd -r 显示:

    ldd -r /usr/lib64/php/modules/oci8.so:
        linux-vdso.so.1 =>  (0x00007fffbc6c2000)             
        libclntsh.so.11.1 => /usr/oracle/instantclient/libclntsh.so.11.1 (0x00007f326fc12000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f326f879000)                                   
        libnnz11.so => /usr/oracle/instantclient/libnnz11.so (0x00007f326f4b1000)            
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f326f2ad000)                                 
        libm.so.6 => /lib64/libm.so.6 (0x00007f326f028000)                                   
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f326ee0b000)                       
        libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f326ebf2000)                               
        libaio.so.1 => /lib64/libaio.so.1 (0x00007f326e9f0000)                               
        /lib64/ld-linux-x86-64.so.2 (0x000000361d400000)                                     
    undefined symbol: OnUpdateLong  (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: OnUpdateBool  (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: zend_ini_boolean_displayer_cb (/usr/lib64/php/modules/oci8.so)             
undefined symbol: OnUpdateString        (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: zend_standard_class_def       (/usr/lib64/php/modules/oci8.so)             
undefined symbol: le_index_ptr  (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: core_globals  (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: executor_globals      (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: convert_to_double     (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: php_info_print_table_start    (/usr/lib64/php/modules/oci8.so)             
undefined symbol: zend_fetch_resource   (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: _zend_list_delete     (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: zend_list_insert      (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: zend_hash_del_key_or_index    (/usr/lib64/php/modules/oci8.so)             
undefined symbol: zend_unregister_ini_entries   (/usr/lib64/php/modules/oci8.so)             
undefined symbol: ap_php_snprintf       (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: display_ini_entries   (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: add_assoc_null_ex     (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: zend_register_internal_class  (/usr/lib64/php/modules/oci8.so)             
undefined symbol: _object_init_ex       (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: zend_hash_destroy     (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: zend_hash_find        (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: _php_stream_free      (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: _ecalloc      (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: _php_stream_open_wrapper_ex   (/usr/lib64/php/modules/oci8.so)             
undefined symbol: add_index_zval        (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: _array_init   (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: _emalloc      (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: php_printf    (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: add_next_index_stringl        (/usr/lib64/php/modules/oci8.so)             
undefined symbol: _php_stream_write     (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: zend_register_string_constant (/usr/lib64/php/modules/oci8.so)
undefined symbol: _object_and_properties_init   (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_wrong_param_count        (/usr/lib64/php/modules/oci8.so)
undefined symbol: php_checkuid  (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_strndup  (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zval_dtor_func       (/usr/lib64/php/modules/oci8.so)
undefined symbol: convert_to_array      (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zend_hash_add_or_update      (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zend_list_find       (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_hash_num_elements        (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_parse_parameters_ex      (/usr/lib64/php/modules/oci8.so)
undefined symbol: _efree        (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_next_index_long   (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_assoc_zval_ex     (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_index_null        (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_assoc_string_ex   (/usr/lib64/php/modules/oci8.so)
undefined symbol: php_check_open_basedir        (/usr/lib64/php/modules/oci8.so)
undefined symbol: php_error_docref0     (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_register_list_destructors_ex     (/usr/lib64/php/modules/oci8.so)
undefined symbol: _convert_to_string    (/usr/lib64/php/modules/oci8.so)
undefined symbol: php_info_print_table_row      (/usr/lib64/php/modules/oci8.so)
undefined symbol: _estrdup      (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_parse_parameters (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_register_resource        (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_hash_internal_pointer_reset_ex   (/usr/lib64/php/modules/oci8.so)
undefined symbol: php_info_print_table_end      (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_next_index_null   (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_assoc_long_ex     (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_hash_move_forward_ex     (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_hash_apply_with_argument (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_next_index_double (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zend_list_addref     (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zval_ptr_dtor        (/usr/lib64/php/modules/oci8.so)
undefined symbol: php_strtolower        (/usr/lib64/php/modules/oci8.so)
undefined symbol: _estrndup     (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_register_ini_entries     (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zend_hash_init       (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_hash_get_current_data_ex (/usr/lib64/php/modules/oci8.so)
undefined symbol: gc_remove_zval_from_buffer    (/usr/lib64/php/modules/oci8.so)
undefined symbol: zval_add_ref  (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_strtod   (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zend_bailout (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zval_copy_ctor_func  (/usr/lib64/php/modules/oci8.so)
undefined symbol: _safe_emalloc (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_property_resource_ex      (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_register_long_constant   (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_hash_index_find  (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_hash_apply       (/usr/lib64/php/modules/oci8.so)
undefined symbol: convert_to_long       (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zend_hash_index_update_or_next_insert        (/usr/lib64/php/modules/oci8.so)
undefined symbol: _erealloc     (/usr/lib64/php/modules/oci8.so)
cat /etc/php.ini |grep oci  
    extension=oci8.so  


cat /etc/php.d/oci8.ini  
    extension=oci8.so

cli (php -a) 中,phpinfo(); 显示 oci8

oci8  

    OCI8 Support => enabled
    Version => 1.4.5
    Revision => $Revision: 305257 $
    Active Persistent Connections => 0
    Active Connections => 0
    Oracle Instant Client Version => 11.2
    Temporary Lob support => enabled
    Collections support => enabled

    Directive => Local Value => Master Value
    oci8.connection_class => no value => no value
    oci8.default_prefetch => 100 => 100
    oci8.events => Off => Off   
    oci8.max_persistent => -1 => -1
    oci8.old_oci_close_semantics => Off => Off
    oci8.persistent_timeout => -1 => -1
    oci8.ping_interval => 60 => 60
    oci8.privileged_connect => Off => Off
    oci8.statement_cache_size => 20 => 20

通过 http/cgi phpinfo() ;显示:

Additional .ini files parsed   /etc/php.d/curl.ini, /etc/php.d/fileinfo.ini, /etc/php.d/json.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/oci8.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_sqlite.ini, /etc/php.d/phar.ini, /etc/php.d/sqlite3.ini, /etc/php.d/zip.ini

I have successfully instaled oci8 module following this guide:

http://orfeogpl.info/wiki/index.php/Ubuntu_Oci8_Php5

oci8 is working through php cli but not through cgi /http

Does anyone knows who could i solve it? Is my OS lacking any php package needed by oci8?

Apache error log:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.11.1: failed to map segment from shared object: Permission denied in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.11.1: failed to map segment from shared object: Permission denied in Unknown on line 0

ldd -r shows:

    ldd -r /usr/lib64/php/modules/oci8.so:
        linux-vdso.so.1 =>  (0x00007fffbc6c2000)             
        libclntsh.so.11.1 => /usr/oracle/instantclient/libclntsh.so.11.1 (0x00007f326fc12000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f326f879000)                                   
        libnnz11.so => /usr/oracle/instantclient/libnnz11.so (0x00007f326f4b1000)            
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f326f2ad000)                                 
        libm.so.6 => /lib64/libm.so.6 (0x00007f326f028000)                                   
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f326ee0b000)                       
        libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f326ebf2000)                               
        libaio.so.1 => /lib64/libaio.so.1 (0x00007f326e9f0000)                               
        /lib64/ld-linux-x86-64.so.2 (0x000000361d400000)                                     
    undefined symbol: OnUpdateLong  (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: OnUpdateBool  (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: zend_ini_boolean_displayer_cb (/usr/lib64/php/modules/oci8.so)             
undefined symbol: OnUpdateString        (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: zend_standard_class_def       (/usr/lib64/php/modules/oci8.so)             
undefined symbol: le_index_ptr  (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: core_globals  (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: executor_globals      (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: convert_to_double     (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: php_info_print_table_start    (/usr/lib64/php/modules/oci8.so)             
undefined symbol: zend_fetch_resource   (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: _zend_list_delete     (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: zend_list_insert      (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: zend_hash_del_key_or_index    (/usr/lib64/php/modules/oci8.so)             
undefined symbol: zend_unregister_ini_entries   (/usr/lib64/php/modules/oci8.so)             
undefined symbol: ap_php_snprintf       (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: display_ini_entries   (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: add_assoc_null_ex     (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: zend_register_internal_class  (/usr/lib64/php/modules/oci8.so)             
undefined symbol: _object_init_ex       (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: zend_hash_destroy     (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: zend_hash_find        (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: _php_stream_free      (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: _ecalloc      (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: _php_stream_open_wrapper_ex   (/usr/lib64/php/modules/oci8.so)             
undefined symbol: add_index_zval        (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: _array_init   (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: _emalloc      (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: php_printf    (/usr/lib64/php/modules/oci8.so)                             
undefined symbol: add_next_index_stringl        (/usr/lib64/php/modules/oci8.so)             
undefined symbol: _php_stream_write     (/usr/lib64/php/modules/oci8.so)                     
undefined symbol: zend_register_string_constant (/usr/lib64/php/modules/oci8.so)
undefined symbol: _object_and_properties_init   (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_wrong_param_count        (/usr/lib64/php/modules/oci8.so)
undefined symbol: php_checkuid  (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_strndup  (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zval_dtor_func       (/usr/lib64/php/modules/oci8.so)
undefined symbol: convert_to_array      (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zend_hash_add_or_update      (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zend_list_find       (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_hash_num_elements        (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_parse_parameters_ex      (/usr/lib64/php/modules/oci8.so)
undefined symbol: _efree        (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_next_index_long   (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_assoc_zval_ex     (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_index_null        (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_assoc_string_ex   (/usr/lib64/php/modules/oci8.so)
undefined symbol: php_check_open_basedir        (/usr/lib64/php/modules/oci8.so)
undefined symbol: php_error_docref0     (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_register_list_destructors_ex     (/usr/lib64/php/modules/oci8.so)
undefined symbol: _convert_to_string    (/usr/lib64/php/modules/oci8.so)
undefined symbol: php_info_print_table_row      (/usr/lib64/php/modules/oci8.so)
undefined symbol: _estrdup      (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_parse_parameters (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_register_resource        (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_hash_internal_pointer_reset_ex   (/usr/lib64/php/modules/oci8.so)
undefined symbol: php_info_print_table_end      (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_next_index_null   (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_assoc_long_ex     (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_hash_move_forward_ex     (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_hash_apply_with_argument (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_next_index_double (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zend_list_addref     (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zval_ptr_dtor        (/usr/lib64/php/modules/oci8.so)
undefined symbol: php_strtolower        (/usr/lib64/php/modules/oci8.so)
undefined symbol: _estrndup     (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_register_ini_entries     (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zend_hash_init       (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_hash_get_current_data_ex (/usr/lib64/php/modules/oci8.so)
undefined symbol: gc_remove_zval_from_buffer    (/usr/lib64/php/modules/oci8.so)
undefined symbol: zval_add_ref  (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_strtod   (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zend_bailout (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zval_copy_ctor_func  (/usr/lib64/php/modules/oci8.so)
undefined symbol: _safe_emalloc (/usr/lib64/php/modules/oci8.so)
undefined symbol: add_property_resource_ex      (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_register_long_constant   (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_hash_index_find  (/usr/lib64/php/modules/oci8.so)
undefined symbol: zend_hash_apply       (/usr/lib64/php/modules/oci8.so)
undefined symbol: convert_to_long       (/usr/lib64/php/modules/oci8.so)
undefined symbol: _zend_hash_index_update_or_next_insert        (/usr/lib64/php/modules/oci8.so)
undefined symbol: _erealloc     (/usr/lib64/php/modules/oci8.so)
cat /etc/php.ini |grep oci  
    extension=oci8.so  


cat /etc/php.d/oci8.ini  
    extension=oci8.so

In the cli (php -a), phpinfo(); shows oci8

oci8  

    OCI8 Support => enabled
    Version => 1.4.5
    Revision => $Revision: 305257 $
    Active Persistent Connections => 0
    Active Connections => 0
    Oracle Instant Client Version => 11.2
    Temporary Lob support => enabled
    Collections support => enabled

    Directive => Local Value => Master Value
    oci8.connection_class => no value => no value
    oci8.default_prefetch => 100 => 100
    oci8.events => Off => Off   
    oci8.max_persistent => -1 => -1
    oci8.old_oci_close_semantics => Off => Off
    oci8.persistent_timeout => -1 => -1
    oci8.ping_interval => 60 => 60
    oci8.privileged_connect => Off => Off
    oci8.statement_cache_size => 20 => 20

Through http/cgi phpinfo(); shows:

Additional .ini files parsed   /etc/php.d/curl.ini, /etc/php.d/fileinfo.ini, /etc/php.d/json.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/oci8.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_sqlite.ini, /etc/php.d/phar.ini, /etc/php.d/sqlite3.ini, /etc/php.d/zip.ini

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

谎言月老 2024-12-04 15:19:43
  1. 禁用SElinux
  2. 安装php-mbstring(解决undefined symbol错误)
  1. Disabling SElinux
  2. Installing php-mbstring (solve the undefined symbol errors)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文