Can't get php going with Apache 1.3x

A

Anonymous

Guest
Hi,

I am running Apache 1.3_14 under Windows 2K PE and have just installed PHP 4.3. I have a simple php file that basically just has a call to phpinfo() in it. This is place in the htdocs directory. When I try to view it in the browser (http://127.0.0.1/info.php), I receive an HTTP 400 error. I know the server installation itself is fine as I have been running it for years and other html files in the same directory display correctly. I must have something messed up in the configuration of PHP with the server because when I go to the php directory and run php -i I do get a dump of the expected html.

Here are the pertinent lines in my httpd.conf file:
ScriptAlias /php/ "C:/misc/PHP"
AddType application/x-httpd-php4 .php
Action application/x-httpd-php4 "/php/php.exe"

Any help would be greatly appreciated.

Thanks,
- Michael
 
Yes it does. I have been running it for years. I did some further investigating and there are many samples of httpd.conf files that contain the line:
LoadModule php_module "C:/misc/PHP/sapi/php4apache.dll"

When I do that, I cannot initialize the server. Does anyone know why?
 
Oh, by the way, the error that I am getting is:
Could not start the Apache Service on Local Computer
Error 1067: The process terminated unexpectedly.

As soon as I remove the LoadModule php_module... line, it starts just fine.

Thanks,
- Michael
 
what is the complete version of apache. it may not support the module.
 
Well, I have made some progress. I can now get the module loaded. I had to change LoadModule php_module to LoadModule php4_module. However, I am having another problem. Again, going back to an attempt to execute a simple php file in my htdocs directory, the browser wants to download the file instead of executing php.

There is still something wrong, but I am not sure if it is in the php.ini file, the httpd.conf file or what.

Any help would be appreciated.

Thanks,
- Michael
 
Cause Windows (by Billy Gates) is very big suxx in some situation need reinstall apache, if you what to run it.... :?
 
Vanciva,

You do not need the "Action Application..." line as you are loading php as a module and NOT a cgi executable.

Also, instead of application/x-httpd-php4, make it application/x-httpd-php (without the 4).

Hope that helps

- Brownie
 
Hi Vanciva,

There are a couple of things that you need to do:
First of all, I would turn error logging on so you can see what is happening. In your php.ini file look for the line that sets the error_log variable and set it to something like this:
error_log = "C:\PHP\errors\error.log". So, in the future, you can look there and it may help you determine what is going on.

If you are going to use multiple php pages and want to be able to access and modify variables from other pages there are additional things that you have to do. This is nice because you don't have to pass anything in the url. In other words, you could change your "method=get" to "method=post".

To do this you have to enable sessions in your php installation. This requires that you modify the line in your php.ini that sets the session.save_path variable. You want to set it to something like:
session.save_path = c:/temp

You now will have to change your php code slightly. You need to add session_start(); in both your php files (its good practice to make it the first line of your php code.) In your first php file (the one with the form) you need to register the variables that you want to share across php files. You do this with session_register("foo_var"). Then to access a session variable you would do it like this:
$_SESSION['foo_var']="Hello World!";

In your second php file (in your case sign.php) you would then do something like this:
echo $_SESSION['foo_var'];

And you should be set. Remember, the session_start() must be in all your php files where you want to share variables.

Also, you can go to where you set up the session variable files (c:\temp) and look at the values.

Hope this helps.

- Brownie
 
Hi vanciva!
interestin for what is this:

http://localhost:81/phpapp/sign.php
i mean :81?

problem what php not running :(

See in httpd.conf
where you have a mistake....
In a future if you some change in in this file need restert apache....
 
Back
Top