Can't get php going with Apache 1.3x

Forum for you who has PHP installation issues

Moderators: egami, macek, gesf

Post Reply
brownie124
New php-forum User
New php-forum User
Posts: 23
Joined: Thu Feb 13, 2003 1:58 pm
Location: Peterborough, NH

Thu Feb 13, 2003 2:11 pm

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

User avatar
Redcircle
Moderator
Moderator
Posts: 826
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Thu Feb 13, 2003 3:40 pm

does apache work with a regular html file?

brownie124
New php-forum User
New php-forum User
Posts: 23
Joined: Thu Feb 13, 2003 1:58 pm
Location: Peterborough, NH

Thu Feb 13, 2003 7:11 pm

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?

brownie124
New php-forum User
New php-forum User
Posts: 23
Joined: Thu Feb 13, 2003 1:58 pm
Location: Peterborough, NH

Thu Feb 13, 2003 7:20 pm

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

User avatar
Redcircle
Moderator
Moderator
Posts: 826
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Fri Feb 14, 2003 12:42 am

what is the complete version of apache. it may not support the module.

Oleg Butuzov
Last Samuray
Last Samuray
Posts: 824
Joined: Sun Jun 02, 2002 3:09 am

Fri Feb 14, 2003 6:19 am

brownie124 wrote:When I do that, I cannot initialize the server. Does anyone know why?


error in the httpd.conf

brownie124
New php-forum User
New php-forum User
Posts: 23
Joined: Thu Feb 13, 2003 1:58 pm
Location: Peterborough, NH

Fri Feb 14, 2003 6:41 am

The version I am using is 1.3.27.

brownie124
New php-forum User
New php-forum User
Posts: 23
Joined: Thu Feb 13, 2003 1:58 pm
Location: Peterborough, NH

Fri Feb 14, 2003 8:26 am

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

brownie124
New php-forum User
New php-forum User
Posts: 23
Joined: Thu Feb 13, 2003 1:58 pm
Location: Peterborough, NH

Fri Feb 14, 2003 8:47 am

I finally have it.

Thanks.

User avatar
WiZARD
Moderator
Moderator
Posts: 1240
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Sat Feb 15, 2003 2:41 am

Cause Windows (by Billy Gates) is very big suxx in some situation need reinstall apache, if you what to run it.... :?
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";
Image

brownie124
New php-forum User
New php-forum User
Posts: 23
Joined: Thu Feb 13, 2003 1:58 pm
Location: Peterborough, NH

Wed Feb 19, 2003 6:18 pm

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

brownie124
New php-forum User
New php-forum User
Posts: 23
Joined: Thu Feb 13, 2003 1:58 pm
Location: Peterborough, NH

Thu Feb 27, 2003 5:05 am

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

User avatar
WiZARD
Moderator
Moderator
Posts: 1240
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol
Contact:

Thu Feb 27, 2003 8:08 am

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....
"Sex,Drugs and Rock&Roll " replaced at "Sucks,Bugs and Plug&Play";
Image

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests