Problems getting oracle client working with PHP5

Ryan Schmidt ryandesign at macports.org
Mon Jul 11 18:59:39 PDT 2011


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