Using PDO oci, our application web pages connect to various Oracle databases. All database connections before used the following connect strings successfully:
$conn = new PDO("oci:dbname=//servername.domain*:1521*/db_service_name",$db_username,$db_password);
up until last Friday 5/18 when one particular server connection attempt would throw a "Fatal error" unless we modify the connection string as follows:
$conn = new PDO("oci:dbname=//servername.domain/db_service_name",$db_username,$db_password); // no port number
php version appears to be 5.3, database version is 10.2.0.5.0, all running on linux RHEL 5. Other connections using RHEL 4, but I believe that is moot in that the app server running php 5.3 with oci8.so to connect to the database server running oracle 10.2.0.5 was working, but on Monday 5/21, it was not working.
Fatal error when not working is:
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE: (null)' in /home/driskind/test_oci.php:7
#0 /home/driskind/test_oci.php(7): PDO->__construct('oci:dbname=//ea...', 'user...', 'password')
thrown in /home/driskind/test_oci.php on line 7
Note that from this same host, php can connect to older database servers utilizing the connection string with the port number, so I am suspecting a configuration on the database server side for the new database server where connection string using port number fails.
Please don't ask why application doesn't use other methods. They have adamantly stated they wish to continue to use thier application with php configured as is.
Unless things have really changed with PDO I recommend not using it. Just use the OCI_ methods. For me the biggest problem is that PDO ( at my last reading ) does not support reference cursors which for me is just a non starter.