Hi,
I have a cPanel hosting.
upload files breaks. It can't create subdirs in upload dir.
I can't do CHMOD -R 777 (recursively) and the owner of directoris is Apache user.
the problem: create subdirs.
the temporal solution I found: not use the function force_mkdir()
Line 169 of \opengoo\library\filerepository\backend\FileRepository_Backend_FileSystem.class.php
I changed temporally:
if(!mkdir($destination_dir, 0777, true)) {
//if(!force_mkdir($destination_dir, 0777)) {
my code for testing mkdir for my cPanel hosting:
error_reporting (E_ALL);
$dir="upload";
$base="dir_".rand(1,40);
//(A) prova a troços
if (1==1) {
$nom1=$base."_A";
$nom2=$nom1."_sub";
chdir($dir);
echo "<br>(A) prova a troços";
echo '<br>directorio actual: '.getcwd();
mkdir($nom1);
chmod($nom1,0777);
chdir($nom1);
mkdir($nom2);
chmod($nom2,0777);
chdir($nom2);
echo '<br>directorio actual: '.getcwd();
echo "<br>creado a trozos?: $dir / ".$nom1."/".$nom2 ;
chdir('../../../');
echo '<br>directorio actual: '.getcwd();
echo "<hr>";
}
//(B) prova directe
if (1==1) {
$nom=$base."_B/".$base."_B_sub/";
chdir($dir);
echo "<br>(B) prova directe";
echo '<br>directorio actual: '.getcwd();
echo '<br>Intentamos crear:: '.$nom;
mkdir($nom,0777,true);
echo '<br>directorio actual: '.getcwd();
echo "<br>creado?:".$nom ;
echo "<hr>";
}
//(C) prova force_mkdir
if (1==1) {
$nom=$base."_C/".$base."_C_sub/";
chdir($dir);
echo "<br>(C) prova directe";
echo '<br>directorio actual: '.getcwd();
echo '<br>Intentamos force_mkdir:: '.$dir.$nom;
force_mkdir($nom,0777);
echo '<br>directorio actual: '.getcwd();
echo "<br>creado?:".$nom ;
echo "<hr>";
}
function force_mkdir($path, $chmod = null) {
(....)
}