Abhinov Posted November 10, 2019 Share Posted November 10, 2019 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...!!!! Quote Link to comment https://forums.phpfreaks.com/topic/309506-err500-when-trying-to-open-php-page-from-browser/ Share on other sites More sharing options...
Barand Posted November 10, 2019 Share Posted November 10, 2019 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. Quote Link to comment https://forums.phpfreaks.com/topic/309506-err500-when-trying-to-open-php-page-from-browser/#findComment-1571436 Share on other sites More sharing options...
Abhinov Posted November 10, 2019 Author Share Posted November 10, 2019 (edited) 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 November 10, 2019 by Abhinov Quote Link to comment https://forums.phpfreaks.com/topic/309506-err500-when-trying-to-open-php-page-from-browser/#findComment-1571438 Share on other sites More sharing options...
Barand Posted November 10, 2019 Share Posted November 10, 2019 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 Quote Link to comment https://forums.phpfreaks.com/topic/309506-err500-when-trying-to-open-php-page-from-browser/#findComment-1571441 Share on other sites More sharing options...
Abhinov Posted November 10, 2019 Author Share Posted November 10, 2019 (edited) i will share the phpinfo for your reference, not able to upload more than 1 MB, if you need any specific section please let me know Edited November 10, 2019 by Abhinov Quote Link to comment https://forums.phpfreaks.com/topic/309506-err500-when-trying-to-open-php-page-from-browser/#findComment-1571442 Share on other sites More sharing options...
Barand Posted November 10, 2019 Share Posted November 10, 2019 Do you have this line in your php.ini file... ;extension=php_oci8_12c.dll If so, remove the ";" to enable the extension and check you have that dll file in your extensions folder. Quote Link to comment https://forums.phpfreaks.com/topic/309506-err500-when-trying-to-open-php-page-from-browser/#findComment-1571443 Share on other sites More sharing options...
Abhinov Posted November 11, 2019 Author Share Posted November 11, 2019 Hi Barand, Thanks for your help. i just checked the extension parameter it is enabled and value is oci8.so, even the file is also present in the extension folder. extension=oci8.so Quote Link to comment https://forums.phpfreaks.com/topic/309506-err500-when-trying-to-open-php-page-from-browser/#findComment-1571466 Share on other sites More sharing options...
Barand Posted November 11, 2019 Share Posted November 11, 2019 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. Quote Link to comment https://forums.phpfreaks.com/topic/309506-err500-when-trying-to-open-php-page-from-browser/#findComment-1571468 Share on other sites More sharing options...
Abhinov Posted November 11, 2019 Author Share Posted November 11, 2019 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' Quote Link to comment https://forums.phpfreaks.com/topic/309506-err500-when-trying-to-open-php-page-from-browser/#findComment-1571469 Share on other sites More sharing options...
Abhinov Posted November 13, 2019 Author Share Posted November 13, 2019 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' Quote Link to comment https://forums.phpfreaks.com/topic/309506-err500-when-trying-to-open-php-page-from-browser/#findComment-1571543 Share on other sites More sharing options...
Barand Posted November 13, 2019 Share Posted November 13, 2019 https://www.php.net/manual/en/oci8.setup.php Quote Link to comment https://forums.phpfreaks.com/topic/309506-err500-when-trying-to-open-php-page-from-browser/#findComment-1571544 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.