Back to top

Autore Topic: Permesso di accesso negato su file di configurazione  (Letto 4850 volte)

Offline Overgrafic

  • Esploratore
  • **
  • Post: 90
  • Sesso: Maschio
    • Mostra profilo
Da qualche giorno mi appare questo errore:

Citazione
Warning: fopen(/home/rcjit/public_html/administrator/components/com_docman/docman.config.php) [function.fopen]: failed to open stream: Permission denied in /home/rcjit/public_html/administrator/components/com_docman/classes/DOCMAN_config.class.php on line 119

Le conseguenze sono che, nonostante abbia le cartelle con permessi 777, non riesco a cambiare i parametri di configurazione, ad esempio il numero di doenload per pagina ecc...
Sapete aiutarmi?


** titolo modificato **
« Ultima modifica: 25 Feb 2007, 20:10:19 da -napo- »
Lillo Leonardo

Offline carlodamo

  • Global Moderator
  • Instancabile
  • ********
  • Post: 3817
  • Sesso: Maschio
    • Mostra profilo
Re: Un errore
« Risposta #1 il: 22 Gen 2007, 18:08:44 »
secondo me... spiega meglio il tuo errore e metti un titolo che sia appropriato... :)
ciao
Evisole Web agency a Vicenza

Offline Overgrafic

  • Esploratore
  • **
  • Post: 90
  • Sesso: Maschio
    • Mostra profilo
Re: Aiuto su un errore
« Risposta #2 il: 22 Gen 2007, 18:23:23 »
Ho modificato....potete rileggere il post   :)
Lillo Leonardo

Offline Overgrafic

  • Esploratore
  • **
  • Post: 90
  • Sesso: Maschio
    • Mostra profilo
Re: Aiuto su un errore
« Risposta #3 il: 23 Gen 2007, 08:28:04 »
Da qualche giorno mi appare questo errore:

Citazione
Warning: fopen(/home/rcjit/public_html/administrator/components/com_docman/docman.config.php) [function.fopen]: failed to open stream: Permission denied in /home/rcjit/public_html/administrator/components/com_docman/classes/DOCMAN_config.class.php on line 119

Le conseguenze sono che, nonostante abbia le cartelle con permessi 777, non riesco a cambiare i parametri di configurazione, ad esempio il numero di doenload per pagina ecc...
Sapete aiutarmi?
Lillo Leonardo

Offline Overgrafic

  • Esploratore
  • **
  • Post: 90
  • Sesso: Maschio
    • Mostra profilo
Re: Aiuto su un errore
« Risposta #4 il: 25 Feb 2007, 16:47:21 »
Perfavore...datemi una mano, ecco il codice php della pagina in questione

Codice: [Seleziona]
<?php
/*
* DOCMan 1.3.0 for Mambo 4.5.1 CMS  
* @version $Id: DOCMAN_config.class.php,v 1.31 2005/01/25 15:15:38 johanjanssens Exp $
* @package DOCMan_1.3.0
* @copyright (C) 2003 - 2005 The DOCMan Development Team
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* Oficial website: http://www.mambodocman.com/
*/

defined('_VALID_MOS') or die('Direct access to this location is not allowed.');

if (
defined('_DOCMAN_config')) {
    return 
true;
} else {
    
define('_DOCMAN_config'1);


class 
DOCMAN_Config {
    
/**
    * *
    * 
    * @var string The path to the configuaration file
    */
    
var $_path null;

    
/**
    * *
    * 
    * @var string The name of the configuaration class
    */
    
var $_name null;

    
/**
    * *
    * 
    * @var object An object of configuration variables
    */
    
var $_config null;

    function 
DOCMan_Config($name$path)
    {
        
$this->_path $path;
        
$this->_name $name;
        
$this->_loadConfig();
    } 

    
/**
    * 
    * @param string $ The name of the variable
    * @return mixed The value of the configuration variable or null if not found
    */
    
function getCfg($varname $default null)
    {
        if (isset(
$this->_config->$varname)) {
            return 
$this->_config->$varname;
        } else {
            if (! 
is_null($default)) {
                
$this->_config->$varname $default;
            } 
            return 
$default;
        } 
    } 

    
/**
    * 
    * @param string $ The name of the variable
    * @param string $ The new value of the variable
    * @return bool True if succeeded, otherwise false.
    */
    
function setCfg($varname$value$create false)
    {
        if (
$create || isset($this->_config->$varname)) {
            
$this->_config->$varname $value;
            return 
true;
        } else {
            return 
false;
        } 
    } 

    
/**
    * Loads the configuration file and creates a new class
    */
    
function _loadConfig()
    {
        if (
file_exists($this->_path)) {
            require_once(
$this->_path);
            
$this->_config = new $this->_name();
        } else {
            
$this->_config = new StdClass();
        } 
    } 

    
/**
    * Saves the configuration object
    */
    
function saveConfig()
    {
        global 
$my;

        
$config "<?php\n\n";
        
$config .= "if( defined( '_" $this->_name "') ) {\n return true;\n } else { \ndefine('_" $this->_name "',1); \n }\n";
        
$config .= "class " $this->_name "\n{\n";
        
$config .= "// Last Edit: " strftime("%a, %Y-%b-%d %R") . "\n";
        
$config .= "// Edited by: " $my->username "\n";

        
$vars get_object_vars($this->_config);
        foreach(
$vars as $key => $value) {
            if (
is_array($value)) {
                
$config .= 'var $' $key ' = ' var_export($value true) . ";\n" ;
            } else {
                
$config .= 'var $' $key ' = "' $value "\";\n" ;
            } 
        } 

        
$config .= "}\n";
        
$config .= "?>
";

        if ($fp = fopen($this->_path, "w")) {
            fputs($fp, $config, strlen($config));
            fclose ($fp);
            return true;
        } else {
            return false;
        }
    }
}

?>
Lillo Leonardo

Offline Overgrafic

  • Esploratore
  • **
  • Post: 90
  • Sesso: Maschio
    • Mostra profilo
Re: Aiuto su un errore
« Risposta #5 il: 25 Feb 2007, 18:28:46 »
Allora...ho risolto facendo così:
ho sostituito il codice

Codice: [Seleziona]
      119 if ($fp = fopen($this->_path, "w")) {
            120 fputs($fp, $config, strlen($config));
            121 fclose ($fp);

con questo

Codice: [Seleziona]
/*Changed the next three lines, file_get_contents was fopen, commented the next two*/
        if ($fp = file_get_contents($this->_path, "w")) {
       
        &nbsp;  /* fputs($fp, $config, strlen($config));
            fclose ($fp);*/

Se ci sono errori o novità faccio sapere!
« Ultima modifica: 25 Feb 2007, 21:03:34 da llillo »
Lillo Leonardo

Offline napo

  • Instancabile
  • ******
  • Post: 6532
  • Sesso: Maschio
  • NO MP TECNICI, verranno ignorati
    • Mostra profilo
Re: Aiuto su un errore
« Risposta #6 il: 25 Feb 2007, 20:12:04 »
Warning: fopen(/home/rcjit/public_html/administrator/components/com_docman/docman.config.php) [function.fopen]: failed to open stream: Permission denied in /home/rcjit/public_html/administrator/components/com_docman/classes/DOCMAN_config.class.php on line 119

Cosa c'è scritto alla riga 119?
E il file docman.config.php che permessi ha? Chi è il proprietario?


AllOne.it Consulting: http://www.allone.it Gens Joomla, il : http://www.gensjoomla.org  [url=http://www.allone.it/jooml

 



Web Design Bolzano Kreatif