The .htaccess file only contains php settings for modules mod_php4.c and sapi_apache2.c. With increasing php5 users, probably a <IfModule mod_php5.c> section should be added.

PS. If I can help with this please let me know.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Morbus Iff’s picture

Which version of Apache are you using? I only have PHP 5 installed under an Apache 2 box.
Do you happen to know if the PHP module name changes depending on Apache 1 or 2?

jpulles’s picture

The server version returned by '/server-info/' says 'Apache/2.0.55 (Win32) PHP/5.1.2'.
The php module is loaded by apache with the statement

LoadModule php5_module "c:/program files/php-5.1.2/php5apache2.dll"

The module name is mod_php5.c. This should depend on the php version, although in case of Apache 1.x you need to load php5apache.dll.

I assume is used for the Apache 1.x. I don't know if this changes for php 5?

drewish’s picture

Status: Active » Needs review

Looking at the PHP documentation shows the following example for configuration changes:

<IfModule mod_php5.c>
  php_value include_path ".:/usr/local/lib/php"
  php_admin_flag safe_mode on
</IfModule>
<IfModule mod_php4.c>
  php_value include_path ".:/usr/local/lib/php"
  php_admin_flag safe_mode on
</IfModule>
<IfModule mod_php3.c>
  php3_include_path ".:/usr/local/lib/php"
  php3_safe_mode on
</IfModule>

But, there's a couple of comments saying that you need for Apache2 on both FreeBSD and Windows. So, I've added another block to catch PHP5 on Apache1.

Anyone care to test the attached patch?

Morbus Iff’s picture

Status: Needs review » Active

No patch attached.

drewish’s picture

Status: Active » Needs review
FileSize
1.1 KB

stupid attachment discarding preview....

Morbus Iff’s picture

I believe "sapi_apache2" was ONLY used in PHP4 under Apache 2, so we can't really label that one as being PHP5. If they merged the modulename to just mod_php5.c, for both Apache 1 and 2, that'd be the most ideal (and based on their documentation, that's what it looks like). I don't have time to make a patch now, but I'd like to see one that does mod_php4.c first, then the sapi_apache2.c, and then mod_php5.c, along with documentation stating that "the first is for PHP 4 under Apache 1, the second for PHP 4 under Apache 2, and the third for PHP 5 under either version".

jpulles’s picture

If you want you can assign it to me. It doesn't look to difficult, but it would be my first patch for drupal :-)

Morbus Iff’s picture

Awesome for your interest, openwereld. As for issue assignation, it is only used when you assign an Issue to *yourself* - to say "I will most assuredly take command of this issue and see it through to the bitter, bitter end." It is never used by one developer assigning it to another developer (who may not have a care in the world about the actual problem). So, if you'd like to make a patch for it, and follow it through religiously, have a blast! Go ahead and make one and "Assign" the issue to yourself. Note, of course, as drewish did, you certainly don't HAVE to assign the issue to yourself - doing so is more of a "no one touch this - I got it. No, really. All mine. MINE! AHAHHAHAhahAH!" sorta thing.

jpulles’s picture

This simple bug report is probably not worth this long discussion but still. Thanks for your explanation though on the 'assignation issue'. I had missed that a patch was already attached in response #5.

drewish’s picture

FileSize
1.25 KB

here's a patch based on Morbus Iff's suggestions.

markus_petrux’s picture

Just a comment.

Drupal needs PHP to run, and all those commands set the same exact PHP settings, so why use IfModule? Why not leave the supplied .htaccess with:

  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
Morbus Iff’s picture

Because PHP is not *always* run as a module - it could be running as a CGI, through FastCGI, or something else entirely, in which case, those directives in the .htaccess file would cause a 500 Internal Server Error (since Apache wouldn't recognize them as part of it's loaded list of commands).

markus_petrux’s picture

Ah, I haven't thought about that. Thanks

Morbus Iff’s picture

Priority: Minor » Normal
Status: Needs review » Reviewed & tested by the community
FileSize
1.49 KB

Made some minor style changes.

Steven’s picture

Status: Reviewed & tested by the community » Fixed

Committed to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)