Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 13
  1. #1

    Inclusione file esterni

    Ciao a tutti,
    Devo includere un file al di fuori della cartella httpdocs del mio server...
    il percorso del file da includere è

    codice:
    /var/www/vhosts/hostingtalk.it/subdomains/ad/httpdocs/phpadsnew.inc.php
    e devo richiamare il file al posto di (vedi sotto) nello script a fondo pagina...

    @include(getenv('DOCUMENT_ROOT').'/ads/phpadsnew.inc.php'
    Codice PHP:
    <?php
        
    if (@include(getenv('DOCUMENT_ROOT').'/ads/phpadsnew.inc.php')) {
            if (!isset(
    $phpAds_context)) $phpAds_context = array();
            
    $phpAds_raw view_raw (''2'''''0'$phpAds_context);
            
    $phpAds_context[] = array('!=' => 'bannerid:'.$phpAds_raw['bannerid']);
            
    $phpAds_context[] = array('!=' => 'campaignid:'.$phpAds_raw['campaignid']);
            echo 
    $phpAds_raw['html'];
        }
    ?>
    come potrei includere quel file dentro a quel relativo percorso visto che è al di fuori di httpdocs ?
    Ho fatto un po di confusione... speriamo si capisca
    http://WWW.HOSTINGTALK.IT
    Forum italiano dedicato all'hosting

  2. #2
    uppete
    http://WWW.HOSTINGTALK.IT
    Forum italiano dedicato all'hosting

  3. #3
    salvo configurazioni restrittive (safe mode ad sempio) puoi includere file che stanno ovunque..con indirizzi relativi e credo anche assoluti....


  4. #4
    ok... se includo un il file dando percorso asosoluto del server... mi da un errore del topo
    openbasedir... ecc ecc
    come faccio?
    http://WWW.HOSTINGTALK.IT
    Forum italiano dedicato all'hosting

  5. #5
    incolla l'errore esatto

    onestamente cmq non ho mai provato con un path assoluto, ma di sicuro funziona con un path relativo.... non ti è utile lo stesso?

  6. #6
    codice:
    Warning: main(): open_basedir restriction in effect. File(/var/www/vhosts/hostingtalk.it/subdomains/ad/httpdocs/phpadsnew.inc.php) is not within the allowed path(s): (/var/www/vhosts/hostingtalk.it/httpdocs:/tmp) in /ads-alto.php on line 2
    
    Warning: main(/var/www/vhosts/hostingtalk.it/subdomains/ad/httpdocs/phpadsnew.inc.php): failed to open stream: Operation not permitted in /ads-alto.php on line 2
    
    Warning: main(): open_basedir restriction in effect. File(/var/www/vhosts/hostingtalk.it/subdomains/ad/httpdocs/phpadsnew.inc.php) is not within the allowed path(s): (/var/www/vhosts/hostingtalk.it/httpdocs:/tmp) in /ads-alto.php on line 2
    
    Warning: main(/var/www/vhosts/hostingtalk.it/subdomains/ad/httpdocs/phpadsnew.inc.php): failed to open stream: Operation not permitted in /ads-alto.php on line 2
    
    Warning: main(): Failed opening '/var/www/vhosts/hostingtalk.it/subdomains/ad/httpdocs/phpadsnew.inc.php' for inclusion (include_path='.:/usr/share/pear') in /ads-alto.php on line 2
    eccolo qua
    Grazie per il tuo aiuto
    http://WWW.HOSTINGTALK.IT
    Forum italiano dedicato all'hosting

  7. #7
    http://it.php.net/features.safe-mode

    ho indagato meglio... pare sia proprio il safe mode... se hai accesso alla configurazione del server puoi disabilitare il safe mode o configurare la direttiva open base dir.... altrimenti.. niente da fare



  8. #8
    sisi accesso alla config del server ce l'ho...
    mi sapresti indicare meglio come fare? sono un po niubbo
    http://WWW.HOSTINGTALK.IT
    Forum italiano dedicato all'hosting

  9. #9
    devi editare il php.ini... e disabilitare il safe mod... per mggiori info, c'è il manuale (che per i niubbi dovrebbee essere la bibbia )

  10. #10
    Ciao guidoz
    Credo sia già disabilitato... ti incollo un pezzo di php.ini

    codice:
    ;
    ; Safe Mode
    ;
    safe_mode = Off
    
    ; By default, Safe Mode does a UID compare check when
    ; opening files. If you want to relax this to a GID compare,
    ; then turn on safe_mode_gid.
    safe_mode_gid = Off
    
    ; When safe_mode is on, UID/GID checks are bypassed when
    ; including files from this directory and its subdirectories.
    ; (directory must also be in include_path or full path must
    ; be used when including)
    safe_mode_include_dir =								
    
    ; When safe_mode is on, only executables located in the safe_mode_exec_dir
    ; will be allowed to be executed via the exec family of functions.
    safe_mode_exec_dir =
    
    ; Setting certain environment variables may be a potential security breach.
    ; This directive contains a comma-delimited list of prefixes.  In Safe Mode,
    ; the user may only alter environment variables whose names begin with the
    ; prefixes supplied here.  By default, users will only be able to set
    ; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR).
    ;
    ; Note:  If this directive is empty, PHP will let the user modify ANY
    ; environment variable!
    safe_mode_allowed_env_vars = PHP_
    
    ; This directive contains a comma-delimited list of environment variables that
    ; the end user won't be able to change using putenv().  These variables will be
    ; protected even if safe_mode_allowed_env_vars is set to allow to change them.
    safe_mode_protected_env_vars = LD_LIBRARY_PATH
    
    ; open_basedir, if set, limits all file operations to the defined directory
    ; and below.  This directive makes most sense if used in a per-directory
    ; or per-virtualhost web server configuration file. This directive is
    ; *NOT* affected by whether Safe Mode is turned On or Off.
    ;open_basedir =

    Grazie molte del tuo aiuto
    http://WWW.HOSTINGTALK.IT
    Forum italiano dedicato all'hosting

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.