LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-02-2005, 01:07 PM   #16
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79

Quote:
Originally posted by mrobertson
I am still having some trouble. I dont really understand how to set this webserver up. Is there any way that you could explain in detail to me exactly where it needs to be set up....vb client or php server and how to do it (ie the syntax). also I tried to at least code the php code into knoppix and got an error on the first line ( <?) saying:

?: No such file or directory
It looks like you are trying to run it as a bash script rather than accessing it via a webserver.

Quote:
Originally posted by mrobertson
Also after going home and thinking about it yesterday.....my client is setup to passed the variable string through a winsock. Am i going to have to change this or designate a port and host address in php?
I have no idea how your client is set up but to access thins php script via a webserver you just need to perform an http get.
 
Old 06-02-2005, 01:22 PM   #17
mrobertson
Member
 
Registered: May 2005
Posts: 275

Original Poster
Rep: Reputation: 30
my client is not setup to request a web server. That is the problem that I am having. I dont know how and where to set up the webserver. Can you offer me and code examples or information on how to set this up.
 
Old 06-02-2005, 01:25 PM   #18
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Take a look at the link in post 8.

Full apache documentation is here:
http://httpd.apache.org/docs-2.0/
 
Old 06-02-2005, 01:31 PM   #19
mrobertson
Member
 
Registered: May 2005
Posts: 275

Original Poster
Rep: Reputation: 30
What do you mean by post 8 and what link are you talking about?
 
Old 06-02-2005, 01:42 PM   #20
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
http://www.linuxquestions.org/questi...56#post1672256
 
Old 06-03-2005, 07:37 AM   #21
mrobertson
Member
 
Registered: May 2005
Posts: 275

Original Poster
Rep: Reputation: 30
I am having trouble doing any typw of php coding with knoppix. I wrote a simple program and and can not get the code to run.


<?
$vars = explode(", ", urldecode($_SERVER["QUERY_STRING"]));
foreach ($vars as $var){
print $var."<br>";
}
?>

I keep getting the same errors:

./PHPServer2.php: line 1: ? No such file or directory
./PHPServer2.php: line 2: Syntax error near unexpected token (
./PHPServer2.php: line 2: '$vars = explode(", ", urldecode($_SERVER["QUERY_STRING"]));

I even tried to add #!/usr/bin/php to the beginning of the code. I used chmod 711 to compile the program. I can not get it to run though. Do you know what could be wrong here?
 
Old 06-03-2005, 01:03 PM   #22
mrobertson
Member
 
Registered: May 2005
Posts: 275

Original Poster
Rep: Reputation: 30
Do you know how to make a file readable in php. I get these eroors and I think its becasue i need to make the file readable?

I used the following command:

$ sudo cat > /var/www/PHPServer1.php
<?php phpinfo(); ?>

$ lynx http://127.0.0.1/PHPServer1.php
and got the following errors:

Warning: Unknown (/UNIOFS/var/www/PHPServer1.php):failed to open stream. Permission denied in unknown line 0

Warning: (null)(): Failed opening '/UNIOFS/var/www/PHPServer1.php' for inclusion (include_path = '.:/usr/share/php : /usr/share/peak) in unknown on line 0

I do not have internet access on the computer that I am running linux on. Do I need to get that? Is it possible to access it from a computer with internet access. Also here is the code that I am using in the mean time:

<?
while (1);
//Attempt to read string from socket
//For now let's pretend it's been read successfully
//and is called "stuff"
$stuff = "1,2.2,3.245,.546";

if ($stuff != "") {
$array_of_stuff = explode(',', $stuff); //Now it's an array
//Display them:
print ($array_of_stuff[0]);
print ($array_of_stuff[1]);
print ($array_of_stuff[2]);
print ($array_of_stuff[3]);
$stuff = "";
}
?>
 
Old 06-05-2005, 01:06 PM   #23
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
It will just be the filesystem permissions, so long as the file is readable by the user that the webserver is running as it should be ok.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Coding java in a php script mrobertson Programming 44 06-27-2005 01:16 PM
Coding a redirect function in php mrobertson Programming 2 06-22-2005 08:40 AM
php coding with knoppix mrobertson Linux - General 1 06-01-2005 01:30 PM
vim php color coding? Longinus Linux - Software 4 04-11-2004 05:56 AM
PHP maths - coding algebraic formulas linuxfond Programming 2 10-03-2003 01:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration