Link to home
Start Free TrialLog in
Avatar of rameshupadhye
rameshupadhyeFlag for India

asked on

Can I use MaxDB 7.6 with php 5.2.6 ? If not if i have to work with 5.1.2 how do i do that?

i have installed MaxDB 7.6, apache 2.2. , php 5.2.6 and mysql. So far everything except MaxDB, has been configured fine. up and running. Please refer to this page from where i could all this.http://www.tanguay.info/wamp/installPhp5.php5?step=28
No at step 28, my http://localhost/testMaxDB.php5 is giving this error:

Fatal error: Call to undefined function maxdb_connect() in C:\webs\test\testMaxDB.php5 on line 5
Help please.
thanks.
Ramesh

<?
 
//connect
$link = maxdb_connect('localhost','WEBSITE','WEB','WEBDATA');
maxdb_autocommit($link, true);
 
//insert new member
maxdb_query($link,"INSERT INTO members VALUES ('Brian','Jones')");
if ($result = maxdb_query($link, 'SELECT * FROM members')) {
  while ($row = maxdb_fetch_assoc($result)) {
	$firstName = $row['FIRSTNAME'];
	$lastName = $row['LASTNAME'];
	echo $firstName . ' ' . $lastName . '<br/>';
  }
}
 
//free resources
maxdb_free_result($result);
 
// close connection
maxdb_close($link);
 
?>

Open in new window

Avatar of Richard Quadling
Richard Quadling
Flag of United Kingdom of Great Britain and Northern Ireland image

Take a look at http://docs.php.net/manual/en/maxdb.installation.php and make sure you've configured your php.ini correctly. Restart your web server.

Create a php file containing ...

<?php phpinfo();

Run this via your browser. Look for MaxDB.

This is covered initially in step 25.
Avatar of rameshupadhye

ASKER

>>>>http://docs.php.net/manual/en/maxdb.installation.php  --- The page says:
Installation
By using the --with-maxdb[=DIR] configuration option you enable PHP to access MaxDB databases.
>>>> using -- meaning put this entry "maxdb =[DIR] "  in php.ini?
[DIR] points to the directory that contains the installed MaxDB SQLDBC package.

Windows users will need to enable php_maxdb.dll inside of php.ini.
>>>> php_masdb.dll is enabled in php.ini

<?php phpinfo(); Run this via your browser. Look for MaxDB.
>>>> Done but no find for search 'MaxDB" or "Max db"
>>>>thnks.
Ok.

Look back in the phpinfo() output and look for Loaded Configuration File.

This is the REAL php.ini file you need to edit. It may NOT be C:\windows\php.ini. Mine isn't as I have different INI files for ISAPI, CGI, CLI and PHP4, 5 and 6.

Also, php_maxdb.dll and not php_masdb.dll, so hopefully just a typo.


Also.

At the command prompt.

Change directory to your PHP installation folder - mine is C:\php5

Type ...

php --ini

Look for the Loaded Configuration File.

Edit that file and add the extension=php_maxdb.dll

Back at the command prompt type ...

php -m

Do you get an error? Do you see maxdb (with or without space)?

Look back in the phpinfo() output and look for Loaded Configuration File.
This is the REAL php.ini file you need to edit. It may NOT be C:\windows\php.ini. Mine isn't as I have different INI files for ISAPI, CGI, CLI and PHP4, 5 and 6.
>>>> Loaded Configurtion File (php.ini) is in c:\php
Also, php_maxdb.dll and not php_masdb.dll, so hopefully just a typo.
>>> yes that is a typo sorry.

Change directory to your PHP installation folder - mine is C:\php5 ...Type ...php --ini
>>>>> mine is c:\php.. At command prompt typed php --ini and it gives me this error in a window:
>> This application has failed to start becouse php4ts.dll whas not found. Reinstalling the application may fix this problem.
>>> and at the command prompt, the error is :

    C:\php>php --ini
    PHP Warning:  PHP Startup: Unable to load dynamic library 'c:\php\ext\php_maxdb.
    dll' - The specified module could not be found.
    in Unknown on line 0
   Configuration File (php.ini) Path: C:\WINDOWS
   Loaded Configuration File:         C:\php\php.ini
   Scan for additional .ini files in: (none)
  Additional .ini files parsed:      (none)


Edit that file and add the extension=php_maxdb.dll
Back at the command prompt type ...
php -m
.>> and the error for php -m :
  C:\php>php -m
  PHP Warning:  PHP Startup: Unable to load dynamic library 'c:\php\ext\php_maxdb.
  dll' - The specified module could not be found.
   in Unknown on line 0
  PHP Warning:  PHP Startup: Unable to load dynamic library 'c:\php\ext\php_maxdb.
  dll' - The specified module could not be found.
   in Unknown on line 0
>>>

Do you get an error? Do you see maxdb (with or without space)?
>>> Infact if u see my php.ini (since this site was not ccepiting.. changed to php.txt), I have that extension already added in my php.ini!!

>> In the http://www.tanguay.info/wamp/installPhp5.php5?step=23 and the previos step, some have espressed that maxdb is not working on php5.2.6 and we have to use 5.1.2 ver.of php. Is this true? And if so, can i have to reinstall php again ? and if so what happens to what i have so far configured in php?
thanks.
Ramesh
php.txt
This looks like you've got more than 1 version of PHP installed.

Can you show what your PATH is set to and were the PHP4 installation is. If you don't need PHP4 remove it.

I have downloaded php-5.2.6-Win32.zip (9,517 KB) and just extracted the files, copied/moved necessary files and made necessary entries in httpd.conf, exactly as the steps given in the http://www.tanguay.info/wamp/installPhp5.php5?step=4 steps 4 and 5. And my php scripts have been working for accessing mysql data. It is only that php 5.2.6 is not working with MaxDB.

could this step in the above page caused error?
Now move (don't just copy) the file c:\php\php5ts.dll to c:\windows\php5ts.dll (or if you don't have a c:\windows directory, move it to c:\winnt).


Now, how do i know if there are 2 versions of php? I searched for the string 'php' in my computer. Except the c:\php, c:\webs directory there  is no other place where i find php or php4.

My path is set to:
C:\>path
PATH=c:\program files\sdb\programs\bin;c:\program files\sdb\programs\pgm;C:\Prog
ram Files\PC Connectivity Solution\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Sy
stem32\Wbem;c:\fox25;;C:\Program Files\jEdit
Personally, copy NOTHING to the windows folder. It isn't necessary.Put the  PHP folder into the PATH so that PHP is available to the command line AND for DLL searching.Search your entire drive for php*.exe and php*.dllAt the command prompt ...CD /D C:\DIR php*.exe /s /b > %TEMP%\php_exe.logDIR php*.dll /s /b > %TEMP%\php_dll.logNow put the 2 log files from your temp folder up here.
YES SIR
ATTACHED FILES AS REQUIRED

php-dll.log
php-exe.log
Hmm.

You said ...

"This application has failed to start becouse php4ts.dll whas not found. Reinstalling the application may fix this"

Can you check that this is what it says?

php5ts, then maybe, but php4ts suggests either 2 installations (php4 and php5) or a typo on your part or a corrupt installtion - you did get the files from www.php.net ?
I have cut and pasted the error mesgs.. no typo error
i copied the php5ts.dll into php direcotoy.
I REPLEAT.. I HAVE EXTRACTED THE FILES FOR PHP.. NO REGISTRY/INSTALLATION DONE FOR PHP.
And are u sure php 5.2.6 works with MaxDB 7.6
If not then i can go for reinstallation again.. for which i seek ur guidance.
And i downloaded php from http://www.php.net/downloads.php
Have you got libSQLDBC_C.dll available? Either in your php executables directory, in windows\system32 or in the path?
for %F IN (libSQLDBC_C.dll) do echo %~$PATH:F

I get

echo is on

as I don't have that dll.

If I use ...

for %F IN (notepad.exe) do echo %~$PATH:F

I get ...

C:\WINDOWS\system32\notepad.exe

WHich is correct.

If the libSQLDBC_C.dll is not available to PHP, it can't load it. If it can't load it, it can't load php_maxdb.dll.


http://docs.php.net/manual/en/maxdb.setup.php


"Requirements

In order to have these functions available, you must compile PHP with MaxDB support. Additionally, you must have the MaxDB SQLDBC runtime library available to access the MaxDB server.

Documentation for MaxDB SQLDBC can be found at » http://maxdb.sap.com/documentation/.

Download the MaxDB SQLDBC package from » http://www.sdn.sap.com/irj/sdn/maxdb-downloads."


You don't need to compile PHP with the MaxDB support as on windows this is done for you. But the runtime libs are NOT supplied with PHP. They come with/from MaxDB.
libSQLDBC.dll is in path: here is the extract from command screen pasted:
C:\>path
PATH=c:\program files\sdb\programs\bin;c:\program files\sdb\programs\pgm;C:\Prog
ram Files\PC Connectivity Solution\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Sy
stem32\Wbem;c:\fox25;;C:\Program Files\jEdit

C:\>for %F IN (libSQLDBC_C.dll) do echo %~$PATH:F

C:\>echo c:\Program Files\SDB\programs\pgm\libSQLDBC_C.dll
c:\Program Files\SDB\programs\pgm\libSQLDBC_C.dll


I had downloaded maxdb-all-win-32bit-i386-7_6_00_34.exe from http://dev.mysql.com/doc/maxdb/instupgrade.html .. probably that was not correct version..
Now i m downloading the file from the site u mentioned. Pls let me know installation..
thanks for the help so far..
 I THINK THIS IS THE PROBLEM:
there is one more file which i down loaded maxdb-php4-win-32bit-7_6_00_34.tgz .. And this is the cause of all the problem i guess.. In this zip i have 2 files:
php_maxdb.dll and php-4.4.0. And this php_maxdb.dll is under c:\php\ext. That i guess is the problem.
Aha.

Can you download http://docs.php.net/get/pecl-5.2.6-Win32.zip/from/a/mirror and unzip into C:\PHP\ext

This is the official php extensions.

The MaxDB content needs to come from SAP now https://www.sdn.sap.com/irj/sdn/downloads

I suspect the Community Edition downloads is the place to go ... https://www.sdn.sap.com/irj/sdn/maxdb-downloads

Take a look for ...


SAP MaxDB 7.6 for Windows (x86, 32 bit) SAP Evaluation Software
(Version 7.6.05.09, approx. 114 MB)25 Aug 2008
SAP MaxDB 7.6 for Windows (x86, 64 bit) SAP Evaluation Software
(Version 7.6.05.09, approx. 118 MB)25 Aug 2008

and


SAP MaxDB SQL Studio (for Windows only) SAP Evaluation Software
The SQL Studio tool can be used to manipulate data in databases using SQL statements. SQL Studio can be used to access databases that are running on a remote computer with a different operating system. (approx. 18.57 MB)11 Feb 2008

for the windows versions.
A .TGZ file is probably source code - no use for you, unless you can compile it. Binaries are available at the links I provided above.
ooh dear..
I got it.. I downloaded the php-maxdb.dll from http://pecl4win.php.net/ext.php/php_maxdb.dll
and now what i expected i got..
thanks a lot.. GURU..!!:)
Ramesh
Ah. Those are old versions it seems.

Well done on getting there in the end.

Good luck.

Richard.
Thanks a lot Richard.
I am a Bank Employee working as a systems person. I am learning these things on my own.

I want to build a dynamic web site for MIS/DSS applications. It envisages collection, checking for errors, consolidation and reporting of various branch data.
Where can i look for help on these lines? or any clue from u?
Thanks again
Ramesh
If you intend to do this by yourself, you have a LOT of ground to cover.HTML/CSS/JS for the front end AJAX for the middlePHP/SQL/Web server for the back endIf you've never done any programming before, I truly wouldn't know where to start. I've been doing this for over 20 years and I learnt by a LOT of hand holding on small but useful systems (Accounting and EPOS related).If the bank are willing (and they should be), get them to send you to some courses which cover the topics above. Don't do 1 course. Try and find courses which are more in depth per topic.HTML has nothing to do with PHP, so a course in &quot;web design&quot; which covers both is probably not going to give you enough info.Try to be tools and server agnostic - it will mean you can upgrade significantly easier in the future when the current solution doesn't fit any longer and you won't be tying yourself to one tool's feature which may not exist in a different product.Try to compartmentalise each part of the project.Gee. I could go on and on. There is a LOT of experience gained in my 20 years. Security, pattern usage for code re-use, scalability, unit testing, etc. All extremely useful for getting a project delivered on time and on budget.
Thanks again Richard.
Infact i got busy with something else. Meanwhile  Thanks for the guidance.
This is the first time i have asked a question on Expert Zone. I searched to find what is this points all about. But dould not find on the site.
could u pls brief me abt this?
Infact the problem was that i had downloaded maxdb-php4-win-32bit-7_6_00_34.tgz and copied the php_maxdb.dll (which has a php4 version, where as i have php 5 version). Apparantly everything seemed ok bcos this file does not suffic/prefix 4 or 5 anywhere! But we could dig out this during our discussion in 3 days. Thanks a lot.
And yes, I hope Bank arranges some such trainings. lets c.!!
Ramesh
Ha. That is a problem. There is no easy way to check a DLL for it  version.

Good luck.
and what about the Award Points here?
i have been searching for DATALOAD on maxdb.. but not getting
where can i get help on MAXDB ?
do i have to instal perl to load data into maxdb with dataload command? if so whhich version how can i do it?
ASKER CERTIFIED SOLUTION
Avatar of Richard Quadling
Richard Quadling
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
DATALOAD TABLE customer
      cno        1
      title      2
      firstname  3
      name       4
      zip        5
      address    6
      INFILE 'customer.dat'

is the command.