Reply
Thread Tools
Posts: 12 | Thanked: 0 times | Joined on May 2007
#1
I have searched this forum for php related entries but found none.

How can I run a PHP file on the N800.

I have installed:
http://maemo-hackers.org/php5-fastcgi.install (PHP5)
http://maemo-hackers.org/nginx.install (HTTP Server)

When I attempt to run a file.php with
<?php
print("MyName");
?>
in it, all i get is a listing of the contents, not processed by PHP.

What am I missing??

Many years programming, limited Linux.

Thanks
SW
 
Posts: 101 | Thanked: 12 times | Joined on Jun 2007 @ Greensboro, NC
#2
Sorry, I can't help you with php but when I search this forum using "php" (just to figure out what it is), I get two pages of threads (granted most are from 770 owners but there are some N800-related threads).
 
Naranek's Avatar
Posts: 236 | Thanked: 149 times | Joined on Jul 2007 @ Finland
#3
This is just a shot in the dark as I don't have experience of php with maemo, but I've used it elsewhere. I assume you're trying to run the program in command line. If you're trying to view the page with web browser, this won't help you.

First you have to give the file execute privileges by issuing:

chmod u+x file.php

and after that you can run

./file.php

assuming you're in the same directory as the file.

If it doesn't work, you should see if php is installed correctly by writing

which php

You should get something like /bin/php
Add to the beginning of the php-file:

#!/bin/php

or whatever it is you get from the previous command. I don't know how it goes with N800, but at least this is the way it works in linux generally.

Last edited by Naranek; 2007-08-06 at 21:27.
 
Posts: 12 | Thanked: 0 times | Joined on May 2007
#4
Thanks jweinel,

I was thinking of a different forum when I wrote that. I have read those posts and some have said that they have php running, but I haven't had any luck with getting a response from the right people.
Still looking.

Thanks Naranek,
I am trying to run this from the browser. I will give the command line a shot, though.
 
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#5
As apache you must set the configuration of nginx to use php. By default php is not enabled.

The config file can be found in /etc/nginx/
 
Posts: 4 | Thanked: 0 times | Joined on Jun 2007
#6
I've managed to get Nginx running with PHP. I just installed php5-cli, php5-fastcgi and nginx from the Maemo hackers repository (http://maemo-hackers.org bora/main).

Nginx was already configured to work with PHP by default and all I had to do was change the Document Root in /etc/nginx/nginx.conf.
 
Posts: 11 | Thanked: 1 time | Joined on Dec 2007 @ missouri
#7
I have PHP5-fastcgi installed and HTTPD in Os2008. Everything installed fine. I am think HTTPD is running because when I go to http://localhost/ I get a message saying it works. My problem is that when I put a .php file into the htdocs folder at /user/htdocs and go to the file in my web browser (ie http://localhost/helloworld.php) it is not rendering the PHP...it just shows the PHP code (ie <?php echo 'hello world!'; ?> .

I tried to make some changes to the httpd.conf file but how do I edit it? I can see the file in the terminal /etc/conf/http.conf but I don't know how to launch the file in a text editor to edit it. Any ideas?
 
hordeman's Avatar
Posts: 698 | Thanked: 129 times | Joined on Oct 2007 @ CA
#8
Originally Posted by theredbaron View Post
I have PHP5-fastcgi installed and HTTPD in Os2008. Everything installed fine. I am think HTTPD is running because when I go to http://localhost/ I get a message saying it works. My problem is that when I put a .php file into the htdocs folder at /user/htdocs and go to the file in my web browser (ie http://localhost/helloworld.php) it is not rendering the PHP...it just shows the PHP code (ie <?php echo 'hello world!'; ?> .

I tried to make some changes to the httpd.conf file but how do I edit it? I can see the file in the terminal /etc/conf/http.conf but I don't know how to launch the file in a text editor to edit it. Any ideas?
I've only gotten PHP to work with the nginx web server --- i never figured out how to get it work with Apache. Something tells me that PHP would need be recompiled to be used with Apache.

BTW, does anybody know if PHP + nginx work on OS2008?
 
Posts: 11 | Thanked: 1 time | Joined on Dec 2007 @ missouri
#9
Hordeman,

PHP and NGINX do work with OS2008. I uninstalled Apache and installed NGINX yesterday and sure enough PHP worked and I am running OS2008. Does anyone know if PHPMyAdmin could be installed on OS2008? It is just a PHP website really so I am guess if you just untar PHPMyAdmin in the /var/www folder in NGINX it should work. This would give a GUI to mySQL which would be amazing! Anyone try this?
 
Posts: 29 | Thanked: 27 times | Joined on Jun 2007 @ south germany
#10
Originally Posted by theredbaron View Post
Does anyone know if PHPMyAdmin could be installed on OS2008? It is just a PHP website really so I am guess if you just untar PHPMyAdmin in the /var/www folder in NGINX it should work. This would give a GUI to mySQL which would be amazing! Anyone try this?
I tried it a few weeks ago without success. PHP (php5-fastcgi) comes with no MySQL-Support...
__________________
---
Joschi
 
Reply


 
Forum Jump


All times are GMT. The time now is 22:59.