3

i have following problem...

i have a webapplication and i want to use

register_argc_argv

in my php.ini it is turned off

Directive           Local Value    Master Value
register_argc_argv  Off            Off

now the problem is, i can't access the php.ini file directly because its on a hosted sever. and actually even if i could, i don't want to turn on the master value.

in my index.php the first rows are:

<?php
    # Config
    require_once( "php/config.php" );

   // some more of my source
?>

in the config.php my source starts like this:

<?php

    ini_set( "register_argc_argv",          "1" );
    ini_set( "display_errors",      "1" );
    ini_set( "display_startup_errors",  "1" );

    // some more of my source
?>

but it won't turn on.

Question:

Am i doing something wrong ?

Is there a solution for this?

Could this be blocked by provider ?

What i have tried:

  • ini_set( "register_argc_argv", "1" );
  • ini_set( "register_argc_argv", 1 );
  • ini_set( "register_argc_argv", "On" );
  • ini_set( "register_argc_argv", true );

And no PHP: How to override register_argc_argv? is not a dublicate because

  1. this answere doesn't work for me
  2. you see my first line and there is nothing executed befor
Community
  • 1
  • 1
Dwza
  • 6,494
  • 6
  • 41
  • 73
  • 3
    register_argc_argv is PHP_INI_PERDIR, meaning that it can only be set in php.ini, .htaccess, httpd.conf or .user.ini (that latter since PHP 5.3) – Mark Baker Jun 05 '14 at 11:20
  • 1
    @MarkBaker could you tell me whats the correct .htaccess entry to do this ? gues google doesn't likes me :D `php_flag register_argc_argv On`causes an internal server error 500 – Dwza Jun 05 '14 at 12:59
  • @MarkBaker it seems like the server runs php in CGI-Mode so i can't use .htaccess to set flags like `php_flag register_argc_argv On`. – Dwza Jun 05 '14 at 13:05
  • Are you wanting to do this in CLI mode? Maybe a word with the hosting company may be useful? – Ryan Vincent Jun 05 '14 at 13:45
  • actually i don't want to change any mode :) just want to set the flag. but in fact that this is getting a big deal i decided to leave it like this :) – Dwza Jun 05 '14 at 14:02
  • i think i got some wrong anyway... i thought i can write a function like `function test(){ var_dump($argv);}` and if i call it i pass as may values i want... i know i could use a array for this but that's a other story :D thx anyway – Dwza Jun 05 '14 at 14:15

0 Answers0