0.6.1.20060928-1 release
[manu/suphp.git] / src / Application.cpp
index 2a3c235..bb7ce50 100644 (file)
@@ -103,6 +103,12 @@ int suPHP::Application::run(CommandLine& cmdline, Environment& env) {
        // Prepare environment for new process
        newEnv = this->prepareEnvironment(env, config, targetMode);
        
        // Prepare environment for new process
        newEnv = this->prepareEnvironment(env, config, targetMode);
        
+       // Set PATH_TRANSLATED to SCRIPT_FILENAME, otherwise
+       // the PHP interpreter will not be able to find the script
+       if (targetMode == TARGETMODE_PHP && newEnv.hasVar("PATH_TRANSLATED")) {
+           newEnv.setVar("PATH_TRANSLATED", scriptFilename);
+       }
+       
        // Log attempt to execute script
        logger.logInfo("Executing \"" + scriptFilename + "\" as UID "
                       + Util::intToStr(api.getEffectiveProcessUser().getUid())
        // Log attempt to execute script
        logger.logInfo("Executing \"" + scriptFilename + "\" as UID "
                       + Util::intToStr(api.getEffectiveProcessUser().getUid())