Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

João Bispo dos Santos F.

Erro admin PHP

Recommended Posts

Boa Tarde Pessoal estou fazendo o site em PHP onde criei do arquivos de coxexão com o Banco um que fica raiz e outro para dar permissão de admin.

 

Na hospedagem Windows esta funcionando , já na hospedagem linux - cpanel apresenta o erro,

 

 

[08-Mar-2016 09:24:26 America/Sao_Paulo] PHP Warning: include_once(Connections/config.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in /home/ibcsncom/public_html/admin/login.php on line 1

[08-Mar-2016 09:24:26 America/Sao_Paulo] PHP Warning: include_once() [<a href='function.include'>function.include</a>]: Failed opening 'Connections/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ibcsncom/public_html/admin/login.php on line 1

[08-Mar-2016 09:24:29 America/Sao_Paulo] PHP Warning: include_once(Connections/config.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in /home/ibcsncom/public_html/admin/login.php on line 1

[08-Mar-2016 09:24:29 America/Sao_Paulo] PHP Warning: include_once() [<a href='function.include'>function.include</a>]: Failed opening 'Connections/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ibcsncom/public_html/admin/login.php on line 1

[08-Mar-2016 09:24:29 America/Sao_Paulo] PHP Warning: mysql_select_db() expects parameter 2 to be resource, null given in /home/ibcsncom/public_html/admin/login.php on line 58

[08-Mar-2016 09:24:29 America/Sao_Paulo] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'root'@'localhost' (using password: NO) in /home/ibcsncom/public_html/admin/login.php on line 11

[08-Mar-2016 09:24:29 America/Sao_Paulo] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /home/ibcsncom/public_html/admin/login.php on line 11

[08-Mar-2016 09:24:29 America/Sao_Paulo] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'root'@'localhost' (using password: NO) in /home/ibcsncom/public_html/admin/login.php on line 11

[08-Mar-2016 09:24:29 America/Sao_Paulo] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /home/ibcsncom/public_html/admin/login.php on line 11

[08-Mar-2016 09:24:29 America/Sao_Paulo] PHP Warning: mysql_query() expects parameter 2 to be resource, null given in /home/ibcsncom/public_html/admin/login.php on line 64

[08-Mar-2016 11:12:06 America/Sao_Paulo] PHP Warning: include_once(Connections/config.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in /home/ibcsncom/public_html/admin/login.php on line 1

[08-Mar-2016 11:12:06 America/Sao_Paulo] PHP Warning: include_once() [<a href='function.include'>function.include</a>]: Failed opening 'Connections/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ibcsncom/public_html/admin/login.php on line 1

[08-Mar-2016 11:12:09 America/Sao_Paulo] PHP Warning: include_once(Connections/config.php) [<a href='function.include-once'>function.include-once</a>]: failed to open stream: No such file or directory in /home/ibcsncom/public_html/admin/login.php on line 1

[08-Mar-2016 11:12:09 America/Sao_Paulo] PHP Warning: include_once() [<a href='function.include'>function.include</a>]: Failed opening 'Connections/config.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ibcsncom/public_html/admin/login.php on line 1

[08-Mar-2016 11:12:09 America/Sao_Paulo] PHP Warning: mysql_select_db() expects parameter 2 to be resource, null given in /home/ibcsncom/public_html/admin/login.php on line 58

[08-Mar-2016 11:12:09 America/Sao_Paulo] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'root'@'localhost' (using password: NO) in /home/ibcsncom/public_html/admin/login.php on line 11

[08-Mar-2016 11:12:09 America/Sao_Paulo] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /home/ibcsncom/public_html/admin/login.php on line 11

[08-Mar-2016 11:12:09 America/Sao_Paulo] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: Access denied for user 'root'@'localhost' (using password: NO) in /home/ibcsncom/public_html/admin/login.php on line 11

[08-Mar-2016 11:12:09 America/Sao_Paulo] PHP Warning: mysql_real_escape_string() [<a href='function.mysql-real-escape-string'>function.mysql-real-escape-string</a>]: A link to the server could not be established in /home/ibcsncom/public_html/admin/login.php on line 11

[08-Mar-2016 11:12:09 America/Sao_Paulo] PHP Warning: mysql_query() expects parameter 2 to be resource, null given in /home/ibcsncom/public_html/admin/login.php on line 64

 

 

 

Pode me ajudar , sou novo em programação...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Não seriam as barras?

Windows usa \ e Linux usa /

Se for o caso, ou você altera tudo para / ou então substitui as barras por DIRECTORY_SEPARATOR http://php.net/manual/en/dir.constants.php

Qualquer coisa posta um trecho de algum include_once do seu codigo

Compartilhar este post


Link para o post
Compartilhar em outros sites

"No such file or directory" = arquivo ou diretório não existem

 

Veja se Connections/config.php existe. Note que "Connections" é diferente de "connections" (case-sensitive)

 

os demais erros devem ser consequência do primeiro

Compartilhar este post


Link para o post
Compartilhar em outros sites

Segue a pagina login.php

 

 

close.jpg
application-x-httpd-php.png login.php
ASCII C++ program text
    <?php  include_once('Connections/config.php');   ?><?phpif (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") {  if (PHP_VERSION < 6) {    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;  }  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);  switch ($theType) {    case "text":      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";      break;        case "long":    case "int":      $theValue = ($theValue != "") ? intval($theValue) : "NULL";      break;    case "double":      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";      break;    case "date":      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";      break;    case "defined":      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;      break;  }  return $theValue;}}?><?php// *** Validate request to login to this site.if (!isset($_SESSION)) {  session_start();}$loginFormAction = $_SERVER['PHP_SELF'];if (isset($_GET['accesscheck'])) {  $_SESSION['PrevUrl'] = $_GET['accesscheck'];}if (isset($_POST['user'])) {  $loginUsername=$_POST['user'];     $pass=$_POST['senha'];      $password = sha1($pass);    $MM_fldUserAuthorization = "";  $MM_redirectLoginSuccess = "struct/StructSys.php";  $MM_redirectLoginFailed = "login_erro.php";  $MM_redirecttoReferrer = false;mysql_select_db($database_config, $config);  //   mysql_select_db($banco, $conexao);    $LoginRS__query=sprintf("SELECT userName, key_pass FROM usuarios WHERE userName=%s AND key_pass=%s AND status = 'ativo'",    GetSQLValueString($loginUsername, "text"), GetSQLValueString($password, "text"));     $LoginRS = mysql_query($LoginRS__query, $config) or die(mysql_error());  // $LoginRS = mysql_query($LoginRS__query, $conexao) or die(mysql_error());  $loginFoundUser = mysql_num_rows($LoginRS);  if ($loginFoundUser) {     $loginStrGroup = "";    	if (PHP_VERSION >= 5.1) {session_regenerate_id(true);} else {session_regenerate_id();}    //declare two session variables and assign them    $_SESSION['MM_Username'] = $loginUsername;    $_SESSION['MM_UserGroup'] = $loginStrGroup;	          if (isset($_SESSION['PrevUrl']) && false) {      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];	    }    header("Location: " . $MM_redirectLoginSuccess );  }  else {    header("Location: ". $MM_redirectLoginFailed );  }}?><!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>::Login:: </title><link rel="stylesheet"  href='css/screen.css' type="text/css" media="screen" title="default" /><!--  jquery core --><script src="js/jquery/jquery-1.4.1.min.js" type="text/javascript"></script><!-- Custom jquery scripts --><script src="js/jquery/custom_jquery.js" type="text/javascript"></script><!-- MUST BE THE LAST SCRIPT IN <HEAD></HEAD></HEAD> png fix --><script src="js/jquery/jquery.pngFix.pack.js" type="text/javascript"></script><script type="text/javascript">$(document).ready(function(){$(document).pngFix( );});</script></head><body id="login-bg">  <!-- Start: login-holder --><div id="login-holder">	<!-- start logo -->	<div id="logo-login">                            <a href=""><img src="logos/logo_Belem.png" width="100" height="auto" alt="" /></a>	</div>	<!-- end logo -->		<div class="clear"></div>		<!--  start loginbox ................................................................................. -->	<div id="loginbox">	 <form action="<?php echo $loginFormAction; ?>" enctype="multipart/form-data" name="login" method="POST">	<!--  start login-inner -->	<div id="login-inner">		<table border="0" cellpadding="0" cellspacing="0">		<tr>			<th>         Login</th>			<td><input type="text"  name="user" class="login-inp" required autofocus /></td>		</tr>		<tr>			<th>       Senha</th>			<td><input type="password"   name="senha"  onfocus="this.value=''" class="login-inp" /></td>		</tr>		<tr>			<th></th>			<td valign="top"> <br /><!--<input type="checkbox" class="checkbox-size" id="login-check" /><label for="login-check">Lembrar senha?</label> --></td>		</tr>		<tr>			<th></th>                        <td><input type="submit" name="logar" value="   Login   " class=""  />     <input type="reset" name="logar" value="  Limpar  " class=""  /></td>		</tr>		</table>	</div>           </form>     	<!--  end login-inner -->	<div class="clear"></div>	<a href="" class="forgot-pwd">Perdeu a Senha?</a>        <div class="clear"></div>        	<a href="CadUserForm.php" class="forgot-cadastro">Efetuar Cadastro</a> </div> <!--  end loginbox --> 	<!--  start forgotbox ................................................................................... -->	<div id="forgotbox">		<div id="forgotbox-text">Digite o seu endereço de e-mail válido para receber o sua senha.</div>		<!--  start forgot-inner -->		<div id="forgot-inner">		<table border="0" cellpadding="0" cellspacing="0">		<tr>			<th>@ E-mail:</th>			<td><input type="text" value=""   class="login-inp" /></td>		</tr>		<tr>			<th> </th>			<td><input type="button" value="   Enviar   "   /> <!-- class="<!-- submit-login --> </td>		</tr>		</table>		</div>		<!--  end forgot-inner -->		<div class="clear"></div>		<a href="" class="back-login">Voltar ao login</a>	</div>	<!--  end forgotbox -->    </div><!-- End: login-holder --></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Isso acontece pois para se conectar ao Database você precisa setar a senha do user root. Verifique no arquivo referente a conexão com o banco de dados.

Evite postar códigos gigantescos igual esse, poste apenas a parte do problema, não dá ser analista de código aqui no fórum

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.