PDO Exception: The server requested authentication method unknown to the client - php

I have a running LARAVEL based website on a shared hosting (Business Plan) with Hostgator India. Ee decided to migrate it to a recently purchased dedicated server. The content transfer/migration was successful, however, when I try to LOGIN/REGISTER using the default laravel methods on the dedicated server I get following exception:
PDO Exception: The server requested authentication method unknown to the client
After, researching a lot on Google / StackOverflow I discovered that there could be a mismatch in the server mysql version. However, I am not able to understand how to get it fixed. I am currently using a PHP 5.5 (Also tried PHP 5.4 with no success). Downgrading it to PHP 5.3 would work, with its own sweet problems for "syntax errors" and requires quite a lot of the change in the code. The code works absolutely fine on the business plan and my local MAMP server. I am sure I am missing something very small here and would be really thankful if someone could point me in right direction.
Edit 1: MySql information on Server
Server type: MySQL
Server version: 5.5.37-cll - MySQL Community Server (GPL)

Related

joomla, php, windows server - Could not instantiate mail function

Moving an old Joomla 2.5.x install from an old win 2008 server to a win 2016 server. We will be upgrading to the latest version of joomla/php in the future, but for now I'm trying to get the current (old) version working. PHP is 5.4.10
I have the joomla site itself working. Although the contact form does not work. It throws the error 'Could not instantiate mail function' when you try to send.
Joomla is running under the same php install - i copied it from the old server. The joomla config is the same as well, except for updating hostname/paths etc where relevant. I've searched through all the files on the new server looking to see if anything was pointing to the mail server on the old machine - did not find anything. And i have confirmed the mail server on the new machine is working - sent an email to myself as well as telneted to port 25 to confirm it's accepting local connections. But I'm guessing from the error, it's failing before it even tried to connect to the mail server. And the file paths should be the same between the two servers as well.
At this point my guess would be there's some difference between IIS 7.x and IIS 10.x that's causing this, but that's just a guess. Hopefully someone else might have a more specific guess? ;)
thanks in advance for any help.
Ok, looks like the issue isn't with the mailer, it's with dns. It's not resolving anything.
$dnsrecs = dns_get_record('google.com'); returns dns query failed. However, dns on the server itself appears to be working. nslookup from the command prompt works. I even tried switching name servers to googles server - which also works from the command prompt but not from within php. Since this is an entirely different issue from the original topic, I'll mark this as answered and open a new question.

Issue with XAMPP and MySql

I am facing a problem pretty common, I have installed MySql Server because in the past I developed an CRUD app by using Java Swing and Maven, and now I am trying to create same thing, a CRUD app only this time with PHP.
I am following a tutorial from Udemy and this guy is using XAMPP to launch both an Apache Server and a MySQL. But somehow it's interfering with the one already installed on my laptop and cannot make the connection with XAMPP.
I opened my.ini and where says password i put my own from MySQL Workbench, and I see it's using the same port 3306 but still cannot work and I dont know why.
Is there any solution to modify my.ini and establish the connection without uninstalling the MySql Server installed before, because if I do that I ruin the other Java app using it.
Could you please provide the error logs? So the problem can be identified properly. By default, you can get the logs file for Apache in
\xampp\apache\logs\error.log
And for PHP here \xampp\php\logs

MAMP mssql_connect( ) returning login failed

I have been trying to access an MSSQL Database in a server inside my network, it seems to be able to find the database, but does not accept the authentication.
I get the following error:
"mssql_connect(): message: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication."
I have been trying to solve this for a few days now, with no success...
I tried adding the MAMP server into the hosts file in the windows machine, I know the account I am using works since I am able to access the database with those credentials while logging in through a Database Client (AquaData Studio) and of course while logging in locally via the SQL Server Management Studio.
I read that by default mssql_connect uses Windows Authentication (mssql.secure.connection Off in the php.ini) That is the authentication method I am using under the AquaData Studio client.
I have the freeTDS libary installed under the mssql as well...
Can anyone shed some light on this matter?
I believe it should be working since It finds the server, but fails on the authentication... Please help!
Dou you have Trusted_Connection=true in the connection string?

Fatal Error: "Class not registered" creating COM Object

I have an app that makes use of third party software using PHP(32 bit PHP) COM object, everything is working fine on my local machine (Windows 7, 64bit).
When I deployed my app to a live server (Windows Server 2012, 64bit) and I try to create my COM object I'm getting the
Fatal Error: Cannot create object "Class not registered"
After finding these other SO questions:
Class not registered error from PHP
Failed to create COM object 'X': Class not registered in another WAMP
I have ran regsvr32.exe (the 32bit version) for my DLL with message prompt indicating successful registry.
And also verified that the CLSID exists in all the proper places in the registry (registry entries are the same on both machines):
HKEY_CLASSES_ROOT\Wow6432Node\CLSID
HKEY_LOCAL_MACHINE\Software\Classes\Wow6432Node\CLSID
Does anyone know why I am still receiving this error? Is it due to Windows Server 2012 OS?
I'm not familiar with hosting php websites in windows but I know for IIS hosted websites I get this error for a myriad of reasons. Some of which you've mentioned above. When hosting in IIS I know there is a setting that needs to be set to True called "Enable 32 bit applications"
Also you want to make sure if you are transferring this file from another computer that the file is unblocked as this will cause a lot of headaches as well and strange errors.
Sometimes what I do as well is to write a simple test gui that calls this com dll to eliminate anything related to running it as a website. If you are able to access it with the gui application it could be something security related to running it as a website if the user the website is running under is different than the user launching the gui application.
Edit
Also try the article mentioned here:
http://www.gfi.com/blog/32bit-object-64bit-environment/
It seemed to have helped you judging by the comment below.

Connect to MySQL Database on cPanel Server Externally from Heroku?

I am using the Heroku app to host a facebook application since Facebook is changing how they have their applications set up, again. However I need to connect to the MySQL Externally from my cPanel VPS and I am not able to connect correctly. I have tried using the darkprospect.net(host domain), ultimate-battle-online.com (primary domain of user) and 184.154.20.170 as well as those plus the combination of added port 3306 and none have worked. I previously needed to make sure that I added the right domain to the right file but right now it's just not connecting. Right now get this error when using mysql_connect() function:
Lost connection to MySQL server at 'reading initial communication packet', system error: 110
Again, thank you for any ideas that you may have!
EDIT: I found out that it was an issue with the buildpack that is the default for PHP apps, since I develop on a VPS with PHP 5.4.7 I was using parameters that were tuned for it and were not very supportive on their bundle of vanilla PHP and Apache.
I was able to create a new Heroku buildpack that was able to support all of the features that my application was needing. Because I was developing on my VPS in PHP 5.4.7 my configurations were designed for more of the new features and with the Heroku's basic Buildpack only having PHP 5.3.10 there were unseen errors in background logs that were halting the connection process. Additionally CSF Firewall was configured only for UDP income 3306 and I was able to add it to UTP as well and that seemed to resolve the Connection Timed Out error that was the final error after I made a better buildpack for myself.

Categories