SAFE MODE / mkdir() solution
My server is hosted at Surftown which unfortunately creates some nasty problems running Typo3.
Problem
PHP 4 running safe mode = ON will not be able to use folders
Problem specific
Extension import in Typo3 is not working (complaining about folder creation) and manual FTP import + overwrite is NOT possible
Solution
Use the ftp functions in PHP to create the folders
Se how at Henrik Hedegaard
Solution specific
Changes in the file … “\t3lib\class.t3lib_div.php”
… at line 2535 in the function “function mkdir($theNewFolder)”
… insert the following code
$theNewFolder = preg_replace('|/$|','',$theNewFolder);
$server="---SERVER---"; // ftp server
$connection = ftp_connect($server); // connection
// login to ftp server
$user = "---USERNAME---";
$pass = "---PASSWORD---";
$result = ftp_login($connection, $user, $pass);
$newDir = $theNewFolder;
$newDir = substr($newDir, 29); //only for my hostname
// check if connection was made
if ((!$connection) || (!$result)) {
} else {
if(ftp_mkdir($connection,$newDir)) { // create directory
//ftp_chmod($connection, 0777, $newDir);
ftp_site($connection,"CHMOD 0777 " . $newDir);
} else { }
ftp_close($conn_id); // close connection
//exit();
}
return TRUE;
— Thanks again Henrik Hedgaard —