PHP 4.X+Apache 2.X+Pervasive v7.X ODBC Problems

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
Post Reply
periko
Posts: 96
Joined: 2007/05/04 23:41:52
Location: Aztec Land

PHP 4.X+Apache 2.X+Pervasive v7.X ODBC Problems

Post by periko » 2008/04/02 01:29:24

Hi.

I have one Pervasive 7.x running in one linux box with Centos 4.6, from windows clients no problem because we install on each one the client software.

Now we want to change some app from GUI to web, we install apache 2.x + php 4.x + php-odbc + unixodbc to run this.

Pervasive use his own paths, doesn't use the standard linux paths, I add the library path to linux, and add my dns to /etc/odbc.ini(ln -s /etc/odbc.ini /usr/local/psql/etc)

This my odbc.ini

[Data Sources]
DEMODATA=Pervasive ODBC Engine Interface

[DEMODATA]
Driver=/usr/local/psql/lib/libsrde.so
Description=Pervasive ODBC Engine Interface: database DEMODATA
DBQ=DEMODATA

We test isql and we can connect to pervasive and query the database:

root@server1 ~]# isql -v DEMODATA
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+

SQL> select * from class where id=4
+------------+--------+--------+---------+-----------+-----------+------------+--------------------------+------------+-----------------------+
| ID | Name | Section| Max_Size| Start_Date| Start_Time| Finish_Time| Building_Name | Room_Number| Faculty_ID |
+------------+--------+--------+---------+-----------+-----------+------------+--------------------------+------------+-----------------------+
| 4 | ACC 102| 001 | 30 | 1995-06-05| 14:00:00 | 16:50:00 | Bhargava Building | 102 | 325173078 |
+------------+--------+--------+---------+-----------+-----------+------------+--------------------------+------------+-----------------------+
SQLRowCount returns -1
1 rows fetched

Here everything is working as u can see. Now we can run some test script from shell and no problem:

[root@server1 html]# php odbc2.php
Content-type: text/html
X-Powered-By: PHP/4.3.9

CTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">


PHP Sample



IDNameSectionMax_SizeStart_DateStart_TimeFinish_TimeBuilding_NameRoom_NumberFaculty_ID

4ACC 102001301995-06-0514:00:0016:50:00Bhargava Building 102325173078

Number of Fields: 10



I change the query just to return me 1 row and success.

The problem i got right now is that if we run this script from the browser i receive this:

CTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Warning: odbc_connect(): SQL error: [unixODBC][Pervasive][ODBC Engine Interface][Data Record Manager]The MicroKernel or Btrieve Requester is inactive(Btrieve Error 20), SQL state S1000 in SQLConnect in /var/www/html/odbc2.php on line 9

Could not connect to databases

The service is running, if not the first 2 steps wouldn't work.

I have been searching about Pervasive and PHP, a lot people just tell me that this can be done because Pervasive site say, but i still don't know someone with something like this in the real world.

If this is possible, hope someone could give a clue what I'm missing, thanks all for your time... :-D

kentyler
Posts: 161
Joined: 2007/06/20 13:31:05
Location: Northeast Ohio
Contact:

Re: PHP 4.X+Apache 2.X+Pervasive v7.X ODBC Problems

Post by kentyler » 2008/04/18 20:11:02

It looks like either your database is working via a network socket and that may be firewalled, or you have to allow the machine's ip address(s) to connect to the machine in either the database or the config file for this database.

Your post does not contain information like;

the config file(s)

output of netstat -anp

Post Reply

Return to “CentOS 4 - Server Support”