maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N800 (https://talk.maemo.org/forumdisplay.php?f=25)
-   -   Run PHP on N800 (https://talk.maemo.org/showthread.php?t=8542)

scottw01 2007-08-06 20:57

Run PHP on N800
 
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

jweinel 2007-08-06 21:08

Re: Run PHP on N800
 
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 2007-08-06 21:20

Re: Run PHP on N800
 
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.

scottw01 2007-08-06 21:45

Re: Run PHP on N800
 
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 2007-08-07 05:10

Re: Run PHP on N800
 
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/

sam-network 2007-10-20 20:00

Re: Run PHP on N800
 
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.

theredbaron 2007-12-18 16:50

Re: Run PHP on N800
 
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 2007-12-19 00:32

Re: Run PHP on N800
 
Quote:

Originally Posted by theredbaron (Post 110391)
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?

theredbaron 2007-12-19 19:03

Re: Run PHP on N800
 
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?

Joschi 2007-12-20 06:31

Re: Run PHP on N800
 
Quote:

Originally Posted by theredbaron (Post 111308)
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...


All times are GMT. The time now is 16:50.

vBulletin® Version 3.8.8