From: rketcham <Ric...@gm...> - 2007-09-07 15:46:16
|
Hi, I'm trying to use/learn php with the gumstix http server. The way I understand it, if php is setup on the gumstix, the gumstix should parse the php file and display the results when the page is called up - similar to an html file. So, if I have hello.php: <?php echo 'Hello, World!'; ?> and I post it to /var/www/ on the gumstix, shouldn't I get a "Hello, World!" when I visit http://localhost/hello.php ? Instead, the local page is trying to get me to download the file instead of displaying it in the browser. I enabled php using make menuconfig in the buildroot and reflashed the file system. If I type in php -v, it displays the following: # php -v PHP 5.2.3 (cli) (built: Sep 5 2007 10:17:15) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies So, it is installed. What else do I need to do? What am I missing? Thanks, Rich -- View this message in context: http://www.nabble.com/PHP-on-Verdex-tf4402013.html#a12557869 Sent from the Gumstix mailing list archive at Nabble.com. |
From: Brad H. <br...@ma...> - 2007-09-07 15:57:29
|
> I'm trying to use/learn php with the gumstix http server. The way I > understand it, if php is setup on the gumstix, the gumstix should parse the > php file and display the results when the page is called up - similar to an > html file. > > So, if I have hello.php: > > <?php echo 'Hello, World!'; ?> > > and I post it to /var/www/ on the gumstix, shouldn't I get a "Hello, World!" > when I visit http://localhost/hello.php ? Instead, the local page is trying > to get me to download the file instead of displaying it in the browser. You'd need to configure your webserver to pass any .php files through php-cgi to be interpreted, without configuring your webserver, it won't work... What webserver are you using? -Brad |
From: rketcham <Ric...@gm...> - 2007-09-07 16:30:11
|
ah...webserver... :) Let me preface this by saying that I'm a novice when it comes to hosting a website (not to mention linux in general). For a webserver, I have boa installed. How do I go about configuring the webserver? -Rich Brad House wrote: > >> I'm trying to use/learn php with the gumstix http server. The way I >> understand it, if php is setup on the gumstix, the gumstix should parse >> the >> php file and display the results when the page is called up - similar to >> an >> html file. >> >> So, if I have hello.php: >> >> <?php echo 'Hello, World!'; ?> >> >> and I post it to /var/www/ on the gumstix, shouldn't I get a "Hello, >> World!" >> when I visit http://localhost/hello.php ? Instead, the local page is >> trying >> to get me to download the file instead of displaying it in the browser. > > You'd need to configure your webserver to pass any .php > files through php-cgi to be interpreted, without > configuring your webserver, it won't work... > > What webserver are you using? > > -Brad > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > > -- View this message in context: http://www.nabble.com/PHP-on-Verdex-tf4402013.html#a12558815 Sent from the Gumstix mailing list archive at Nabble.com. |
From: Brad H. <br...@ma...> - 2007-09-07 16:33:53
|
> ah...webserver... :) Let me preface this by saying that I'm a novice when it > comes to hosting a website (not to mention linux in general). For a > webserver, I have boa installed. How do I go about configuring the > webserver? I don't know if boa is capable of that ... I use lighttpd myself... -Brad |
From: rketcham <Ric...@gm...> - 2007-09-07 16:51:20
|
Okay, lighttpd it is! I'm recompiling my build-root now. How would I set lighttpd up? R. >I don't know if boa is capable of that ... I use lighttpd myself... >-Brad -- View this message in context: http://www.nabble.com/PHP-on-Verdex-tf4402013.html#a12559042 Sent from the Gumstix mailing list archive at Nabble.com. |
From: Brad H. <br...@ma...> - 2007-09-07 16:57:37
|
just edit the /etc/lighttpd.conf file, you'll see a whole cgi php section... don't forget to set the document root and logfile locations appropriately or it won't start ... -Brad rketcham wrote: > Okay, lighttpd it is! > I'm recompiling my build-root now. How would I set lighttpd up? > > R. > >> I don't know if boa is capable of that ... I use lighttpd myself... > >> -Brad > > |
From: Duane B. <dua...@gm...> - 2007-09-07 16:50:46
|
On 9/7/07, rketcham <Ric...@gm...> wrote: > ah...webserver... :) Let me preface this by saying that I'm a novice when it > comes to hosting a website (not to mention linux in general). For a > webserver, I have boa installed. How do I go about configuring the > webserver? Looks like you just add a ScriptAlias configuration directive to boa.conf to specify your CGI directory. Check the file, it may already have one. Then you'll need #!/usr/bin/php (or wherever you've installed the PHP interpreter) as the first line in your PHP scripts in that directory. http://www.boa.org/documentation/boa-2.html#ss2.3 |
From: rketcham <Ric...@gm...> - 2007-09-07 19:53:12
|
Hey Duane, Here is the ScriptAlias directive: ScriptAlias /cgi-bin/ /var/www/cgi-bin/ I also added #!/usr/bin/php above hello.php but going to the web address still starts a download. All that is in cgi-bin is ifconfig, is this right? R. Looks like you just add a ScriptAlias configuration directive to boa.conf to specify your CGI directory. Check the file, it may already have one. Then you'll need #!/usr/bin/php (or wherever you've installed the PHP interpreter) as the first line in your PHP scripts in that directory. http://www.boa.org/documentation/boa-2.html#ss2.3 ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ gumstix-users mailing list gum...@li... https://lists.sourceforge.net/lists/listinfo/gumstix-users -- View this message in context: http://www.nabble.com/PHP-on-Verdex-tf4402013.html#a12562212 Sent from the Gumstix mailing list archive at Nabble.com. |
From: Duane B. <dua...@gm...> - 2007-09-07 19:57:50
|
On 9/7/07, rketcham <Ric...@gm...> wrote: > Here is the ScriptAlias directive: > > ScriptAlias /cgi-bin/ /var/www/cgi-bin/ > > I also added #!/usr/bin/php above hello.php but going to the web address > still starts a download. > > All that is in cgi-bin is ifconfig, is this right? My memory's a little fuzzy, but I think the default gumstix build includes the ifconfig script as an example. You may need to restart or HUP boa to have it re-read the config file for the change to take effect. Did you set hello.php executable? |
From: rketcham <Ric...@gm...> - 2007-09-07 20:31:08
|
Yep: chmod 755 hello.php I didn't actually change the ScriptAlias. As far as I can tell, it looks correct... Do I need to do anything to hello.php beyond placing it in the web directory (/var/www/)? Thanks for your help. R. -- View this message in context: http://www.nabble.com/PHP-on-Verdex-tf4402013.html#a12562834 Sent from the Gumstix mailing list archive at Nabble.com. |
From: Duane B. <dua...@gm...> - 2007-09-07 20:36:47
|
On 9/7/07, rketcham <Ric...@gm...> wrote: > Yep: > chmod 755 hello.php > > I didn't actually change the ScriptAlias. As far as I can tell, it looks > correct... > > Do I need to do anything to hello.php beyond placing it in the web directory > (/var/www/)? CGI scripts and executables, like your hello.php, must go in the ScriptAlias directory, i.e. /var/www/cgi-bin, not in your document root. Duane |
From: rketcham <Ric...@gm...> - 2007-09-07 20:48:43
|
Okay, I did that. http://192.168.167.42/hello.php now gives me a 404 not found error http://192.168.167.42/cgi-bin/hello.php downloads the file. -- View this message in context: http://www.nabble.com/PHP-on-Verdex-tf4402013.html#a12563070 Sent from the Gumstix mailing list archive at Nabble.com. |
From: Brad H. <br...@ma...> - 2007-09-07 21:48:20
|
Might I suggest lighttpd again ... you don't have to have #!/usr/bin/php-cgi at the top, nor make the file executable ... and you don't have to run it out of a cgi-bin directory... Plus, lighttpd is maintained for security-related issues, I don't think Boa has been touched in _years_. -Brad rketcham wrote: > Okay, I did that. > > http://192.168.167.42/hello.php now gives me a 404 not found error > > http://192.168.167.42/cgi-bin/hello.php downloads the file. > > > |
From: unixxx <mhr...@gm...> - 2008-07-04 01:04:40
|
Hey, I know it has been a few months since the last post but I found a solution in a comment on this page: http://es2.php.net/features.commandline (Comment on 22-Feb-2005 08:49) Comment copied below (db at digitalmediacreation dot ch): ---------- A very important point missing here (I lost hours on it and hope to avoid this to you) : * When using PHP as CGI * When you just become crazy because of "No input file specified" appearing on the web page, while it never appears directly in the shell Then I have a solution for you : 1. Create a script for example called cgiwrapper.cgi 2. Put inside : #!/bin/sh - export SCRIPT_FILENAME=/var/www/realpage.php /usr/bin/php -f $SCRIPT_FILENAME 3. Name your page realpage.php For example with thttpd the problem is that SCRIPT_FILENAME is not defined, while PHP absolutely requires it. My solution corrects that problem ! ---------- Michael Robinson mro...@fu... rketcham wrote: > > Okay, I did that. > > http://192.168.167.42/hello.php now gives me a 404 not found error > > http://192.168.167.42/cgi-bin/hello.php downloads the file. > > > > -- View this message in context: http://www.nabble.com/PHP-on-Verdex-tp12557869p18270892.html Sent from the Gumstix mailing list archive at Nabble.com. |
From: rketcham <Ric...@gm...> - 2007-09-12 15:25:41
|
Well, I figure it out with the help of Brad. I put the instructions I used on the wiki here: http://docwiki.gumstix.org/Sample_code/PHP/Hello_World -- View this message in context: http://www.nabble.com/PHP-on-Verdex-tf4402013.html#a12638023 Sent from the Gumstix mailing list archive at Nabble.com. |