benkas Posted August 27, 2012 at 02:46 PM Report Share #473667 Posted August 27, 2012 at 02:46 PM (edited) Boas, Tenho o seguinte código, que funciona na perfeição no ubuntu desktop, mas ao passar para o ubunto server, este código não funciona, alguem me consegue ajudar? chdir ($email_a_enviar->directoria_base."plataforma/clientedemail/upload/".$username); $dir = opendir (".");//abre a directoria actual, q eh ./upload/ após a mudança feita com o changedir while ($filename = readdir($dir)) { if ($filename != ".." && $filename != "." && $filename != 'error_log')// && is_file($filename))//se n meter isto ele vai buscar tb o . e o .. q considera como ficheiros. E tb faço com q o prog n envie os logs dos erros. E verifico q eh mesmo um ficheiro { $anexos .=$filename." "; //$attachment = fread($fp = fopen($filename, 'r'), filesize($filename)); //$mail->add_attachment($attachment, $filename, filetype($filename)); echo "Anexo$i: $filename<br />"; $attachment_completo = array("FileName"=>$filename, "Content-Type"=>"automatic/name", "Disposition"=>"attachment"); $email_message->AddFilePart($attachment_completo); $i++; } } Edited August 27, 2012 at 03:25 PM by scorch Adicionado Geshi. :) Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted August 27, 2012 at 02:57 PM Report Share #473670 Posted August 27, 2012 at 02:57 PM o que te leva a dizer que "não funciona" ? mensagem de erro ? o computador desligasse ? IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
benkas Posted August 27, 2012 at 03:05 PM Author Report Share #473671 Posted August 27, 2012 at 03:05 PM a função chdir não é executada Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted August 27, 2012 at 03:20 PM Report Share #473673 Posted August 27, 2012 at 03:20 PM tens a certeza que o diretório : $email_a_enviar->directoria_base."plataforma/clientedemail/upload/".$username existe ? IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
benkas Posted August 27, 2012 at 03:24 PM Author Report Share #473674 Posted August 27, 2012 at 03:24 PM sim ,existe Link to comment Share on other sites More sharing options...
HappyHippyHippo Posted August 27, 2012 at 03:26 PM Report Share #473675 Posted August 27, 2012 at 03:26 PM (edited) então o problema é simples : Note: When safe mode is enabled, PHP checks whether the directory in which the script is operating has the same UID (owner) as the script that is being executed. por outras palavras : o apache não tem permissões para ler a pasta Edited August 27, 2012 at 03:27 PM by HappyHippyHippo IRC : sim, é algo que ainda existe >> #p@p Portugol Plus Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now