Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 22 Dec 2014, 07:23
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
How to add PHP to Hiawatha server?
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 9 Posts_count   Goto page: 1, 2, 3, ..., 7, 8, 9 Next
Author Message
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15122
Location: Paradox Realm

PostPosted: Sun 17 Aug 2008, 12:07    Post_subject:  How to add PHP to Hiawatha server?  

Been looking at Hiawatha Server in Puppy Dingo+1 Alpha6 . . .
Works OK
ahem . . .
but I need a PHP server - is it available? As a pet - or Slackware or part of a Lamp module . . .

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15122
Location: Paradox Realm

PostPosted: Sun 17 Aug 2008, 15:52    Post_subject:  

Just about to try this PHP .pet. . . details soon . . .
http://www.murga-linux.com/puppy/viewtopic.php?p=164304&search_id=842690634#164304

OK I have installed it - eh now what . . . ?

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
raffy

Joined: 25 May 2005
Posts: 4798
Location: Manila

PostPosted: Mon 18 Aug 2008, 22:41    Post_subject: try this  

Put this in a test.php file:
Code:
<? phpinfo(); ?>

Then type its URL in your browser, like http://localhost/test.php

You should see the PHP details if PHP is working.

For the download of this Growler's LAMP, look here:
http://dotpups.de/..Internet/LAMP-6.16-5.1.35-5.2.9.pet

_________________
Puppy user since Oct 2004. Want FreeOffice? Get the sfs (English only).

Edited_time_total
Back to top
View user's profile Send_private_message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15122
Location: Paradox Realm

PostPosted: Tue 19 Aug 2008, 08:07    Post_subject:  

Thanks Raffy I may well be calling on your Lamp expertise Smile

LAMP is one of the most successful usages of Linux
LAMP is used in critical situations were un-operating and micky mouse operating systems (mentioning no names - ahem - Windows) are not robust enough

L = Linux
A = Apache Server
M = MySQL
P = PHP

What is it? What can you do?

Well the Puppy equivalent would be to use Hiawatha as the server component . . .

Basically you could have a server on an intranet or the internet with a URL - independent of an ISP

PHP generates HTML webpages
so it can grab data from any source (usually a database)
and generate pages . . .

What does this mean?
Well Eric in Canada (who very kindly sent me a Puppy T shirt with Vincent on it)
provides server space - he has taught himself . . .
The server is hosted elsewhere . . .

But what if we start moving some puppy programs
onto our own servers?

Or creating an online database?
We too can learn and test using Hiawatha . . .

This is why this is in cutting edge
. . . playtime continues . . .

http://hiawatha.leisink.org/

Cool

P.S. Puppy says woof woof

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
boscobearbank


Joined: 06 Apr 2006
Posts: 63
Location: MN

PostPosted: Tue 19 Aug 2008, 15:49    Post_subject:  

I'm very interested in this, but can't seem to get php to run under hiawatha. I did a default install of php-5.2.5-i486.pet. Adding the following to /etc/hiawatha/httpd.conf:
Code:


# BoscoBearbank extensions
CGIhandler = /usr/local/bin/php:php
CGIextension = php


Directory {
        Path = /root/httpd/hiawatha/katieskitchen
        ExecuteCGI = yes
        UploadSpeed = 10,2
}


when I try to access /root/httpd/hawatha/katieskitchen/info.php (code below)

Code:

<html>                                                                         
<head></head>                                                                   
<body>                                                                         
  <H1>TEST</H1>                                                                 
  <? phpinfo(); ?>                                                             
</body>                                                                         
</html>     


I get a 500-Internel Server error whereas when rename the file to info.html and access it, I see, as expected, the word TEST.

What other changes do I need to make to my configuration files to get this to work?

TIA

_________________
Bosco Bearbank
Back to top
View user's profile Send_private_message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15122
Location: Paradox Realm

PostPosted: Wed 20 Aug 2008, 05:19    Post_subject:  

I am finding 4.1 Alpha 6 too unstable to continue
I may try to install hiawatha as a pet - is it available?
and Php on Puppy 4
or use another machine . . .

Keep us informed and advised - maybe able to use another computer tonight . . .

_________________
Puppy WIKI

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
rob

Joined: 18 May 2005
Posts: 50

PostPosted: Wed 20 Aug 2008, 19:13    Post_subject: PHP support in puppy  

I waffle a bit in the next paragraph. Feel free to skip it.

I've been waiting for PHP support within puppy for a long while now. PHP is basically a fully fledged programming language. It is written in C++ and it shines!!! In the future, it would be possible to run commands like they can be run in a terminal. Remote controlling puppy becomes much easier, for example, by having a music or video server controlled via a mobile phone web browser. Ok. I got a bit carried away, but this will be one of my first projects once a stable version of php is available.

Back to the task, below is some sample code. You type in an address in your browser on pc1. The browser on pc1 asks the webserver on pc2 for a page (index.php). The webserver on pc2 checks to see what it should do to the file based on its settings. It should, for .php files, be set to send them to a php parser. php then parses the file returning the "answer" to those parts of the code inside <? and ?> tags, but leaving the rest intact. If it is not set to parse the file (.htm files for example are sometimes set not to be parsed) the webserver will return all of the file, including the php tags <? and ?> without processing them. <? to ?> is invalid html and so will not be rendered when received by the web browser. This will result in the title "PHP Test" in the following example if not parsed or "PHP Test Working" if PHP is parsing the file correctly.
Code:

<html>
  <head>
    <title>PHP Test <?php echo "Working";?></title>
  </head>
  <body>
    <?php echo "php is working";?>
  </body>
</html>

That was all an extremely long winded way of saying the reason your code half worked is because the webserver just passed you the file. PHP did not parse it unless you got the php info screen, detailing your php settings.
Back to top
View user's profile Send_private_message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15122
Location: Paradox Realm

PostPosted: Wed 20 Aug 2008, 23:04    Post_subject:  

Quote:
Lob, can you block him?


Perhaps.
Maybe telepathically . . .
. . . though holding up two flowers might work for some . . .
http://tmxxine.com/wik/wikka.php?wakka=NewBodhis Smile

I probably need some vitamins and a bit of augmentation
http://open-rtms.sourceforge.net/
and a matrix style plug in . . .

However using conventional methods
just provide a link to the 'report spam'
thread for 'Flashy' attention.
Right click on the tiny 'folder' of a spam post to copy the location of any spam . . .

I notice you are coding Muppy like a maniac (days at a time)
(that is why you are a YinYana Boddhisattva)

Your mantra incidentally is
MU MU MU

pronounced Moooooooooo Moooooooooo Moooooooooo
Obviously it is sacred to cows

but has the added benefit of being your ego
and a triple negation

MU = negation or void
2 x negation = existence
3 x negation = the void dependent on form for its 'non-existence'


It will also allow you to oxygenate the brain and replenish it
It may make you laugh or cry
The humming (as used by cats) also is healing
Cats purr when injured

. . . sanity is now resumed . . .

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15122
Location: Paradox Realm

PostPosted: Tue 14 Oct 2008, 17:42    Post_subject:  

Quote:
once a stable version of php is available


Is a stable PHP available? Does it have to be compiled in devx for 4.1?
the only version I have is now also hosted here:
http://www.tmxxine.com/pets/php-5.2.5-i486.pet

- not sure if it is working in 4.1 in a stable manner?

I have been using Hiawatha - seems to work OK
- just type hiawatha from the command line in Puppy 4.1
PHP (link in earlier post) seems to be running - not experienced enough to configure . . .
but my output is the HTML - the source with no parsed web page generated. . . .

Any ideas or tips welcome?
Smile

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15122
Location: Paradox Realm

PostPosted: Thu 16 Oct 2008, 21:47    Post_subject:  

Now working in Puppy 4.1
Quote:
http://www.murga-linux.com/puppy/viewtopic.php?p=240125#240125


Here are the pets used if anyone wants to create a complete PHP pet

php pet
http://www.tmxxine.com/pets/php-5.2.6-i486-1.pet

lib pet
http://www.tmxxine.com/pets/mm-1.4.2-i486-2.pet

lib pet
http://www.tmxxine.com/pets/t1lib-5.1.0-i486-3.pet

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
growler


Joined: 24 Mar 2008
Posts: 209
Location: Kapiti - New Zealand

PostPosted: Fri 24 Oct 2008, 05:01    Post_subject: PHP and Mysql  

I made a pet of mysql 5.0.67 and PHP 5.2.6 - I compiled the latest vesions as of around 13th Oct. immediately after the availability of devx410.sfs

My .pet is less than 9Meg - so way smaller than the monster LAMP systems around and uses Hiawatha - already in puppy 4.1. It has an install script that creates the mysql tables etc and sets things up so it just works - the server is started at each boot (and post installation). PHP works as a Fast CGI program (not as a module - as it can with Apache) - and performance seems pretty good. Running as a module is theoretically faster but I'm not sure this is still true. Also Apache is a massive memory hog.

Simply install the pet from

[edited and again] for download of the latest see:
http://www.weberp.org/PuppyLinux
[/edited]

then point a browser to

http://localhost/

to see the output of

phpinfo()

this shows the versions and system variables etc. and proves php is working.

You simply install php application below

/root/httpd/hiwatha - the web document directory.

I have made hiawatha and mysql run as the user nobody.

BTW - also included is the phpMyAdmin 3.00 php mysql administration tool.

http://localhost/phpMyAdmin/

you'll need to login as the user root - password is blank by default - this should be changed -see the mysql manual for details on how to change the mysql root user's password.

Edited_times_total
Back to top
View user's profile Send_private_message 
growler


Joined: 24 Mar 2008
Posts: 209
Location: Kapiti - New Zealand

PostPosted: Fri 24 Oct 2008, 05:06    Post_subject: PHP and Mysql  

Quote:
Lobser: but my output is the HTML - the source with no parsed web page generated. . . .


Well that's because you need to configure Hiawatha to use php as a cgi or Fast CGI program and that any files ending in .php are sent off to the php binary - /usr/bin/php-cgi for parsing ... the php interpreter returns html which the browser renders as nice pretty webpages.

HIawatha How-to for CGI programs (like PHP or Perl):
Quote:

3.3 Running CGI programs
Making Hiawatha run CGI programs is easy. You can allow CGI execution per website.

VirtualHost {
...
ExecuteCGI = yes
}

Specify the extension of CGI programs via the CGIextension option.

CGIextension = cgi

If you want to run CGI scripts, you have to specify where Hiawatha can find the binary that can parse these scripts.

CGIhandler = /usr/bin/php4-cgi:php4
CGIhandler = /usr/bin/php5-cgi:php,php5
CGIhandler = /usr/bin/perl:pl
CGIhandler = /usr/bin/python:py

You can limit the maximum runtime of CGI programs (in seconds) via the TimeForCGI option.

VirtualHost {
...
TimeForCGI = 5
}



And the Hiawatha Fast CGI how-to:

Quote:
5.1 FastCGI
Although this section has been placed under "Advanced configuration", using FastCGI with Hiawatha is actually quite easy. In this example, we'll use PHP via FastCGI. First, install php-cgi with FastCGI support (compile PHP with --enable-fastcgi or check that your precompiled php-cgi package has FastCGI support). Edit the configurationfile php-fcgi.conf (which is located in your Hiawatha configuration directory). For every Server configuration line, a PHP FastCGI daemon will be started. Every Server configuration line consist of at least 3 options: the path to the php-cgi binary, the binding (interface:port) and the userid the PHP FastCGI daemon must switch to. An optional fourth option tells the path to the php.ini file. A typical configuration line looks like this:

Server = /usr/bin/php5-cgi;127.0.0.1:2005;www-data

Run php-fcgi (probably in /usr/sbin or /usr/local/sbin) to start the PHP FastCGI daemon(s). Run with the '-k' option to kill the running PHP FastCGI daemons.

In httpd.conf, you have to tell Hiawatha how to reach this FastCGI server and when to use it (for which file extensions). Give it a unique id and use this id with the FastCGI option for every virtual host which must use this FastCGI server.

FastCGIserver {
FastCGIid = PHP5
ConnectTo = 127.0.0.1:2005
Extension = php
}

VirtualHost {
...
FastCGI = PHP5
}

A FastCGIserver section with the same extension as a CGIhandler, overrules this CGIhandler.

If you specify more then one ConnectTo parameter, Hiawatha will switch between these FastCGI servers for every connection. You can use this load-balancing feature for heavy websites. To prevent CGI sessions from getting disrupted, Hiawatha must know the timeout (in minutes) of such session.

FastCGIserver {
FastCGIid = PHP5
ConnectTo = 10.0.0.100:2005, 10.0.0.101:2005, 10.0.0.102:2005
Extension = php
SessionTimeout = 15
}


My PET has PHP configured as a FastCGI program - so if you install it you won't need to mess with hiawatha configs - its all done for you.
Back to top
View user's profile Send_private_message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15122
Location: Paradox Realm

PostPosted: Fri 24 Oct 2008, 07:05    Post_subject:  

Excellent we need some testers and maybe even an SFS
Smile
This complete PHP+MYSQL pet - great stuff - just tried, seems OK
A good name for this is the English version of 'streetlight' - Lamppost
http://www.murga-linux.com/puppy/viewtopic.php?p=242811#242811

Thanks for putting it together growler Smile

_________________
Puppy WIKI
Back to top
View user's profile Send_private_message Visit_website 
growler


Joined: 24 Mar 2008
Posts: 209
Location: Kapiti - New Zealand

PostPosted: Fri 24 Oct 2008, 15:41    Post_subject: LAMP or PHMP  

LAMP

L inux
A pache
M ysql
P HP

But we are using

P uppy Linux
H iawatha
M ysql
P HP

But the world knows the platform as LAMP so probably best to stick with the brand that is so well known.

I wanted to make a .sfs as I had done for 3.01 and 4.00 but because I had to modify the config of Hiawatha the squash file could not over-write the /etc/hiawatha/httpd.conf file in pup_410.sfs due to the sequence of the filesystem layers I guess. I already posted on the subject but no-one else had any ideas - or at least didn't respond.

Also since I compiled without PEAR and mysql without clustering, the test-suite or documentation etc the size of the applications are much more managable - PHP is just 3 Meg uncompressed. Mysql has become huge but this way again it is more managable. I was pleased to get the .pet with the whole shbang in at 8.5 Meg.

Since .pet works more easily with a HD install (no manual extraction to the .sfs files to the root directory) and it is so easy to uninstall I am happy with just having the .pet - I suspect once installed and the imagination of a developer captured it will never be uninstalled and no future machine will be complete without PHMPing my puppy ride.
Back to top
View user's profile Send_private_message 
gmlogan

Joined: 21 Nov 2008
Posts: 1

PostPosted: Fri 21 Nov 2008, 12:09    Post_subject: PHP works localhost but not via real IP  

Hi,
I installed the package pet file, and a basic PHP page works as long as I ref as http://localhost/ (so loopback) but when I use the real IP http://192.168.1.9/ it simply passes the file unprocessed.

Thanks in advance.
Back to top
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 9 Posts_count   Goto page: 1, 2, 3, ..., 7, 8, 9 Next
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1109s ][ Queries: 13 (0.0052s) ][ GZIP on ]