Warning: Cannot modify header information - headers already sent by (output started at /var/www/jonas-eriksen.dk/pic/private/index.php:1) in /var/www/jonas-eriksen.dk/pic/private/index.php on line 215
#!/usr/bin/php
'/usr/bin/php',
'application/x-httpd-php-latest' => '/usr/bin/php84',
'application/x-httpd-lsphp' => '/usr/bin/php',
'application/x-httpd-php56' => '/usr/bin/php56',
'application/x-httpd-php70' => '/usr/bin/php70',
'application/x-httpd-php71' => '/usr/bin/php71',
'application/x-httpd-php72' => '/usr/bin/php72',
'application/x-httpd-php73' => '/usr/bin/php73',
'application/x-httpd-php74' => '/usr/bin/php74',
'application/x-httpd-php80' => '/usr/bin/php80',
'application/x-httpd-php81' => '/usr/bin/php81',
'application/x-httpd-php82' => '/usr/bin/php82',
'application/x-httpd-php83' => '/usr/bin/php83',
'application/x-httpd-php84' => '/usr/bin/php84',
];
$phpbin = $handlerMapping['application/x-httpd-php'];
$argv = array_slice($GLOBALS['argv'], 1);
$home = getenv('HOME');
$htaccessLocations = [];
if (isset($argv[0]) && is_file($argv[0])) {
$htaccessLocations[] = dirname($argv[0]) . '/.htaccess';
}
$htaccessLocations[] = getcwd() . '/.htaccess';
$htaccessLocations[] = $home . '/public_html/.htaccess';
foreach ($htaccessLocations as $_htaccess) {
if (!is_file($_htaccess)) {
continue;
}
$_htaccessData = file_get_contents($_htaccess);
if (preg_match('/^(?!\s*#)\s*AddType\s+(\S+)\s+\.php\b/im', $_htaccessData, $matches)) {
$handler = $matches[1];
if (isset($handlerMapping[$handler])) {
$phpbin = $handlerMapping[$handler];
break;
}
}
}
pcntl_exec($phpbin, $argv, $_SERVER);