ODBC linux PHP Syntax error?



I was wondering if someone could lend me a hand on the issue im having. We currently have an internal web for our users. The website was created by another person using PHP and that person we cannot reach them. The website was hosted using XAMPP on a windows server using ODBC to connect to a windows sql server for that database.

Currently I migrated the htdocs to a ubuntu Server 14.04 running NGINX with php5. I also installed FreeTDS and successfully connected to the sql server using ODBC. When i go to website the front page work, but when i put in the username and password i get a HTTP 500 error . After checking the error log on NGINX

  2017/11/14 17:50:09 [error] 7482#0: *42 FastCGI sent in stderr: "PHP message: PHP Parse error:  syntax error, unexpected '}' in /var/www/html/xampp/htdocs/index2.php on line 47" while reading response header from upstream, client:, server:, request: "POST /index2.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "", referrer: ""

after looking at a while the index2.php file is this


and after looking at it i saw a "require_once" which leads to the barras.php


Now the question is how come its giving a syntax error if the website was working before on XAMPP am i missing a php package?

These are the packages of php i installed

 apt-get install php5 php5-mysql php5-mcrypt php5-gd php5-fpm
apt-get install php5-odbc

Thank you

https://imgur.com/a/5CJQn----Working connect to ms sql
You have a syntax error in your index2.php file.

I don't look at external links, however, there is a closing } in your file on line 47 which does not have an opening one.

The errors were probably suppressed in the old set up, what you will need to do is figure out why the bracket is there and see if something is missing or if you can just delete it. Don't assume that you can just delete it though as there may be something else going on.

Feel free to post your code on here, if you can't find the problem, using the </> code button in the reply box; bear in mind that this is a help forum for people learning php.
Thanks for the reply the i changed a bit the index2.php which is this

if (isset($B1))
    if ($B1=="Entrar")
        $rs= odbc_exec($conexion,"select nombre,nivel,seccion,cargo from tblpersonal where usuario='$usuario' and clave='$clave'");
        if (odbc_fetch_row($rs))
            $_SESSION["nivel"] = $nivel;
            $_SESSION["usuario"] = $usuario;
            $_SESSION["nombre"] = $nombre;
            $_SESSION['seccion'] = $seccion;
            $_SESSION['cargof'] = $cargo;
            echo "<frameset framespacing=\"0\" border=\"1\" frameborder=\"1\" rows=\"90,*\">
               <frame name=\"superiord\" target=\"izquierdo\" src=\"menusup.htm\" scrolling=\"auto\" >
               <frameset framespacing=\"0\" border=\"1\" frameborder=\"1\" cols=\"220,*\">
                   <frame name=\"izquierdo\" scrolling=\"auto\" noresize target=\"principal\" src=\"inicial.htm\">
                   <frame name=\"principal\" src=\"titulo.htm\" marginwidth=\"1\" marginheight=\"1\" scrolling=\"auto\">
                       <p>Esta página usa marcos, pero su explorador no los admite.</p>
            echo "<body link=\"#FFFFFF\" alink=\"#FFFFFF\" text=\"#FFFFFF\" bgcolor=\"#003366\" style=\"font-family: Arial\">
           <p><center><h2>Clave Incorrecta</center></h2></p>
    echo "<body link=\"#FFFFFF\" alink=\"#FFFFFF\" text=\"#FFFFFF\" bgcolor=\"#003366\" style=\"font-family: Arial\">
   <p><center><h2>Debe realizar la Autenticación de Seguridad</center></h2></p>

that part is fixed but now im getting an issue with the ODBC connect :( this is the error

 2017/11/15 18:48:03 [error] 835#0: *54 FastCGI sent in stderr: "PHP message: PHP Warning:  odbc_connect(): SQL error: [unixODBC][FreeTDS][SQL Server]Unable to connect to data source, SQL state S1000 in SQLConnect in /var/www/html/xampp/htdocs/barras.php on line 9" while reading response header from upstream, client:, server:, request: "POST /index2.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "", referrer: ""

But not sure why, as these are my config of the odbc:

  # FileName="Connection_php_mysql.htm"
  # Type="MSSQL"
 # HTTP="true"
 $hostname_barras = "OPTIMUS1";
 $database_barras = "db";
 $username_barras = "intranet";
 $password_barras = "mypassword";
$connection = odbc_connect("MSSQL","intranet","mypassword");

 Description = FreeTDS driver
 CPTimeout = 5
 CPReuse = 5
  FileUsage = 1

Description = MS SQL Server
Servername =
Username = intranet
Password = mypassword
Database = db
 Port = 1433
Trace = No

Driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsS.so

Thank you again
Thanks for the reply, as the index2.php on the code it does a redirect to the barras.php which gets the info of the ODBC
on the NGINX server i point the root directory to the htdocs

Thank you
Thanks for the reply, when you mean database do you mean the odbc.ini? or the barras.php?
Ok, you are telling PHP to connect to your database here:
PHP is saying, it isn't there; either you haven't put the database on your system, or you have put is somewhere else that php is unaware of.
thanks for the reply, as the database is in Microsoft SQL in another server im using ODBC trying to connect it.