EmbeddedRelated.com
Forums
Memfault Beyond the Launch

How to use PHP in ZHTML, for RabbitCore communication with a MySQL database?

Started by danieltaju January 30, 2007
I am using:
- a RCM3700 RabbitCore Development Kit
- Dynamic C v9.21
- RabbitWeb v105

I need to estabilish a communication between the RCM3700 and a MySQL
database, so I can store the temperature data, captured from the
thermistor, in the MySQL database.

For example, to install PHP v4.4.2 on WinXP:
(1) Download php-4.4.2-Win32.zip from http://www.php.net/downloads.php
(2) Extract contents to C:\php
(3) Copy the files "php4apache2.dll", "php4ts.dll", "php.ini", to the
"C:\WINDOWS\system32" folders
(4) Copy the files "php4apache2.dll", "php4ts.dll", to the "C:\Program
Files\Apache Group\Apache2\bin" folder
(5) Copy the files in the "C:\php\sapi" folder to the "C:\php" folder

This will enable the Apache Web Server to communicate with a MySQL
database, using PHP scripts embedded in the HTML code.

So, how can I install PHP on the RabbitWeb server (same way as PHP is
installed on the Apache Web Server) and how can I incorporate PHP
scripts on ZHTML?

If there are other methods to store data, retrieved from the RCM3700's
inputs, on a remote database, besides PHP and MySQL, please any
suggestions are welcome.

Thanks
danieltaju wrote:
> I am using:
> - a RCM3700 RabbitCore Development Kit
> - Dynamic C v9.21
> - RabbitWeb v105
>
> I need to estabilish a communication between the RCM3700 and a MySQL
> database, so I can store the temperature data, captured from the
> thermistor, in the MySQL database.
>
> For example, to install PHP v4.4.2 on WinXP:
> (1) Download php-4.4.2-Win32.zip from http://www.php.net/downloads.php
> (2) Extract contents to C:\php
> (3) Copy the files "php4apache2.dll", "php4ts.dll", "php.ini", to the
> "C:\WINDOWS\system32" folders
> (4) Copy the files "php4apache2.dll", "php4ts.dll", to the "C:\Program
> Files\Apache Group\Apache2\bin" folder
> (5) Copy the files in the "C:\php\sapi" folder to the "C:\php" folder
>
> This will enable the Apache Web Server to communicate with a MySQL
> database, using PHP scripts embedded in the HTML code.
>
> So, how can I install PHP on the RabbitWeb server (same way as PHP is
> installed on the Apache Web Server) and how can I incorporate PHP
> scripts on ZHTML?
>
> If there are other methods to store data, retrieved from the RCM3700's
> inputs, on a remote database, besides PHP and MySQL, please any
> suggestions are welcome.
>
> Thanks
>
Install PHP on the web server and have it process requests from the
rabbit and store them in the database.
------
| Scott G. Henion| s...@shdesigns.org |
| Consultant | Stone Mountain, GA |
| SHDesigns http://www.shdesigns.org |
------
Rabbit libs: http://www.shdesigns.org/rabbit/
today's fortune
Zoidberg: Uncle Zoid, you're looking young enough to be thrown back!
Not Invented here.. meaning No there is no way to 'install PHP' on a
Rabbit server...

--.- Dave

--- In r..., "danieltaju"
wrote:
>
> I am using:
> - a RCM3700 RabbitCore Development Kit
> - Dynamic C v9.21
> - RabbitWeb v105
>
> I need to estabilish a communication between the RCM3700 and a
MySQL
> database, so I can store the temperature data, captured from the
> thermistor, in the MySQL database.
>
> For example, to install PHP v4.4.2 on WinXP:
> (1) Download php-4.4.2-Win32.zip from
http://www.php.net/downloads.php
> (2) Extract contents to C:\php
> (3) Copy the files "php4apache2.dll", "php4ts.dll", "php.ini", to
the
> "C:\WINDOWS\system32" folders
> (4) Copy the files "php4apache2.dll", "php4ts.dll", to
the "C:\Program
> Files\Apache Group\Apache2\bin" folder
> (5) Copy the files in the "C:\php\sapi" folder to the "C:\php"
folder
>
> This will enable the Apache Web Server to communicate with a MySQL
> database, using PHP scripts embedded in the HTML code.
>
> So, how can I install PHP on the RabbitWeb server (same way as PHP
is
> installed on the Apache Web Server) and how can I incorporate PHP
> scripts on ZHTML?
>
> If there are other methods to store data, retrieved from the
RCM3700's
> inputs, on a remote database, besides PHP and MySQL, please any
> suggestions are welcome.
>
> Thanks
>
Look in the files section, there is a MySQL .lib

Co-Incidentally, in your case it *could* work for you.
I was able to make 'inserts' from my RCM3700, but 'selects' didn't fair as
well.

Dan...
On 1/30/07, Dave August wrote:
>
> Not Invented here.. meaning No there is no way to 'install PHP' on a
> Rabbit server...
>
> --.- Dave
>
> --- In r... ,
> "danieltaju" wrote:
> >
> > I am using:
> > - a RCM3700 RabbitCore Development Kit
> > - Dynamic C v9.21
> > - RabbitWeb v105
> >
> > I need to estabilish a communication between the RCM3700 and a
> MySQL
> > database, so I can store the temperature data, captured from the
> > thermistor, in the MySQL database.
> >
> > For example, to install PHP v4.4.2 on WinXP:
> > (1) Download php-4.4.2-Win32.zip from
> http://www.php.net/downloads.php
> > (2) Extract contents to C:\php
> > (3) Copy the files "php4apache2.dll", "php4ts.dll", "php.ini", to
> the
> > "C:\WINDOWS\system32" folders
> > (4) Copy the files "php4apache2.dll", "php4ts.dll", to
> the "C:\Program
> > Files\Apache Group\Apache2\bin" folder
> > (5) Copy the files in the "C:\php\sapi" folder to the "C:\php"
> folder
> >
> > This will enable the Apache Web Server to communicate with a MySQL
> > database, using PHP scripts embedded in the HTML code.
> >
> > So, how can I install PHP on the RabbitWeb server (same way as PHP
> is
> > installed on the Apache Web Server) and how can I incorporate PHP
> > scripts on ZHTML?
> >
> > If there are other methods to store data, retrieved from the
> RCM3700's
> > inputs, on a remote database, besides PHP and MySQL, please any
> > suggestions are welcome.
> >
> > Thanks
> >
>
Hi,
It is interesting topic for me
Do you mean we can not run PHP languages under RCM technology ? because I was thinking to some search about so did you try it before ?

Thank you ?

Scott Henion wrote:

danieltaju wrote:
> I am using:
> - a RCM3700 RabbitCore Development Kit
> - Dynamic C v9.21
> - RabbitWeb v105
>
> I need to estabilish a communication between the RCM3700 and a MySQL
> database, so I can store the temperature data, captured from the
> thermistor, in the MySQL database.
>
> For example, to install PHP v4.4.2 on WinXP:
> (1) Download php-4.4.2-Win32.zip from http://www.php.net/downloads.php
> (2) Extract contents to C:\php
> (3) Copy the files "php4apache2.dll", "php4ts.dll", "php.ini", to the
> "C:\WINDOWS\system32" folders
> (4) Copy the files "php4apache2.dll", "php4ts.dll", to the "C:\Program
> Files\Apache Group\Apache2\bin" folder
> (5) Copy the files in the "C:\php\sapi" folder to the "C:\php" folder
>
> This will enable the Apache Web Server to communicate with a MySQL
> database, using PHP scripts embedded in the HTML code.
>
> So, how can I install PHP on the RabbitWeb server (same way as PHP is
> installed on the Apache Web Server) and how can I incorporate PHP
> scripts on ZHTML?
>
> If there are other methods to store data, retrieved from the RCM3700's
> inputs, on a remote database, besides PHP and MySQL, please any
> suggestions are welcome.
>
> Thanks
>
Install PHP on the web server and have it process requests from the
rabbit and store them in the database.

------
| Scott G. Henion| s...@shdesigns.org |
| Consultant | Stone Mountain, GA |
| SHDesigns http://www.shdesigns.org |
------
Rabbit libs: http://www.shdesigns.org/rabbit/
today's fortune
Zoidberg: Uncle Zoid, you're looking young enough to be thrown back!

---------------------------------
Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.
It is definitely possible to use php on the rabbit processor, all you
need to do is write a php parser for the rabbit web server.
Then you just include it in the mimetable below like this
SSPEC_MIME_FUNC(".php", "text/html", php_handler),

SSPEC_MIMETABLE_START
// This handler enables the ZHTML parser to be used on ZHTML files...
SSPEC_MIME_FUNC(".zhtml", "text/html", zhtml_handler),
// SSPEC_MIME_FUNC(".shtml", "text/html", shtml_handler),
SSPEC_MIME(".html", "text/html"),
SSPEC_MIMETABLE_END

The bit thats missing is the php_handler() function
(alternately, re-write zhtml_handler to parse php)
Good luck
Wayne

Oh, that probably won't give you access to a MySQL database though
since MySql won't fit in the rabbit and hasn't been ported.

--- In r..., Boy Rabbit wrote:
>
> Hi,
> It is interesting topic for me
> Do you mean we can not run PHP languages under RCM technology ?
because I was thinking to some search about so did you try it before ?
>
> Thank you ?
>
>
> Scott Henion wrote:
>
> danieltaju wrote:
> > I am using:
> > - a RCM3700 RabbitCore Development Kit
> > - Dynamic C v9.21
> > - RabbitWeb v105
> >
> > I need to estabilish a communication between the RCM3700 and a MySQL
> > database, so I can store the temperature data, captured from the
> > thermistor, in the MySQL database.
> >
> > For example, to install PHP v4.4.2 on WinXP:
> > (1) Download php-4.4.2-Win32.zip from http://www.php.net/downloads.php
> > (2) Extract contents to C:\php
> > (3) Copy the files "php4apache2.dll", "php4ts.dll", "php.ini", to the
> > "C:\WINDOWS\system32" folders
> > (4) Copy the files "php4apache2.dll", "php4ts.dll", to the "C:\Program
> > Files\Apache Group\Apache2\bin" folder
> > (5) Copy the files in the "C:\php\sapi" folder to the "C:\php" folder
> >
> > This will enable the Apache Web Server to communicate with a MySQL
> > database, using PHP scripts embedded in the HTML code.
> >
> > So, how can I install PHP on the RabbitWeb server (same way as PHP is
> > installed on the Apache Web Server) and how can I incorporate PHP
> > scripts on ZHTML?
> >
> > If there are other methods to store data, retrieved from the RCM3700's
> > inputs, on a remote database, besides PHP and MySQL, please any
> > suggestions are welcome.
> >
> > Thanks
> >
> Install PHP on the web server and have it process requests from the
> rabbit and store them in the database.
>
> ------
> | Scott G. Henion| shenion@... |
> | Consultant | Stone Mountain, GA |
> | SHDesigns http://www.shdesigns.org |
> ------
> Rabbit libs: http://www.shdesigns.org/rabbit/
> today's fortune
> Zoidberg: Uncle Zoid, you're looking young enough to be thrown back!
>
>
>
>
> ---------------------------------
> Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.
>
> It is definitely possible to use php on the rabbit processor, all you
> need to do is write a php parser for the rabbit web server.

Yes well it's possible to edit Word documents on a rabbit processor too
if you write the software for it. :o) It's slightly discouraging though,
that the PHP binary for linux (without any extension modules at all) is
roughly 1MB big, and the PHP-mysql-module is another 40K. PHP is
incredibly versatile and complex (it's basically C), and can't really be
trimmed down in functionality without crippling it, so you might as well
stick to zhtml.

> Oh, that probably won't give you access to a MySQL database though
> since MySql won't fit in the rabbit and hasn't been ported.

Indeed porting MySQL is about as unlikely as PHP itself, though one of
the lighter database systems available might be an option. If MySQL was
the only problem though, you could connect to a database running
elsewhere (but then again you might as well run the whole website
there). :o)

Maurits.
Perhaps my earlier post on this didn't make it...

I have successfully made MySQL calls from my 3700 with this lib:

http://rabbitlib.sourceforge.net/

Dan...

On 2/1/07, Maurits van de Kamp wrote:
> > It is definitely possible to use php on the rabbit processor, all you
> > need to do is write a php parser for the rabbit web server.
>
> Yes well it's possible to edit Word documents on a rabbit processor too if
> you write the software for it. :o) It's slightly discouraging though, that
> the PHP binary for linux (without any extension modules at all) is roughly
> 1MB big, and the PHP-mysql-module is another 40K. PHP is incredibly
> versatile and complex (it's basically C), and can't really be trimmed down
> in functionality without crippling it, so you might as well stick to zhtml.
>
> > Oh, that probably won't give you access to a MySQL database though
> > since MySql won't fit in the rabbit and hasn't been ported.
>
> Indeed porting MySQL is about as unlikely as PHP itself, though one of the
> lighter database systems available might be an option. If MySQL was the only
> problem though, you could connect to a database running elsewhere (but then
> again you might as well run the whole website there). :o)
>
> Maurits.
>
>
>
> I have successfully made MySQL calls from my 3700 with this lib:
>
> http://rabbitlib.sourceforge.net/
>

Yes, accessing an external MySQL database is very well an option (though
PHP is not) :). But I didn't know someone had already made a lib for
this. Thanks! :)

Maurits.

Memfault Beyond the Launch