Jump to content

Recommended Posts

i am facing issue with DB connection with Oracle DB 

able to telnet and connect DB from [RHEL] OS command prompt also when i am executing php command with php filename, i am able to connect to the database. 

i am getting err 500 when trying to open php page from front end. 

 

pls help...!!!! 

Make sure your php.ini file has error_reporting set to "E_ALL" and that display_errors and display_startup_errors are ON

You also need to check for any errors returned by your DB server.

Thanks for the reply. 

error_reporting is already set to "E_ALL" and current local & master values displaying on the browser is 22527 

display_errors and display_startup_errors i have changed to ON and took a restart of Apache services. 

Now i am getting below error:
Fatal error: Call to undefined function oci_connect() in php page on line 14

The php page is working fine when using directly from the server, even the connection string is working fine when used from the server, i am getting the SQL output as desired. Unfortunately it is erring out in browser. 

PN: the DB i am connecting to is on Oracle RAC

Edited by Abhinov

Sounds like you don't the required library installed or enabled. Check the extensions in the php.ini file or use phpinfo() to see if there is an OCI section.

https://www.php.net/manual/en/oci8.requirements.php

From the php manual...

Quote

Troubleshooting

The most common problem with installing OCI8 is not having the Oracle environment correctly set. This typically appears as a problem using oci_connect() or oci_pconnect(). The error may be a PHP error such as Call to undefined function oci_connect(), an Oracle error such as ORA-12705, or even an Apache crash. Check the Apache log files for startup errors and see the sections above to resolve this problem.

While network errors like ORA-12154 or ORA-12514 indicate an Oracle network naming or configuration issue, the root cause may be because the PHP environment is incorrectly set up and Oracle libraries are unable to locate the tnsnames.ora configuration file.

 

Thanks Barand, 
I took a fresh restart of the Apache services and found below errors: 

[Mon Nov 11 11:55:22.770796 2019] [core:notice] [pid 25241] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Nov 11 11:55:22.771829 2019] [suexec:notice] [pid 25241] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Nov 11 11:55:22.794170 2019] [auth_digest:notice] [pid 25241] AH01757: generating secret for digest authentication ...
[Mon Nov 11 11:55:22.794974 2019] [lbmethod_heartbeat:notice] [pid 25241] AH02282: No slotmem from mod_heartmonitor
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.12.1: cannot enable executable stack as shared object requires: Permission denied in Unknown on line 0
[Mon Nov 11 11:55:22.808208 2019] [mpm_prefork:notice] [pid 25241] AH00163: Apache/2.4.6 (Red Hat) PHP/5.4.16 configured -- resuming normal operations
[Mon Nov 11 11:55:22.808238 2019] [core:notice] [pid 25241] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
 

 

Dears, 
Can someone please help. 

I took a fresh restart of the Apache services and found below errors
[Mon Nov 11 11:55:22.770796 2019] [core:notice] [pid 25241] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Nov 11 11:55:22.771829 2019] [suexec:notice] [pid 25241] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Nov 11 11:55:22.794170 2019] [auth_digest:notice] [pid 25241] AH01757: generating secret for digest authentication ...
[Mon Nov 11 11:55:22.794974 2019] [lbmethod_heartbeat:notice] [pid 25241] AH02282: No slotmem from mod_heartmonitor
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.12.1: cannot enable executable stack as shared object requires: Permission denied in Unknown on line 0
[Mon Nov 11 11:55:22.808208 2019] [mpm_prefork:notice] [pid 25241] AH00163: Apache/2.4.6 (Red Hat) PHP/5.4.16 configured -- resuming normal operations
[Mon Nov 11 11:55:22.808238 2019] [core:notice] [pid 25241] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.