Jump to content
Fórum Script Brasil
  • 0

Conecta local , mas no servidor não


Clayton
 Share

Question

Olá ao tentar conectar o bd no servidor recebo essa mensagem :

Warning: include(/var/www/html/showdospes.com.br/web../../funcao/conecta.php): failed to open stream: No such file or directory in /var/www/html/showdospes.com.br/web/index.php on line 74

Warning: include(): Failed opening '/var/www/html/showdospes.com.br/web../../funcao/conecta.php' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/showdospes.com.br/web/index.php on line 74

Fatal error: Call to undefined function conecta() in /var/www/html/showdospes.com.br/web/index.php on line 75

mas local ele funciona normalmente:

<?php
function conecta( ){
  if(!defined("HOST")){
     define('HOST','http://showdospes.com.br');
  }
  if(!defined("BD")){
     define('BD','bolabola');
  }
  if(!defined("USER")){
     define('USER','eueueu');
  }
  if(!defined("PASS")){
     define('PASS',' 123456');
  }
try {
$conn = new PDO('mysql:host='.HOST.';dbname='.BD.'', ''.USER.'', ''.PASS.'');
$conn->exec("SET NAMES 'utf8'");
}
catch(PDOException $erro){
echo $erro->getMessage();
}
return $conn;
}

Onde está o erro ?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   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.

 Share

  • Forum Statistics

    • Total Topics
      149.6k
    • Total Posts
      646.2k
×
×
  • Create New...