PDA

View Full Version : How to retrieve data on server by using PHP?


Ran520
10-02-2009, 05:46 PM
Our server is FSFDT Windows FSD Beta from FSD V3.000 draft 9.
Now I want to get the data of the pilots which are online. also, I want to perform some actions like boot out. Can anybody give any example?Thanks so much!:)

Ran520
10-08-2009, 04:53 PM
Mr.James, can you help me ? thanks so much.

L. D. James
10-09-2009, 03:15 PM
Our server is FSFDT Windows FSD Beta from FSD V3.000 draft 9.
Now I want to get the data of the pilots which are online. also, I want to perform some actions like boot out. Can anybody give any example?Thanks so much!:)

The FSDBase utility from the download section do much of what you mention. However, it itn's a php utilize, it's programmed in Perl. It works on Linux, it can be configured to utilize the data from any server regardless of the server platform, but the utility itself has to run on a Linux machine.

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames

Ran520
10-13-2009, 08:31 PM
Thanks so much Mr James.I try it!

Rius
12-10-2010, 07:49 PM
I am also interested to install fsdbase on Ubuntu 10.04.
The FSD server is on another Windows machine.

When I run ./Setup.sh, I get an error:

. / Setup.sh:. / Checkformodules.pl: / usr / local / bin / perl: bad interpreter: No such file or folder of this type
Can not continue ... [Neccesary Perl modules not installed] correct errors and run setup again.

How to install FSDBase on Ubuntu and configure with the server FSD on Windows machine?

L. D. James
12-11-2010, 06:19 AM
I am also interested to install fsdbase on Ubuntu 10.04.
The FSD server is on another Windows machine.

When I run ./Setup.sh, I get an error:

. / Setup.sh:. / Checkformodules.pl: / usr / local / bin / perl: bad interpreter: No such file or folder of this type
Can not continue ... [Neccesary Perl modules not installed] correct errors and run setup again.

How to install FSDBase on Ubuntu and configure with the server FSD on Windows machine?

I'll fix this problem over the weekend and give you and update.

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames

Rius
12-11-2010, 10:09 AM
I'll fix this problem over the weekend and give you and update.


Thank you very much

L. D. James
12-11-2010, 01:30 PM
Thank you very much

The downloaded file has been updated from version 187 to 187a. The error you were getting should be resolved.

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames

Rius
12-11-2010, 01:57 PM
Ok thank you I'll try and I'll let you know

Rius
12-11-2010, 03:23 PM
I do not know how to configure Ubuntu FSDBase on SDF with the server is on a windows machine. I think I must change the following line, but I do not know what to put.
packagelocation = /usr/local/fsdbase
fsdconf = /usr/local/etc/fsd/fsd.conf

L. D. James
12-11-2010, 03:35 PM
I do not know how to configure Ubuntu FSDBase on SDF with the server is on a windows machine. I think I must change the following line, but I do not know what to put.
packagelocation = /usr/local/fsdbase
fsdconf = /usr/local/etc/fsd/fsd.conf

Packagelocation is where you want to have your package installed (the directory where you've opened it will suffice).

For fsdconf, take the fsd.conf file from your windows server and place it in the location your specify to where it happens to be. You can actually place it in the same area where your package is installed (or the directory where you opened it).

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames

Rius
12-11-2010, 03:51 PM
The database is now created but I have a new error:

Verfying neccessary perl modules are installed...
..................
Checking for tables for database: fsdbase...
Creating tables...
Tables Created...
Can't open whazzup data file. Verify the FSD server is running and the whazzup datafile
file entry is correct in the fsdbase.cfg config file.
Error creating cron program.

If I copy the file whazzup.txt in the folder with the fsdbase fsd.conf, it will not change during the connection

L. D. James
12-11-2010, 04:32 PM
The database is now created but I have a new error:

Verfying neccessary perl modules are installed...
..................
Checking for tables for database: fsdbase...
Creating tables...
Tables Created...
Can't open whazzup data file. Verify the FSD server is running and the whazzup datafile
file entry is correct in the fsdbase.cfg config file.
Error creating cron program.

If I copy the file whazzup.txt in the folder with the fsdbase fsd.conf, it will not change during the connection

Run a cron file to grab the data at regular intervals. If you have problems with this I'll write a script to do it.

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames

Rius
12-11-2010, 04:48 PM
I do not know how to create the cron file.

quick question off topic, on which Linux I can install the FSD server without problem? because on Ubuntu it is impossible to compile

L. D. James
12-11-2010, 05:17 PM
I do not know how to create the cron file.

I'll write a script for that and post it before the weekend in over.

quick question off topic, on which Linux I can install the FSD server without problem? because on Ubuntu it is impossible to compile

The last time I compiled it was on a Fedora machine version 10, 2 years ago. I haven't installed the latest Fedora to see if anything changed. But I'm almost certain the gc++ and c++ packages are basically the same in most of the recent versions.

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames

Rius
12-11-2010, 05:29 PM
too bad the server not work with Ubuntu: (
I'll try the latest version of Fedora and I'll keep you informed.

Thank you for the script

Rius
12-11-2010, 09:11 PM
I install fedora 14, then FSD server, everything works fine

I wanted to try installing fsdbase above to avoid problems, but I miss Perl Module and I know how to install

Verfying neccessary perl modules are installed...

Perl Module:[ CGI::Carp ] NOT installed. Install the module then run setup again.
.
Perl Module:[ CGI::Cookie ] NOT installed. Install the module then run setup again.

Perl Module:[ Mail::Send ] NOT installed. Install the module then run setup again.
.....
Perl Module:[ CGI::Cookie ] NOT installed. Install the module then run setup again.
........
Can't continue... [Neccesary Perl modules not installed] correct errors and run setup again.

L. D. James
12-11-2010, 11:58 PM
Use cpan. This is an example:

perl -MCPAN -e shell [as root]
o conf prerequisites_policy ask
install CGI::Carp
quit


-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames

Rius
12-12-2010, 09:47 PM
I spent much of the day looking but I still blocking.

Verfying neccessary perl modules are installed...
..................
Can't Find FSDConf File...
Compilation failed in require at ./main.pl line 18.
BEGIN failed--compilation aborted at ./main.pl line 20.
Can't continue... [Database access Error] correct database error and run setup again.
fsdbase.cfg:
dbname = fsdbase
dbuser = userfsdbase
dbpass = xxxxxx
timezone = +1
packagelocation = /home/eapv/Serveur/fsdbase
fsdconf = /home/eapv/Serveur/fsd/unix/fsd.conf
|-- fsd
| `-- unix
| |-- adminhelp.txt
| |-- cert.txt
| |-- fsd
| |-- fsd.conf
| |-- fsd_d.sh
| |-- fsd.sh
| |-- killfsd.sh
| |-- log.txt
| |-- metarnew.txt
| |-- motd.txt
| `-- whazzup.txt
`-- fsdbase
|-- admin.pl
|-- background.gif
|-- checkformodules.pl
|-- fsdbase.cfg
|-- fsdbase.htm
|-- login.htm
|-- main.pl
|-- modlist.txt
|-- package.lst
|-- readme.txt
|-- setup.sh
|-- stats.pl
`-- variables.pl
I can not find the error.
httpd msqld, php and phpmyadmin installed

For FSDBASE, is it possible to install the database on another server?
Because I have another production server on ubuntu with a database and a web server

Thank you for your patience.:o

L. D. James
12-13-2010, 09:24 AM
I spent much of the day looking but I still blocking.

Verfying neccessary perl modules are installed...
..................
Can't Find FSDConf File...
Compilation failed in require at ./main.pl line 18.
BEGIN failed--compilation aborted at ./main.pl line 20.
Can't continue... [Database access Error] correct database error and run setup again.
fsdbase.cfg:
dbname = fsdbase
dbuser = userfsdbase
dbpass = xxxxxx
timezone = +1
packagelocation = /home/eapv/Serveur/fsdbase
fsdconf = /home/eapv/Serveur/fsd/unix/fsd.conf
|-- fsd
| `-- unix
| |-- adminhelp.txt
| |-- cert.txt
| |-- fsd
| |-- fsd.conf
| |-- fsd_d.sh
| |-- fsd.sh
| |-- killfsd.sh
| |-- log.txt
| |-- metarnew.txt
| |-- motd.txt
| `-- whazzup.txt
`-- fsdbase
|-- admin.pl
|-- background.gif
|-- checkformodules.pl
|-- fsdbase.cfg
|-- fsdbase.htm
|-- login.htm
|-- main.pl
|-- modlist.txt
|-- package.lst
|-- readme.txt
|-- setup.sh
|-- stats.pl
`-- variables.pl
I can not find the error.
httpd msqld, php and phpmyadmin installed

Leave the name off the path to the fsd.conf file. It's looking for the path not the pathname... the directory where the file is located.

For FSDBASE, is it possible to install the database on another server?
Because I have another production server on ubuntu with a database and a web server

Thank you for your patience.:o

Yes. Follow the original procedure that I gave you when you had the server on the Windows machine and run a cron job to bring the data to the local machine. Performing that step is kind of simple when knowing how to run a cron. It might take me a minute to create one for you, which I mentioned before I’d do if it’s necessary.

Edit: Sorry about the mixup with the fsdbase.cfg.sample file. I created it specifically for you and typed it wrong. Thanks for testing and reporting on this.

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames

Rius
12-13-2010, 11:38 AM
FSDCONF the problem is resolved.

Verfying neccessary perl modules are installed...
..................
DBI connect('fsdbase','eapv',...) failed: Access denied for user 'eapv'@'localhost' (using password: YES) at ./main.pl line 54
Can't continue... [Database access Error] correct database error and run setup again.


But the script fails to connect to the database locally.
I used a PHP script to test the connection to the database and everything works.

Successfully connected to the server 'localhost'
MySQL client info: 5.1.52 Successfully connected to the database 'fsdbase'
The database 'fsdbase' contains no tables.

L. D. James
12-13-2010, 03:00 PM
FSDCONF the problem is resolved.

Verfying neccessary perl modules are installed...
..................
DBI connect('fsdbase','eapv',...) failed: Access denied for user 'eapv'@'localhost' (using password: YES) at ./main.pl line 54
Can't continue... [Database access Error] correct database error and run setup again.


But the script fails to connect to the database locally.
I used a PHP script to test the connection to the database and everything works.

Apparently you're doing something different this time than what you did before. You showed a different out put where the database was accessed and the tables were created.

Check very closely the name and password you have for the database and try it again.

The only way that error message you show can be generated is by the username or password not being correct.

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames

Rius
12-13-2010, 06:45 PM
The connection to the database is OK, but I have a new error.
The server FSD is up and the file whazzup OK

Verfying neccessary perl modules are installed...
..................
Checking for tables for database: fsdbase...
Can't open whazzup data file. Verify the FSD server is running and the whazzup datafile
file entry is correct in the fsdbase.cfg config file.
Error creating cron program.


I do not understand, it happens to read the FSD.CONF but it can not open the Whazzup.txt while they are in the same folder.

Rius
12-16-2010, 12:37 AM
You would have an idea?:D:(

L. D. James
12-16-2010, 09:28 AM
The connection to the database is OK, but I have a new error.
The server FSD is up and the file whazzup OK

Verfying neccessary perl modules are installed...
..................
Checking for tables for database: fsdbase...
Can't open whazzup data file. Verify the FSD server is running and the whazzup datafile
file entry is correct in the fsdbase.cfg config file.
Error creating cron program.


I do not understand, it happens to read the FSD.CONF but it can not open the Whazzup.txt while they are in the same folder.

Will you tell me the following:

What is the permissions of the whazzup.txt file?

Who is the owner of the whazzup.txt file?

How did you start the fsd server?

What is the userID and Group of the process running the server?

What is the webpage address of the whazzup.txt file?

Does it work in serveinfo?

What do you have in the "whazzup=" parameter of the fsd.conf file?

-- L. James

--
L. D. James
ljames@apollo3.com
www.apollo3.com/~ljames