473,396 Members | 2,014 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

[PHP 4.4.6] BerkeleyDB or equivalent?

Hi

If possible, I'd like to use a file-based, simpler alternative to
MySQL such as BerkeleyDB to manage a two-column database (phone number
-name), but I'm not sure my hoster supports this kind of thing:

---------------
Configure Command ./configure --with-mysql=/usr/local/mysql
--with-config-file-path=/opt3/local/apache/conf --with-gd
--enable-gd-native-ttf --enable-gd-imgstrttf
--with-jpeg-dir=/usr/local --with-ttf=/usr
--with-freetype-dir=/usr/local --with-zlib-dir=/usr/local
--with-zlib=/usr/local --with-imap=/usr/local/imap-2006g
--with-imap-ssl=/usr/local/ssl --without-kerberos
--with-dom=/usr/local --with-sablot=/usr/local --enable-xslt
--with-xslt-sablot --with-png-dir=/usr/local --with-pdflib=/usr/local
--with-curl=/usr/local/ --with-mcrypt=/usr/local
--with-ming=/usr/local --with-gettext=/usr/local
--with-apxs=/opt3/local/apache/bin/apxs --enable-track-vars
--with-regex=system --with-pear --enable-ftp --enable-bcmath
--enable-mbstring --enable-exif --enable-calendar
--enable-memory-limit --enable-trans-sid --enable-libgcc
--enable-inline-optimization --disable-debug

Apache
Loaded Modules mod_php4, mod_setenvif, mod_so, mod_headers,
mod_expires, mod_proxy, mod_auth, mod_access, mod_rewrite, mod_alias,
mod_speling, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir,
mod_autoindex, mod_include, mod_info, mod_status, mod_negotiation,
mod_mime, mod_mime_magic, mod_log_config, mod_env, http_core
---------------

If not, is there some PHP source file that I can include in my script?

Thank you.
May 8 '07 #1
5 1691
Gilles Ganault wrote:
Hi

If possible, I'd like to use a file-based, simpler alternative to
MySQL such as BerkeleyDB to manage a two-column database (phone number
-name), but I'm not sure my hoster supports this kind of thing:

---------------
Configure Command ./configure --with-mysql=/usr/local/mysql
--with-config-file-path=/opt3/local/apache/conf --with-gd
--enable-gd-native-ttf --enable-gd-imgstrttf
--with-jpeg-dir=/usr/local --with-ttf=/usr
--with-freetype-dir=/usr/local --with-zlib-dir=/usr/local
--with-zlib=/usr/local --with-imap=/usr/local/imap-2006g
--with-imap-ssl=/usr/local/ssl --without-kerberos
--with-dom=/usr/local --with-sablot=/usr/local --enable-xslt
--with-xslt-sablot --with-png-dir=/usr/local --with-pdflib=/usr/local
--with-curl=/usr/local/ --with-mcrypt=/usr/local
--with-ming=/usr/local --with-gettext=/usr/local
--with-apxs=/opt3/local/apache/bin/apxs --enable-track-vars
--with-regex=system --with-pear --enable-ftp --enable-bcmath
--enable-mbstring --enable-exif --enable-calendar
--enable-memory-limit --enable-trans-sid --enable-libgcc
--enable-inline-optimization --disable-debug

Apache
Loaded Modules mod_php4, mod_setenvif, mod_so, mod_headers,
mod_expires, mod_proxy, mod_auth, mod_access, mod_rewrite, mod_alias,
mod_speling, mod_actions, mod_imap, mod_asis, mod_cgi, mod_dir,
mod_autoindex, mod_include, mod_info, mod_status, mod_negotiation,
mod_mime, mod_mime_magic, mod_log_config, mod_env, http_core
---------------

If not, is there some PHP source file that I can include in my script?

Thank you.
How big is your DB? If it is small enough to fit into memory, you can
simply store it in a php file:

file db.php

<? $DB=array('Bob'=>'bobs phone','Tom'=>'toms phone' etc);

file main.php:
include 'db.php';

// manipulate $DB array
.....

// save
file_put_contents('db.php', '<?$DB=' . var_export($DB,1));
--
gosha bine

extended php parser ~ http://code.google.com/p/pihipi
blok ~ http://www.tagarga.com/blok
May 8 '07 #2
At Tue, 08 May 2007 07:38:58 +0200, Gilles Ganault let his monkeys type:
Hi

If possible, I'd like to use a file-based, simpler alternative to
MySQL such as BerkeleyDB to manage a two-column database (phone number
-name), but I'm not sure my hoster supports this kind of thing:
Thank you.
Use phpinfo() to see what's supported by your host.
I wonder what makes you want to go BerkelyDB instead of MySQL though.

Sh.
May 8 '07 #3
Try sqlite. You'll need to reconfigure PHP with the extention, but I
think it's what you're looking for.
http://www.sqlite.org/

May 8 '07 #4
On Tue, 08 May 2007 09:13:51 +0200, gosha bine <st********@gmail.com>
wrote:
>How big is your DB? If it is small enough to fit into memory, you can
simply store it in a php file:
Thanks. I'll give it a shot.
May 9 '07 #5
On May 8, 1:38 am, Gilles Ganault <nos...@nospam.comwrote:
Hi

If possible, I'd like to use a file-based, simpler alternative to
MySQL such as BerkeleyDB to manage a two-column database (phone number
-name), but I'm not sure my hoster supports this kind of thing
MySQL does have a BerkelyDB interface, but I'm not sure if this is
relevant in your case

http://dev.mysql.com/doc/refman/5.0/...ge-engine.html

-Mike PII

May 9 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Phil Powell | last post by:
I might have found a rather bad hole in PHP OO design for Versions 4.3.2 involving static class-level rendering, like in Java. Please read my thread at...
3
by: Phil Powell | last post by:
<?php class SuperClass { var $mySuperClassVar; function SuperClass($myVar) { $this->mySuperClassVar = $myVar; echo "super class var = $myVar<p>"; }
3
by: Phil Powell | last post by:
I need to find a PHP equivalent to a very familiar TCL command "subst" (see http://www.hume.com/html84/mann/subst.html ). This command will take a string and evaluate anything TCL inside of it...
29
by: Catalin | last post by:
Can Python replace PHP? Can I use a python program to make an interface to a mysql 4.X database? If that's possible where can I find a tutorial?
0
by: Gerard | last post by:
I have the Berkeley DB installed on my site. Using CPAN, I have attempted to install the BerkeleyDB module. For whatever reason, I cannot install it. This is a snippet of the installation dialog. ...
0
by: ulysses | last post by:
Hi, Does anyone have a good example of pre-creating BerkeleyDB connection and sharing the connection between multiple threads. Currently, I'm running Apache 2.0.49 (MPM worker) with mod perl...
0
by: RikardN | last post by:
Hi, I am looking for any information regarding BerkeleyDB XML for .NET or if anybody have information regarding an alternativ (free) to BerkeleyDB XML for storing XML and using XQuery. (Yes...
0
by: Wendeline | last post by:
Does any one know Embedded Berkeleydb's performance vs. Embeded MySQL's. ? Any idea would help. Thanks a lot.
18
by: Csaba Gabor | last post by:
Is there a straightforward way of implementing a PHP equivalent to window.setTimeout? In a javascript web app, it's often the case that things are done on an event driven basis. For example,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.