klabaza
MIS
- Aug 3, 2005
- 59
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 + 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.
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">
<HTML>
<HEAD>
<TITLE>PHP Sample</TITLE>
</HEAD>
<BODY>
<table border=1>
<th>ID</th><th>Name</th><th>Section</th><th>Max_Size</th><th>Start_Date</th><th>Start_Time</th><th>Finish_Time</th><th>Building_Name</th><th>Room_Number</th><th>Faculty_ID</th>
<tr>
<td>4</td><td>ACC 102</td><td>001</td><td>30</td><td>1995-06-05</td><td>14:00:00</td><td>16:50:00</td><td>Bhargava Building </td><td>102</td><td>325173078</td></tr>
</table>
<p>Number of Fields: 10</p>
</BODY>
</HTML>
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/ 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...
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 + 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.
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">
<HTML>
<HEAD>
<TITLE>PHP Sample</TITLE>
</HEAD>
<BODY>
<table border=1>
<th>ID</th><th>Name</th><th>Section</th><th>Max_Size</th><th>Start_Date</th><th>Start_Time</th><th>Finish_Time</th><th>Building_Name</th><th>Room_Number</th><th>Faculty_ID</th>
<tr>
<td>4</td><td>ACC 102</td><td>001</td><td>30</td><td>1995-06-05</td><td>14:00:00</td><td>16:50:00</td><td>Bhargava Building </td><td>102</td><td>325173078</td></tr>
</table>
<p>Number of Fields: 10</p>
</BODY>
</HTML>
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/ 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...