Call to undefined function oci_connect, php_oci8_12c.dll, windows 8.1, php5.6.6

前端 未结 2 490
青春惊慌失措
青春惊慌失措 2020-12-03 12:47

I have a simple php script:



        
2条回答
  •  南方客
    南方客 (楼主)
    2020-12-03 13:11

    In addition to what was said to fix the problem, I would like to add the php CLI side of things, as some people need to run OCI-enabled applications in CLI mode. In my case, I had to copy an instance of oci.dll into the wamp/bin/php/php/ folder for php --ri oci8 to show that oci8 was correctly loaded. That doesn't prove that other files were not needed to correctly run a full-fledged application (see my technical footnote). Including the path to the instantclient 12 distribution wouldn't do it.

    Technical notes: My environment being: Windows 7 + WAMP3 (php 5.6.15, apache 2.4.17), I was, after a number of experiments, able to narrow down the minimal set of three files that needed to be copied to the bin directory (Apache's for non-cli apps) from the instantclient 12 distribution, to allow instantiate an Oracle adapter within Zend Framework, perform an SQL query and read the recordset.

    This set is: oci.dll, oraociei12.dll and orans.dll.

    In particular, copying just oci.dll wouldn't allow the application to work (unknow Exception raised)

提交回复
热议问题