1

I have theses errors in php v7.2.12 in Centos 7.

Before that my website are running on

OS FreeBSD 10.1, Apache 5.4.23 , PHP 5.4.23, TDS 0.64 and I try to migrate my webiste to

Centos7, Apache 5.4.16, PHP 7.2.12, TDS 0.95.81 and after I install everything needed and try to run, these error show on my screen.

How can I resolve following errors?

Warning: Use of undefined constant SYBASE - assumed 'SYBASE' (this will throw an Error in a future version of PHP) in /var/www/html/lib/dbHead.php on line 37

Fatal error: Uncaught Error: Call to undefined function sybase_connect() in /var/www/html/lib/dbHead.php:40 Stack trace: #0 /var/www/html/auth.php(38): getSybaseConnection('friana', 'fjgzvlpbgg', 'DEMO_3', '', false) #1 {main} thrown in /var/www/html/lib/dbHead.php on line 40

Please help. Thank you very much!

Community
  • 1
  • 1
Noyti
  • 121
  • 2
  • 11
  • have you looked into this https://stackoverflow.com/questions/41890610/php7-connect-to-sybase-database – rohit thomas Nov 19 '18 at 03:39
  • @rohitthomas Thanks for the response. I Already change my code and try to run again. and my screen show this error Error!: could not find driver – Noyti Nov 19 '18 at 05:20
  • What command did you run for which you got the error ?? – rohit thomas Nov 19 '18 at 05:31
  • query('SELECT * from caregiver_code_view') as $row) { print_r($row); } $dbh = null; } catch (PDOException $e) { print "Error!: " . $e->getMessage() . "
    "; die(); } ?> And I already install this driver php72u-pdo-7.2.12
    – Noyti Nov 19 '18 at 05:41
  • did you add php7.0-sybase package? – rohit thomas Nov 19 '18 at 05:48
  • What do you mean to add? as I mention early I already install the Php72u-pdo-7.2.12 which is the compatible package for php7.2.12. Thanks @rohitthomas – Noyti Nov 19 '18 at 06:00
  • give this a try `Driver issue` related https://stackoverflow.com/questions/31813574/pdo-returning-error-could-not-find-driver-with-a-known-working-dsn – rohit thomas Nov 19 '18 at 06:47
  • Good Day @rohitthomas, I figureout what drivers could not find which is the sybase itself. So, I change my code to ` $dbh = new PDO('dblib:host=192.**.***.***;dbname=""', $user, $pass); ` then after I run the next error occurred **Error!: SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does not exist (severity 9)**. As of now I am searching for the solution to figure out what's cause of this error. Thanks Rohit I really apprecaite you. – Noyti Nov 20 '18 at 03:11

0 Answers0