问题
I have XAMPP installed with PHP 5.2.6 in Windows XP. In my php.ini I have the next lines uncommented:
- extension=php_oracle.dll
- extension=php_oci8.dll
I have a file with something like this:
<?php
$conn = oci_connect('hr', 'welcome', 'localhost/XE');
?>
But when I try call to php.exe through cmd to that file, the console always give me an error:
Fatal Error: Call to undefined function oci_connect()
In my localhost I have no problem with this.
回答1:
Probably, you're not looking at the right php.ini file for the command line.
In php.exe, run:
echo phpinfo();
then look for the php.ini path at the top.
来源:https://stackoverflow.com/questions/8012682/php-exe-in-cmd-throws-call-to-undefined-function-oci-connect