Posts

Showing posts from February, 2007
我試著以 PHP 連上 Oracle DB 許久, 都不能成功... :( Error: ORA-12541 listener not found! 今天終於試成功了! 我把這些過程寫下, 希望對你有點幫助! Make sure that Linux environment have following variables, before you start your apache server. export ORACLE_HOME=/usr/lib/oracle/10.2.0.1 export D_LIBRARY_PATH=/usr/lib/oracle/10.2.0.1/client/lib export TNS_ADMIN=/etc /usr/local/apache/bin/apachectl startssl You must have the hosts you want to connect configured in /etc/tnsnames.ora (according to TNS_ADMIN's location) TEST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = db)(PORT = 1522)) ) (CONNECT_DATA = (SERVICE_NAME = TEST) ) ) Your PHP must compiled with oci8(Oracle DB) support, try: echo phpinfo(); to see if you see oci8 libraries available. Try to make connection from the Host to Oracle DB first to make sure that connection is available. And you should be inside Oracle shell shell>sqlplus USERID/PASSWORD@SID Connected to:Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit ProductionWith the Parti