Problems getting oracle client working with PHP5

René Fournier m5 at renefournier.com
Mon Jul 11 22:20:10 PDT 2011


Actually, my mistake was kind of dumb. I restarted the Apple-supplied Apache, not the Macports version.

Restarting Macports Apache caused the oracle.ini file to get parsed, and the function now runs.


On 2011-07-11, at 7:59 PM, Ryan Schmidt wrote:

> 
> On Jul 11, 2011, at 12:32, René Fournier wrote:
> 
>> I need to access a remote Oracle database via PHP, and I'm having some trouble. So far, I've followed the instructions...
>> 
>> - Downloaded:
>> 	instantclient-basic-10.2.0.4.0-macosx-x64.zip
>> 	instantclient-sdk-10.2.0.4.0-macosx-x64.zip
>>  To:
>> 	/opt/local/var/macports/distfiles/oracle-instantclient
>> 
>> - Ran:
>> 	sudo port install oracle-instantclient
>> 	sudo port install php5-oracle
>> 
>> No errors, seems installed. However, phpinfo() reveals no mention of Oracle or OCI8, etc.And when I try: 
>> 
>> if ($c = oci_connect("hr", "hr_password", "localhost/XE")) {
>> 	echo "Successfully connected to Oracle."; oci_close($c); 
>> 	}
>> 
>> I get:
>> 
>> Fatal error: Call to undefined function oci_connect()...
> 
> Simply installing php5-oracle and restarting your web server should have been enough for the oci_connect() function to now exist. I verified it works correctly on my system. You did restart your web server after installing php5-oracle, yes?
> 
> 



More information about the macports-users mailing list