CoMaSkyWar Posted March 9, 2020 at 10:02 PM Share Posted March 9, 2020 at 10:02 PM (edited) Boas pessoal estou com um problema atualizei a minha VPS para uma mais atual só estou com um problema na pagina de registo a imagem captcha não aparece, será que alguém já teve o meu problema deixo um print do erro obrigado Edited March 9, 2020 at 10:06 PM by CoMaSkyWar Link to comment
[Admin] tierrilopes Posted March 9, 2020 at 10:04 PM Share Posted March 9, 2020 at 10:04 PM Olá, verifica se tens a extensão php "GD" instalada Link to comment
CoMaSkyWar Posted March 9, 2020 at 10:08 PM Author Share Posted March 9, 2020 at 10:08 PM (edited) ola, o site ja o uso a alguns anos sempre deu nao alterei nada, mas onde posso verificar o "GD" instalada Edited March 9, 2020 at 10:10 PM by CoMaSkyWar Link to comment
[Admin] tierrilopes Posted March 9, 2020 at 11:14 PM Share Posted March 9, 2020 at 11:14 PM Não é o site que tem de ter o "gd". É uma extensão para o php. Utiliza "pkg install php71-gd", substituindo 71 pela versão do teu php. Depois reinicia o apache / nginx Link to comment
CoMaSkyWar Posted March 11, 2020 at 01:01 AM Author Share Posted March 11, 2020 at 01:01 AM (edited) Em 09/03/2020 em 23:14, tierrilopes disse: pkg install php71-gd Boas dei esse comando e da erro mando print obrigado Edited March 11, 2020 at 01:03 AM by CoMaSkyWar Link to comment
xkillmt2 Posted March 11, 2020 at 08:22 AM Share Posted March 11, 2020 at 08:22 AM (edited) Abra o arquivo captcha.php e substitua o código por: <?PHP session_start(); header("Content-Type: image/png"); // Sets the Content of this file to an PNG-Image // $ttf = "./franconi.ttf"; //Schriftart $_SESSION["captcha_id"] = ""; // Clears the old value $zufallszahl = mt_rand(50000,60000); // Generates a random number between 50000 and 60000 $_SESSION["captcha_id"] = $zufallszahl; // Sets the value of the session $bild = imagecreatefromgif("bg.gif"); // Creates a new image from background file $weisser = imagecolorallocate($bild, 255, 255, 255); // Sets white text color // imagettftext($bild, 11, 10, 5, 20, $weisser, $ttf, $_SESSION["captcha_id"]); imagestring($bild, 5, 8, 5, $_SESSION["captcha_id"], $weisser); // Prints the random number von the image ImagePNG($bild); // Output for the generated image imagedestroy($bild); ?> Edited March 11, 2020 at 08:26 AM by xkillmt2 Link to comment
[Admin] tierrilopes Posted March 11, 2020 at 11:09 AM Share Posted March 11, 2020 at 11:09 AM O comando que te dei foi exemplo para FreeBSD. Para debian o comando não é pkg mas sim apt-get. apt-get install php7.1-gd Consoante a versão PHP que instalaste. Tens de ajustar o 7.1 a versão instalada. Link to comment
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