Jump to content

Recommended Posts

Posted

O sistema estava em uma revenda e tive que migrar para uma VPS com Cpanel, o script para gerar o XLS estava funcionando certinho, abria e realizava o download , porem agora ele apenas abre na tela

O que preciso ativar para que funcione corretamente?

 

$html = '<table>
    <tr>
        <td>Coluna 1</td>        
        <td>Coluna 2</td>        
        <td>Coluna 2</td>        
    </tr>
    <tr>
        <td>Coluna 1</td>        
        <td>Coluna 2</td>        
        <td>Coluna 2</td>        
    </tr>
    <tr>
        <td>Coluna 1</td>        
        <td>Coluna 2</td>        
        <td>Coluna 2</td>        
    </tr>
</table>';

// Configurações header para forçar o download
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
header ("Content-type: application/x-msexcel");
header ("Content-Disposition: attachment; filename=\"nome_arquivo.xls\"" );
header ("Content-Description: PHP Generated Data" );

echo $html;

 


Posted

Provavelmente falta algum módulo do php que é usado para gerar esses xls

Enviado de meu GT-I9192 usando Tapatalk

Se cpanel da vps estiver rodando em cima de cloudlinux e só ir no seletor de versão do php e atiçar módulo

Enviado de meu GT-I9192 usando Tapatalk

Posted
1 minuto atrás, raphaelfasilva disse:

Provavelmente falta algum módulo do php que é usado para gerar esses xls

Enviado de meu GT-I9192 usando Tapatalk
 

Pois e, parece que alguma voisa no php.ini nem os header Location estão funcionando

Posted
6 minutos atrás, msaulohenrique disse:

Tem gerado algum error_log?

Para gerar o XMS não, mais achei o que pode resolver no PHP.INI , que seria o output_buffering, so que esta acontecendo que alterando diretamente no php.ini, ele não muda , teria que mudar direto pelo WHM, porem não estou achando

 

  • Administration
Posted
1 hora atrás, MarcosPP disse:

Desculpe, mais não e programação, e configuração do PHP.INI

Estou tentando achar em qual linha

Tu já tentou isso em outro servidor?

'Cause he's my best friend, he's my pal. He's my homeboy, my rotten soldier. He's my sweet cheese. My good-time boy.

Posted
2 horas atrás, MarcosPP disse:

Para gerar o XMS não, mais achei o que pode resolver no PHP.INI , que seria o output_buffering, so que esta acontecendo que alterando diretamente no php.ini, ele não muda , teria que mudar direto pelo WHM, porem não estou achando

 

Easyapache 4: WHM » Software » MultiPHP INI Editor

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Do you agree with our terms?