I am trying to get PHP4 to run in Apache 1.3.26 I have it where it will properly display the html page with no problem. However, when I call in the php page this is what I get
The following is the information that you submitted on your employment application.
Notice: Undefined variable: Name in c:\program files\apache group\apache\htdocs\robert\application2.php on line 16
Position applied for: Name=
Notice: Undefined variable: Firstname in c:\program files\apache group\apache\htdocs\robert\application2.php on line 18
Firstname =
Notice: Undefined variable: Lastname in c:\program files\apache group\apache\htdocs\robert\application2.php on line 19
Lastname =
Notice: Undefined variable: Middlename in c:\program files\apache group\apache\htdocs\robert\application2.php on line 20
Middlename =
Notice: Undefined variable: email in c:\program files\apache group\apache\htdocs\robert\application2.php on line 21
email =
I know that the code is working properly because it will display properly when I it run it on a server that I know is right. I have followed all the methods for installation and editing the server configuration file like so.
There are two ways to set up PHP to work with Apache 1.3.x on Windows. One is to use the CGI binary (php.exe), the other is to use the Apache module DLL. In either case you need to stop the Apache server, and edit your srm.conf or httpd.conf to configure Apache to work with PHP.
It is worth noting here that now the SAPI module has been made more stable under windows, we recommend it's use above the CGI binary, since it is more transparent and secure.
Although there can be a few variations of configuring PHP under Apache, these are simple enough to be used by the newcomer. Please consult the Apache Docs for further configuration directives.
If you unziped the PHP package to c:\php\ as described in the Manual Installation Steps section, you need to insert these lines to your Apache configuration file to set up the CGI binary:
· ScriptAlias /php/ "c:/php/"
· AddType application/x-httpd-php .php .phtml
· Action application/x-httpd-php "/php/php.exe"
Note that the second line in the list above can be found in the actual versions of httpd.conf, but it is commented out. Remember also to substitute the c:/php/ for your actual path to PHP.
Warning
By using the CGI setup, your server is open to several possible attacks. Please read our CGI security section to learn how to defend yourself from attacks.
I added the lines like it says I get no syntax errors when I run a test on the server as I stated above it displays the html properly but not the PHP. I was not sure where to insert the line Action application/x-httpd-php "/php/php.exe" so I placed it here in the configuration file near the bottom where it reads Action.
# Action lets you define media types that will execute a script whenever
# a matching file is called. This eliminates the need for repeated URL
# pathnames for oft-used CGI file processors.
# Format: Action media/type /cgi-script/location
# Format: Action handler-name /cgi-script/location
Action application/x-httpd-php "/php/php.exe"
If I put format in front of the line I get a syntax error.
When I downloaded PHP4 I downloaded the php4.2.3 Installer.exe that was suppose to install and auto configure Microsoft personal web serve. I couldn’t get it to work at all with pws so I download the Apache server and reinstalled PHP4 after the installation it stated that the code has not been written to auto configure Apache 1.3 that you have to configure it manually which is what I am trying to do but am having some problems getting Apache to run the php. Any help will be greatly appreciated. TIA