RE: [PHP-ES] ORA-12154, recomendacion
| From: | Rigoberto Sandoval | Date: | Wed, 26 Jul 2000 23:17:05 +0000 |
| Subject: | RE: [PHP-ES] ORA-12154, recomendacion | ||
| References: | 1 2 3 4 | Groups: | php.general.es |
| Request: | Send a blank email to general-es+get-647@lists.php.net to get a copy of this message | ||
[Rodrigo]
Ok si funciona tu sqlplus, entonces te recomiendo anexes y exportes
las variables de entorno basicas de oracle, al inicio de tu script que
arranca tu webserver.
ORACLE_HOME
LD_LIBRATY_PATH=$ORACLE_HOME/lib
ORACLE_SID y TNS_NAMES
y agrega a tu cache de librerias del sistema el directorio
$ORACLE_HOME/lib
como ejemplo de linux el archivo seria este:
/etc/ld.so.conf
y el contenido podria ser como este:
--------------------------------------------
/usr/X11R6/lib
/usr/lib
/usr/i486-linux-libc5/lib
/usr/lib/qt-2.0.1/lib
/usr/lib/qt-1.44/lib
/datos-2/OraHome1/lib
--------------------------------------------
despues ejecutar el comando:
ldconfig
y listo!
Como ultimo comentario: en la parte de la informacion que muestra phpinfo
en la que respecta a oci8 deberia de aparecer tu $oracle_home/lib
en Libraries Used, y esta vacia.
----------------------------------------------------------------------------
-
oci8
OCI8 Support enabled
Oracle Version 8.1
Compile-time ORACLE_HOME /export/home/oracle/product/8.1.5
Libraries Used
----------------------------------------------------------------------------
--
----- Original Message -----
From: Rodrigo A. Leiva Gonzalez
To: lista@phpes.com
Sent: Wednesday, July 26, 2000 4:18 PM
Subject: Re: [PHP-ES] ORA-12154
"R. Sandoval" wrote:
Si mandaras la descripcion del error y no el codigo tal vez
te ayudemos mas rapido.
OK: aquí va una descripción mas detallada del error:
este es el script que deseo ejecutar:
<?php
/* OCIFetchStatement example mbritton@verinet.com (990624) */
$basedatos="NOVA";
$conn = OCILogon("system","password",$basedatos);
$stmt = OCIParse($conn,"select * from all_tables");
OCIExecute($stmt);
$nrows = OCIFetchStatement($stmt,$results);
if ( $nrows > 0 )
print "<TABLE BORDER=\"1\">\n";
print "<TR>\n";
while ( list( $key, $val ) = each( $results ) )
print "<TH>$key</TH>\n";
}
print "</TR>\n";
for ( $i = 0; $i < $nrows; $i++ )
reset($results);
print "<TR>\n";
while ( $column = each($results) )
$data = $column['value'];
print "<TD>$data[$i]</TD>\n";
}
print "</TR>\n";
}
print "</TABLE>\n";
} else
echo "No data found<BR>\n";
}
print "$nrows Records Selected<BR>\n";
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
Al ejecutarlo con el browser obtengo el siguiente error:
Warning: _oci_open_server: Error while trying to retrieve text for error
ORA-12154 in /export/home/raleiva/uchile/oci_fetch.php on line 5
Warning: Supplied argument is not a valid OCI8-Connection resource in
/export/home/raleiva/uchile/oci_fetch.php on line 7
Warning: Supplied argument is not a valid OCI8-Statement resource in
/export/home/raleiva/uchile/oci_fetch.php on line 9
Warning: Supplied argument is not a valid OCI8-Statement resource in
/export/home/raleiva/uchile/oci_fetch.php on line 11
No data found
Records Selected
Warning: Supplied argument is not a valid OCI8-Statement resource in
/export/home/raleiva/uchile/oci_fetch.php on line 35
El perfil de mi cuenta y de la cuenta root (.bash_profile) es:
PATH=$PATH:/usr/local/bin:/bin
CLASSPATH=.:/opt/jdk1.2.1/lib/classes111.zip:/opt/jdk1.2.1/lib/xml.jar:/opt/
netscape/server4/bin/https/jar/servlets.jar
export CLASSPATH
MANPATH=/usr/man:/usr/local/man
export MANPATH
ORACLE_BASE=/export/home/oracle
export ORACLE_BASE
ORACLE_HOME=/export/home/oracle/product/8.1.5
export ORACLE_HOME
PATH=$PATH:$ORACLE_HOME/bin
export PATH
PS1='[\h \w]# '
export PS1
Por otro lado al probar la conexión a mi base de datos NOVA con tnsping ó
vía sqlplus, esta funciona correctamente.
Envío adjunto el archivo info.php en versión texto, en caso de que
requieran información de la instalación u otro.
Gracias por la ayuda.
RLeiva
PHP Version 4.0.1pl2 [Image]
System SunOS nesdesa 5.6 Generic_105181-17 sun4u sparc
SUNW,Ultra-250
Build Date Jul 26 2000
Configure Command './configure' '--with-apache=../apache_1.3.12'
'--with-oci8=/export/home/oracle/product/8.1.5'
'--enable-track-vars'
Server API Apache
Virtual Directory disabled
Support
Configuration /usr/local/lib
File (php.ini)
Path
ZEND_DEBUG disabled
Thread Safety disabled
This program makes use of the Zend scripting language engine: [Image]
Zend Engine v1.0.1, Copyright (c) 1998-2000 Zend Technologies
------------------------------------------------------------------------
PHP 4.0 Credits
------------------------------------------------------------------------
Configuration
PHP Core
Directive Local Value Master Value
allow_call_time_pass_reference On On
arg_separator & &
asp_tags Off Off
auto_append_file no value no value
auto_prepend_file no value no value
browscap no value no value
default_charset no value no value
default_mimetype text/html text/html
define_syslog_variables Off Off
disable_functions no value no value
display_errors On On
doc_root no value no value
enable_dl On On
error_append_string Off Off
error_log no value no value
error_prepend_string Off Off
error_reporting 2039 2039
expose_php On On
extension_dir ./ ./
gpc_order GPC GPC
highlight.bg #FFFFFF #FFFFFF
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
ignore_user_abort Off Off
implicit_flush Off Off
include_path no value no value
log_errors Off Off
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
max_execution_time 30 30
open_basedir no value no value
output_buffering Off Off
precision 14 14
register_argc_argv On On
register_globals On On
safe_mode Off Off
safe_mode_exec_dir no value no value
sendmail_from me@localhost.com me@localhost.com
sendmail_path /usr/lib/sendmail -t /usr/lib/sendmail -t
short_open_tag On On
SMTP localhost localhost
sql.safe_mode Off Off
track_errors Off Off
track_vars On On
upload_max_filesize 2097152 2097152
upload_tmp_dir no value no value
user_dir no value no value
variables_order EGPCS EGPCS
y2k_compliance Off Off
xml
XML Support active
standard
Directive Local Value Master Value
assert.active 1 1
assert.bail 0 0
assert.callback no value no value
assert.quiet_eval 0 0
assert.warning 1 1
safe_mode_allowed_env_vars PHP_ PHP_
safe_mode_protected_env_vars LD_LIBRARY_PATH LD_LIBRARY_PATH
session
Session Support enabled
Directive Local Value Master Value
session.auto_start Off Off
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /tmp /tmp
session.serialize_handler php php
session.use_cookies On On
posix
Revision $Revision: 1.17 $
pcre
PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 3.1 09-Feb-2000
oci8
OCI8 Support enabled
Oracle Version 8.1
Compile-time ORACLE_HOME /export/home/oracle/product/8.1.5
Libraries Used
mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.10-alpha
MYSQL_INCLUDE
MYSQL_LFLAGS
MYSQL_LIBS
Directive Local Value Master Value
mysql.allow_persistent On On
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
db
ndbm support enabled
apache
APACHE_INCLUDE
APACHE_TARGET
Apache Version Apache/1.3.12
Apache Release 10312100
Apache API Version 19990320
Hostname:Port nesdesa.novared.cl:90
User/Group nobody(60001)/60001
Max Requests Per Child: 0
Keep Alive: on
Max Per Connection: 100
Timeouts Connection: 300
Keep-Alive: 15
Server Root /usr/local/apache
Loaded Modules mod_php4, mod_setenvif, mod_auth, mod_access,
mod_alias, mod_userdir, mod_actions, mod_imap,
mod_asis, mod_cgi, mod_dir, mod_autoindex, mod_include,
mod_status, mod_negotiation, mod_mime, mod_log_config,
mod_env, http_core
Apache Environment
Variable Value
DOCUMENT_ROOT /usr/local/apache/htdocs
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
image/png, */*
HTTP_ACCEPT_CHARSET iso-8859-1,*,utf-8
HTTP_ACCEPT_ENCODINGgzip
HTTP_ACCEPT_LANGUAGEen
HTTP_CONNECTION Keep-Alive
HTTP_HOST nesdesa:90
HTTP_USER_AGENT Mozilla/4.72 [en] (X11; U; Linux 2.2.14-5.0 i586)
PATH
/usr/sbin:/usr/bin:/usr/local/bin:/bin:/export/home/oracle/product/8.1.5/bin
REMOTE_ADDR 192.168.30.24
REMOTE_PORT 1220
SCRIPT_FILENAME /export/home/raleiva/uchile/info.php
SERVER_ADDR 192.168.30.75
SERVER_ADMIN root@nesdesa.novared.cl
SERVER_NAME nesdesa.novared.cl
SERVER_PORT 90
SERVER_SIGNATURE Apache/1.3.12 Server at nesdesa.novared.cl Port 90
SERVER_SOFTWARE Apache/1.3.12 (Unix) PHP/4.0.1pl2
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.0
REQUEST_METHOD GET
QUERY_STRING
REQUEST_URI /uchile/info.php
SCRIPT_NAME /uchile/info.php
HTTP Headers Information
HTTP Request Headers
HTTP Request GET /uchile/info.php HTTP/1.0
Accept image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
image/png, */*
Accept-Charset iso-8859-1,*,utf-8
Accept-Encoding gzip
Accept-Language en
Connection Keep-Alive
Host nesdesa:90
User-Agent Mozilla/4.72 [en] (X11; U; Linux 2.2.14-5.0 i586)
HTTP Response Headers
X-Powered-By PHP/4.0.1pl2
Connection close
Content-Type text/html
Additional Modules
Environment
Variable Value
CLASSPATH.:/opt/jdk1.2.1/lib/classes111.zip:/opt/jdk1.2.1/lib/xml.jar:/opt/n
etscape/server4/bin/https/jar/servlets.jar
HOME /
HOSTNAME nesdesa
HOSTTYPE sparc
HZ 100
LOGNAME root
MACHTYPE sparc-sun-solaris2.6
MAIL /var/mail/root
MANPATH /usr/man:/usr/local/man
OSTYPE solaris2.6
PATH
/usr/sbin:/usr/bin:/usr/local/bin:/bin:/export/home/oracle/product/8.1.5/bin
PS1 [\h \w]#
PWD /export/home/slillo
SHELL /usr/local/bin/bash
SHLVL 1
TERM vt100
TZ Chile/Continental
_ /usr/local/apache/bin/apachectl
PHP Variables
Variable
Value
PHP_SELF /uchile/info.php
HTTP_SERVER_VARS["PATH_TRANSLATED"]/export/home/raleiva/uchile/info.php
HTTP_SERVER_VARS["PHP_SELF"] /uchile/info.php
HTTP_SERVER_VARS["argv"] Array
(
)
HTTP_SERVER_VARS["argc"] 0
HTTP_ENV_VARS["CLASSPATH"]
.:/opt/jdk1.2.1/lib/classes111.zip:/opt/jdk1.2.1/lib/xml.jar:/opt/netscape/s
erver4/bin/https/jar/servlets.jar
HTTP_ENV_VARS["HOME"] /
HTTP_ENV_VARS["HOSTNAME"] nesdesa
HTTP_ENV_VARS["HOSTTYPE"] sparc
HTTP_ENV_VARS["HZ"] 100
HTTP_ENV_VARS["LOGNAME"] root
HTTP_ENV_VARS["MACHTYPE"] sparc-sun-solaris2.6
HTTP_ENV_VARS["MAIL"] /var/mail/root
HTTP_ENV_VARS["MANPATH"] /usr/man:/usr/local/man
HTTP_ENV_VARS["OSTYPE"] solaris2.6
HTTP_ENV_VARS["PATH"]
/usr/sbin:/usr/bin:/usr/local/bin:/bin:/export/home/oracle/product/8.1.5/bin
HTTP_ENV_VARS["PS1"] [\\h \\w]#
HTTP_ENV_VARS["PWD"] /export/home/slillo
HTTP_ENV_VARS["SHELL"] /usr/local/bin/bash
HTTP_ENV_VARS["SHLVL"] 1
HTTP_ENV_VARS["TERM"] vt100
HTTP_ENV_VARS["TZ"] Chile/Continental
HTTP_ENV_VARS["_"] /usr/local/apache/bin/apachectl
PHP License
This program is free software; you can redistribute it and/or modify it
under the terms of the PHP License as published by the PHP Group and
included in the distribution in the file: LICENSE
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE.
If you did not receive a copy of the PHP license, or have any questions
about PHP licensing, please contact license@php.net.
---------------------------------------------------------------------
Para dar de baja la suscripción, mande un mensaje a:
lista-unsubscribe@phpes.com