Sorry about this I'm doing something stupid, I'm sure, but I'm afraid I can't see what. I've searched in the mailing list for similar problems and there were a few but none provided me with an answer.
I installed PHP 5 as Per the instructions in install.unix.php on the PHP site.
I've installed Apache/2.0.53 previously on Linux Kernel 2.4.21
There's a few lines to add to the httpd.conf file the first of which 'LoadModule' goes fine:
LoadModule php5_module modules/libphp5.so
This is all you need to load the dso php module (libphp5.so)
you dont need the AddModule line for the dso version (mod_php_5.c doesn't exist)
After that the instructions say to add an 'AddModule' command the instructions being:-
And in the AddModule section of httpd.conf, somewhere under the ClearModuleList, add this:
There are no AddModule commands in my file! And there's no sign of ClearModuleList I've searched the file and to no avail. When I do add the AddModule line:
AddModule mod_php_5.c
I get an error when I start the Apache server:
Syntax error on line 236 of /usr/local/apache2/conf/httpd.conf:
Invalid command 'AddModule', perhaps mis-spelled or defined by a module not included in the server configuration
Can anybody help? When I remove the line the Server starts fine and PHP seems to be working
fine. The only problem that I'm having is that I've copied an example out of a book which
passes variables from a html page to a php script and it fails.
The html page has a form:
<form METHOD="post" ACTION="Calculate.php">
<p>Value 1: <input TYPE="text" NAME="val1" SIZE=10></p>
<p><input TYPE="submit" NAME="submit" VALUE="Calculate"></p> </form>
In the PHP Script I simply try to print the value:
<?PHP echo "Value 1 is $val1";?>
Is this error in transfering the variables from the HTML Page to the PHP Script because of my failed AddModule line?
No, it is because form variables are no longer automatically available to scripts (register_globals is now off by default, has been for a while) you will need to use $_POST['variable_name'] to access the variables. If the form method is GET you use $_GET['variable_name'].
You can also use $_REQUEST['variable_name'] to access variables in either $_GET, $_POST or $_COOKIE arrays.
(of course you replace 'variable_name' with the name of the variable you want to use)
Cheers, Brad
-- Brad Kowalczyk Web Developer www.ibiscode.com