Jump to content

passagem para Ubuntu Server


Recommended Posts


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");

Edited by scorch
Adicionado Geshi. :)
Link to comment
Share on other sites

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 by HappyHippyHippo
IRC : sim, é algo que ainda existe >> #p@p
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.