Jump to content


Photo

How do I integrate MongoDB Stand-alone with Uniserver Zero XI, to enable updating the DB using PHP?

MongoDB UniserverZeroXI

  • Please log in to reply
1 reply to this topic

#1 LinvingFossil

LinvingFossil

    Newbie

  • Member
  • Pip
  • 1 posts
  • Gender:Male
  • IRC Nickname: LivingFossil
  • Main OS: Windows 7

Posted 28 May 2014 - 07:57 AM

I have installed Uniserver version Zero XI 11.1.7 on my computer which runs under Windows 7.

 

It was pleasing to see that this comes pre-loaded with a PHP extension PHP_mongo.dll and its details show up fine when I call  PHP-Info().

 

Following the advice given by the tutorials on your web site I have also installed on my computer the MongoDB, version V 1.0 21-7-2010 mongo_standalone_v1_0.

 

Both Uniserver and MongoDB live on my local  C  drive in their own distinct folders  as follows
:C/mongodb_1
and
:C/UniServerZ

Both of these seem to be operating well judging by some simple tests I conducted. However,  I presume something more needs to happen before I am able to access and read documents  in that mongo database with PHP from within Uniserver, as that is not the case at the present.

 

I have tried to also replace the php_mongo.dll extension of Uniserver with the one that is supllied with the standalone mongodb, but this was to no avail. In fact this replacment PHP extension does not even show up  in the php-info().

 

Can you please advise me as to what I need to do in order to integratie that standalone mongo database with my Uniserver? Basically, I want to be able to access and update mongo documents using PHP from within Uniserver.

Thank you,
 

"Living Fossil"



#2 Ric

Ric

    Project Manager

  • Admin
  • PipPipPipPipPip
  • 1,535 posts
  • Gender:Male
  • Location:Cambridge,UK
  • Interests:Electronics
    Internet in general
    Open source projects
  • SourceForge IDmpgcan
  • Wiki ID: Ric
  • Main OS: Windows XP

Posted 29 May 2014 - 01:39 PM

The mongo_standalone_v1_0 is old and implemented using a obsolute version of PHP. Consider using the latest version of MongoDB which for a fixed installation is very easy to install. Proceed as follows:

 

1 Download the latest version of MongoDB from http://www.mongodb.org/downloads depending on your os version download either the 32 or 64 zip.

2 Save this to some folder for example C:\MongoDB

3 Extract the downloaded file (for example mongodb-win32-i386-2.6.1 ) to this folder

4 Navigate to the bin folder (C:\MongoDB\mongodb-win32-i386-2.6.1\mongodb-win32-i386-2.6.1\bin)

5 In this folder create a text file named run.bat add the following line mongod.exe and save file.

6 Create a new folder C:\data\db note this is the default that MongoDB uses for storing databases.

 

That completes the installation. To run MongoDB double click on file run.bat (if challenged allow) this opens a command window which remains open while MongoDB is running. Do not close this window by clicking the red cross. To prevent data loss stop MongoDB by clicking the title bar (highlights the window) and press and hold ctrl key while pressing the c key.

 

Note: No modifications are required to Zero XI 11.1.7 start MongoDB as above and start Apache server from UniController. Place some test code in folder www and check you can access MongoDB.

 

All the best

Ric






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users