logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

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

or

Bitcoin

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

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Coding & Scripting Corner View previous topic :: View next topic
Reply to topic   Topic: AddHandler .htaccess PHP
Author
petersra



Joined: 01 Dec 2008
Posts: 2

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

Greetings

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.


Help.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7288
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


Reply to topic   Topic: AddHandler .htaccess PHP View previous topic :: View next topic
Post new topic   Forum Index -> Coding & Scripting Corner