Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are running a Apache server and 2 different PHP versions, version 5.3 (CLI) & 5.4 (suPHP)

To add some small protection we have been rewriting urls like "www.example.com/login.php" to our own php file which checks if the IP accessing it is granted to login. If granted the script includes the login.php file and continues to run as the login.php file, wrapping the ipcheck around it without editing anything of the customers login.php.

The problem I'm facing is that the script will always run as PHP version 5.3 because this is the default. While customers who have selected the suPHP 5.4 handler in their htaccess will be forced to use PHP 5.3 because the wrapper script is as default being runned as PHP 5.3 and includes the PHP script designed to be using suPHP 5.4.

My question is how to make the wrapper script run in suPHP 5.4 if the htaccess selects that handler? How to run the rewrite after the htaccess has been read?

We let customers select suPHP 5.4 through this line of code:

 <FilesMatch "\.php$">
 AddHandler x-httpd-php54 .php

After days of trying we're out of idea's, does anyone have a clue for us?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.