How to install php5-dbase extension?

apmuthu

Renowned Member
Feb 26, 2009
808
8
83
Chennai - India & Singapore
github.com
Code:
apt-get install php5-pear
apt-get install php5-dbase
The above code does not install php5-dbase.

On a fresh joomla template install, I get:
Code:
# aptitude search dbase
p   acidbase                        - Basic Analysis and Security Engine
Code:
# aptitude search pear
p   egroupware-egw-pear             - modified PEAR modules for eGroupWare
p   lxappearance                    - a new feature-rich GTK+ theme switcher
p   pearpc                          - PowerPC architecture emulator
p   php-pear                        - PEAR - PHP Extension and Application Repos
p   pysycache-dblclick-appleandpear - Apple and pear images for double click act
 
Resulting prompt while trying to install acidbase:
Code:
# apt-get install acidbase
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  dbconfig-common libcompress-raw-zlib-perl libcompress-zlib-perl
  libfont-afm-perl libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl
  libhtml-tree-perl libio-compress-base-perl libio-compress-zlib-perl
  libmailtools-perl libphp-adodb libtimedate-perl liburi-perl libwww-perl
  postgresql-client postgresql-client-8.3 postgresql-client-common
Suggested packages:
  snort-mysql snort-pgsql php5-adodb libio-socket-ssl-perl postgresql-8.3
  postgresql-doc-8.3
The following NEW packages will be installed:
  acidbase dbconfig-common libcompress-raw-zlib-perl libcompress-zlib-perl
  libfont-afm-perl libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl
  libhtml-tree-perl libio-compress-base-perl libio-compress-zlib-perl
  libmailtools-perl libphp-adodb libtimedate-perl liburi-perl libwww-perl
  postgresql-client postgresql-client-8.3 postgresql-client-common
0 upgraded, 19 newly installed, 0 to remove and 0 not upgraded.
Need to get 4638kB of archives.
After this operation, 15.8MB of additional disk space will be used.
Do you want to continue [Y/n]?
 
During the install we get:
Code:
 Configuring libphp-adodb
WARNING: include path for php has changed!                         │
 
libphp-adodb is no longer installed in /usr/share/adodb. New installation path is now /usr/share/php/adodb.
Please update your php.ini file. Maybe you must also change your web-server configuraton.
<Ok>
And:
Code:
Configuring acidbase
 
NOTE: Manual configuration required
 
You will need to go to http://localhost/acidbase first to force the
database modifications for BASE.
 
<Ok>
And:
Code:
Configuring acidbase ├──────────────────────────┐
 │                                                                           │
 │ acidbase must have a database installed and configured before it can be   │
 │ used.  If you like, this can be handled with dbconfig-common.             │
 │                                                                           │
 │ If you are an advanced database administrator and know that you want to   │
 │ perform this configuration manually, or if your database has already      │
 │ been installed and configured, you should refuse this option.  Details    │
 │ on what needs to be done should most likely be provided in                │
 │ /usr/share/doc/acidbase.                                                  │
 │                                                                           │
 │ Otherwise, you should probably choose this option.                        │
 │                                                                           │
 │ Configure database for acidbase with dbconfig-common?                     │
 │                                                                           │
 │                    <Yes>                       <No>
 
Last edited:
Code:
# apt-get install php5-dev libmysqlclient15-dev
Results in an error:
Code:
Err [URL]http://ftp.debian.org[/URL] lenny/main libc6-dev 2.7-18
  404 Not Found [IP: 130.89.149.226 80]
Failed to fetch [URL]http://ftp.debian.org/debian/pool/main/g/glibc/libc6-dev_2.7-18_i386.deb[/URL]  404 Not Found [IP: 130.89.149.226 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
On searching tsome repos, there is a similar file available at:
http://security.debian.org/debian-security/pool/updates/main/g/glibc/libc6-dev_2.7-18lenny2_i386.deb
 
After a apt-get update and apt-get dist-upgrade we can now install:
Code:
# apt-get install php5-dev libmysqlclient15-dev

The current /etc/apt/sources.list file has the following contents:
Code:
deb [URL]http://ftp.debian.org/debian[/URL] lenny main contrib
deb [URL]http://security.debian.org[/URL] lenny/updates main contrib
Included the following lines to it:
Code:
#Uncomment if you want the Sources
deb-src [URL]http://ftp.debian.org/debian[/URL] lenny main contrib nonfree
deb-src [URL]http://security.debian.org[/URL] lenny/updates main contrib nonfree

Even now we get an error when we try to install the php5 sources:
Code:
# apt-get source php5
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Could not open file /var/lib/apt/lists/ftp.debian.org_debian_dists_lenny_main_source_Sources - open (2 No such file or directory)
How do we then install the php5-dbase extension?
 
Extracted dbase.so from ftp://194.199.20.114/linux/fedora/r.../i386/os/Packages/php-common-5.2.6-5.i386.rpm located at http://www.rpmfind.net/linux/rpm2html/search.php?query=php-common

and uploaded it to /usr/lib/php5/20060613+lfs/ where the other extensions reside. Whilst the other extensions are loaded automatically, we need to include the following line into the php.ini files at /etc/php5/apache2/ and /etc/php5/cli/ folders :
Code:
extension=dbase.so
Then we restart apache:
Code:
apache2ctl restart

Place a test file called say dbasetest.php in the webroot with the following code:
Code:
<?php
// database "definition"
$def = array(
  array("date",     "D"),
  array("name",     "C",  50),
  array("age",      "N",   3, 0),
  array("email",    "C", 128),
  array("ismember", "L")
);
// creation
if (!dbase_create('/tmp/test.dbf', $def)) {
  echo "Error, can't create the database\n";
}
?>
and execute it at http://ipaddress/dbasetest.php and you will find that there is a test.dbf file created in the /tmp folder.
 

Attachments

  • BlueOnyx-PHP5-DBASE Info.zip
    20.1 KB · Views: 38
Last edited:
Solved at last.

The PHP tar.gz source file from www.php.net (or http://museum.php.net for archives) contains all major PECL extensions including dBASE.

I used a fresh install of the OpenVZ Joomla template running on ProxMox v1.4 - to install php5-dbase.

The following did not work:
Code:
## apt-get install php5-dbase
## nano /etc/apt/sources.list
## apt-get source php5
## ls /var/lib/apt/lists -lR

Preliminary Checks:
Code:
locate php.ini
cd /etc/php5/apache2
nano php.ini ## insert extension=dbase.so
cd /etc/php5/cli
nano php.ini ## insert extension=dbase.so
apt-get -V check php5-*
apt-cache search dbase
cd /
locate *.so
The actual compile and install:
Code:
apt-get install php5-pear php5 php5-dev php5-cli libmysqlclient15-dev gcc make
wget [URL]http://packages.debian.org/lenny/i386/libc6-dev/download[/URL]
mkdir /php
cd php
ls -al
wget [URL]http://museum.php.net/php5/php-5.2.6.tar.gz[/URL]
tar -zxvf php-5.2.6.tar.gz 
chown -R root:root php-5.2.6
cd php-5.2.6/ext/dbase
## save the original dbase and overwrite with our r2 update attached herewith
zip -r dbase-org.zip * phpize
./configure
make
cp /php/php-5.2.6/ext/dbase/modules/dbase.so /usr/lib/php5/20060613+lfs
cd /
rm -r /php
apache2ctl restart
cd /var/www/joomla ## Transfer the PHP-dbase Test PHP script
chown www-data:www-data dbasetest.php 
apache2ctl restart ## verify the phpinfo page
apt-get remove php5-dev libmysqlclient15-dev gcc make
apt-get autoremove

The attached zip file has a dbasetest.php file and an i386 compiled dbase.so file along with the SVN source code for the php5-dbase extension - extended for extra field types.
 

Attachments

  • php5-dbase-files.zip
    68.4 KB · Views: 104
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!