Apache Lounge



Forum Index Downloads Search Register Log in  RSS Apache Lounge

Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.



A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.

BitNami WAMP Stack

Contains ApacheLounge build

AddHandler .htaccess PHP

Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner

View previous topic :: View next topic  
Author Message

Joined: 01 Dec 2008
Posts: 2

PostPosted: Fri 12 Dec '08 13:37    Post subject: AddHandler .htaccess PHP Reply with quote


I want any request for a .jpg file in the target directory to cause a PHP script to run. In the past I did this with the following code in my .htaccess which executed the php script in the same directory as the image file.

AddHandler phpscript .jpg
Action phpscript myscript.php

The above worked with Apache2 and PHP version 4. However, when I changed to PHP v5 the script no longer works.

Please note that I have PHP5 as a module of Apache2 not a CGI.

Back to top
James Blond

Joined: 19 Jan 2006
Posts: 6311
Location: Germany, Next to Hamburg

PostPosted: Wed 07 Jan '09 18:51    Post subject: Reply with quote

Are you using short tags? e.g. <? instead of <?php
What is about that in your error log? Turned on php error log?

With PHP5 AddType application/x-httpd-php phpscript.jpg should work.
Than the phpscript.jpg contains the script
Back to top

Post new topic   Reply to topic    Apache Forum Index -> Coding & Scripting Corner
Page 1 of 1