# apache unable to parse PHP

## madchaz

Well, I've searched the forum and can't seam to get this fixed. 

I've added this in apaches.conf

LoadModule php4_module                   extramodules/libphp4.so

I haven't changed anything else that I can think of. made sure to env-update (even rebooted a few times) but still I get the code instead of the parsed results. 

Any idea?

site: http://www.madchaz.com

edit: I know the code's hugly. Going to work on that once I got the server working.

----------

## RudyG

did you make sure to add "-D PHP4" to the /etc/conf.d/apache file under the APACHE_OPTS config variable?

Everyone forgets that  :Very Happy: 

----------

## madchaz

 *RudyG wrote:*   

> did you make sure to add "-D PHP4" to the /etc/conf.d/apache file under the APACHE_OPTS config variable?
> 
> Everyone forgets that 

 

DOH!!!!!!!!!  :Embarassed: 

Ok, that was one stupid mistake. Thanks for pointing it out. Glad to know everyone forgets however, hehehe

----------

## madchaz

ARG!!!

ok, now PHP parses but won't process the variables. 

To see what I mean, go to www.madchaz.com

the links should give dif sections but all show the main page

----------

## madchaz

OK, I got it working again. 

I had to set the following in php.ini for it to start working again. 

```
register_globals = on 
```

I'm not sure how I can modify my script so it won't need global vars for arguments passed via the URL however.

----------

## RudyG

i'd have to see your code to know what you're talking about exactly.  Usually they are available as $_GET['varname'] variables.

----------

## madchaz

 *RudyG wrote:*   

> i'd have to see your code to know what you're talking about exactly.  Usually they are available as $_GET['varname'] variables.

 

thanks for that. Guess that was still on by default last I had done PHP. 

I was able to turn it off and use $_GET['variable'] to get the values.

----------

## RudyG

overall, using $_GET or $_POST is a better way of doing things anyway.

----------

## morphal

Keeping register_globals = off is a security precaution. Keep it off and use a bit of code something like this to do things the "proper" way ... (as proper as things get with new languages, new versions, differences of opinion, your specific use, etc. )

```
$varName = $_REQUEST["varName"];
```

If the action of your form is set to script.php then you'd include that line of code in script.php.

The moral of the story is that keeping register_globals = off is good. How you work around it is up to you.

----------

