I need some help php4 + apache2.0 + linux 8.0 working weird?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
jose.natali
Forum Newbie
Posts: 5
Joined: Mon Nov 17, 2003 9:52 am
Location: Camp Walker, Taegu, Korea

I need some help php4 + apache2.0 + linux 8.0 working weird?

Post by jose.natali »

I was following a PHP4 tutorial using Abyss Web server in Windows, and everything was fine.

But I install my new computer with Linux 8.0 and apache2.0, and of course php4. I think the following is wrong, but I'm not sure

1. I need to turn off "cgi.force_redirect" (php.ini file),if not php give me some errors!

2. I need to include "#!/usr/bin/php" in my first line of my php file, if not the script does not work, and

3. I need to "chmod 555" (or 777) in the php files, example "chmod 777 test1.php". (if not I got the same error that I got in case #2)

If I don't follow those steps I can not get my scrip working.

When I tried to use variables from one page to another (forms->sumit) php is not able to identify the variables comming from my form. I solve this problem doing the following:

Code: Select all

<?php
  foreach ($_GET as $key=>$value){
              if ($key == "user")
                 print "Your name is :<b> $value </b>\n";
              if ($key == "address"){
                 print "And your address is:<br>\n";
                 print "<b>$value</b>\n";
              }
              print "<br>\n<hr>\n;"
  }
?>
any sugestions? changes in httpd.conf maybe? or php.ini, I don't want go back to Windows. :( :cry: :x

(sorry if my english is not good, is not my primary language)

Thanks in advanced for any help!!!!!! :)
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

Hi, welcome to PHPDN. Please answer some questions so we can offer you a better help:

• What GNU/Linux ditro are you using?
• How did you installed PHP? Only CGI? Or did you installed the Apache module as well?
• Do you really need PHP to be running as CGI instead of module?

Cheers,
Scorphus.
User avatar
jose.natali
Forum Newbie
Posts: 5
Joined: Mon Nov 17, 2003 9:52 am
Location: Camp Walker, Taegu, Korea

Post by jose.natali »

Hi scorphus;

I kind of new in all this.

I figure out that what you asking me in the first question is what linux i'm using? Im using redhat 8.0 kernel 2.4.20-20.8.

My installation of php was done with the installation of linux as well (part of the distribution package), same with apache. If Im right the modules are install

And in the last question, I don't know the diference between "CGI" and "module"

Thanks againg for your time. Any other information you need, let me know... :D
User avatar
scorphus
Forum Regular
Posts: 589
Joined: Fri May 09, 2003 11:53 pm
Location: Belo Horizonte, Brazil
Contact:

Post by scorphus »

Hi jose, where are you from? Your nick sounds very familiar to me.

Well, I think you need to setup your httpd.conf. Add these lines to it:

Code: Select all

LoadModule php4_module /usr/lib/apache/2.0/libphp4.so
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Please note that LoadModule php4_module /usr/lib/apache/2.0/libphp4.so may not be suitable for you, must point to a valid libphp4.so on your system. Search for libphp4.so on your system using find or locate (do a locate -u or updatedb before using locate).

I think this is it, let me know if you're not that happy with this info...

Cheers,
Scorphus.
User avatar
jose.natali
Forum Newbie
Posts: 5
Joined: Mon Nov 17, 2003 9:52 am
Location: Camp Walker, Taegu, Korea

Post by jose.natali »

Hi scorphus, :D

I'm from Puerto Rico. I'm in the Army, doing my Korea Tour, at Camp Walker, Taegu. (169th Signal Company/36th Signal Battalion)

I already had:
LoadModule php4_module /usr/lib/httpd/modules/libphp4.so
AddType application/x-httpd-php .php

I just add the third one, restart the machine but still the same problem. Any other ideas? :?

What I think is part of my problem could be in php.ini
cgi.force_redirect = 0

When I set the value to cero was when I was able to make my first routine work. If I set this value to 1, I got a message I (like a parragraph long) from php about some security issues with this value, was when I set it up to 0.

Hope you can help me!!!
User avatar
jose.natali
Forum Newbie
Posts: 5
Joined: Mon Nov 17, 2003 9:52 am
Location: Camp Walker, Taegu, Korea

Post by jose.natali »

Looks like nobody have a solution to my problem. :(
Thanks a lot to scorphus he tried to help me out. :D
Probably I will Re-Install everything again this weekend. :?
If somebody have any other Ideas, at all, please let me know, I will try anything in order to try to solve this problem 8) (if its possible, I just run out of resources)
Post Reply