Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

oracle connection in PHP

Status
Not open for further replies.

puntito

Programmer
Mar 22, 2006
18
Hi everybody !!!
I have this problem.
I need to do a connection to oracle by PHP code.

I downloaded the PHPeclipse plugin and the XAMPP to use apache.
I configured this in the httpd.config
Code:
 ThreadsPerChild 250
  MaxRequestsPerChild  0
ServerRoot "C:/xampp/apache"
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule ldap_module modules/mod_ldap.soListen 80
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule status_module modules/mod_status.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule autoindex_color_module modules/mod_autoindex_color.so

ServerAdmin admin@localhost
ServerName localhost:80
DocumentRoot "C:/xampp/htdocs"

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
</Directory>


Alias /eclipse "C:/WORKSPACE/SMSnayeli/"
<Directory "C:/WORKSPACE/SMSnayeli/">
  Options Indexes MultiViews
  AllowOverride None
  Order allow,deny
  Allow from all
</Directory>


<Directory "C:/xampp/htdocs">
  Options Indexes FollowSymLinks Includes ExecCGI
  AllowOverride All
  Order allow,deny
  Allow from all
</Directory>

<IfModule dir_module>
    DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml
</IfModule>

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
</FilesMatch>

ErrorLog logs/error.log
LogLevel warn

<IfModule log_config_module>
  LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  LogFormat "%h %l %u %t \"%r\" %>s %b" common


  <IfModule logio_module>
     LogFormat "%h %l %u %t \"%r\" %>s %b \ "% {Referer} i\ "\"%{User-Agent}i\" %I %O" combinedio

  </IfModule>

  CustomLog logs/access.log common

</IfModule>

<IfModule alias_module>
   ScriptAlias /cgi-bin/ "C:/xampp/cgi-bin/"
</IfModule>

<Directory "C:/xampp/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

DefaultType text/plain

<IfModule mime_module>
  TypesConfig conf/mime.types
  AddType application/x-compress .Z
  AddType application/x-gzip .gz .t
  AddHandler cgi-script .cgi
  AddType text/html .shtml
  AddOutputFilter INCLUDES .shtml
</IfModule>

EnableMMAP off
EnableSendfile off
Include conf/extra/httpd-xampp.conf
Include conf/extra/httpd-multilang-errordoc.conf
Include conf/extra/httpd-autoindex.conf
Include conf/extra/httpd-languages.conf
Include conf/extra/httpd-userdir.conf
Include conf/extra/httpd-info.conf
Include conf/extra/httpd-vhosts.conf
Include conf/extra/httpd-manual.conf
Include conf/extra/httpd-dav.conf
Include conf/extra/httpd-default.conf
Include conf/extra/httpd-ssl.conf

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

I've been trying different PHP examples, this is one of them :
Code:
1   <?php
2   include('/adodb/adodb.inc.php');	
3
4   $tnsName="DEVELOP.world";
5   $usuario = "admin";
6   $contrasenna = "admin";
7   $db = NewADOConnection("oci8");
8
9   $db->Connect($tnsName, $usuario, $contrasenna);
10  // $db->debug = true;
11  $rs = $db->Execute("select * from dual");
12  while ($arr = $rs->FetchRow()) {
13  print "<pre>";
14  print_r($rs->GetRows());
15  print "</pre>";
16  }
17  ?>
to execute I write:



and I received this messages:

Warning: include(/adodb/adodb.inc.php) [function.include]: failed to open stream: No such file or directory in C:\WORKSPACE\SMSnayeli\PHPtest\web\conn3.php on line 2

Warning: include() [function.include]: Failed opening '/adodb/adodb.inc.php' for inclusion (include_path='.;C:\xampp\php\pear\') in C:\WORKSPACE\SMSnayeli\PHPtest\web\conn3.php on line 2

Fatal error: Call to undefined function newadoconnection() in C:\WORKSPACE\SMSnayeli\PHPtest\web\conn3.php on line 7


Could you find what is wrong ??

Thanks a lot for your time !!
 
First, is the adodb.inc.php file in the correct directory (folder)? What is the full path name for this file?
 
well, de root for this file is:

C:\xampp\php\PEAR\adodb\adodb.inc.php


In a try, I copied it in my workspace, but it starts to ask for a lot of other inc.php files.
 
remove the starting slash from the line
Code:
include('/adodb/adodb.inc.php');

so it becomes

Code:
include('adodb/adodb.inc.php');

and insert this language at the top of the file
Code:
$path = "C:/xampp/php/PEAR/";
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top