Something Server Specific Not Allowing Connect with Facebook - php

I had FB connect working perfectly fine on my site. Then one day, we noticed it was no longer working. It is not giving any errors, but when I try to do the getUser() function from my facebook class, the response to the send of my signed request is coming back empty, no user data. That is the basic problem, but let me detail what I have nailed down.
I believe there is a problem with the server somehow, either something inside httpd.conf or perhaps php.ini and here is why.
I took all my PHP pages that are required for the FB integration over to another server and another domain. They worked fine. That, to me, ruled out a problem with the code itself, or the Facebook App settings I am using.
I then went back to the problem server, and setup a 3rd domain and tried the same thing again. It would not work. So that, to me, ruled out a problem with the specific domain I am ultimately trying to get working again.
I will admit, I dont know what changes may have been made between the time it was working and when it suddenly was not. If I did, I had a solid idea, I would just roll it back. I did have someone, "recompile apache with mod_deflate and mod_cache." I tried to search for those causing a problem with FB but didnt find anything.
PHP Version 5.3.10
Server version: Apache/2.2.22 (Unix)
Server built: Feb 10 2012 20:31:21
Cpanel::Easy::Apache v3.9.1 rev9999
Thank you for reading my question.

I have resolved my situation. The key to my solution was going to line 633 of base_facebook.php and going an echo $e; to determine why the token response was failing. I then managed to identify the root of the problem:
CurlException: 1: Protocol https not supported or disabled in libcurlCurl
So I contacted my server support people who informed me, "The curl php module has been built without ssl support." which was after they had said
"I am almost positive that when I rebuild apache I made sure curlssl was checked. This is a typical option that people request to have enabled, so I always make sure it is enabled."
So the end solution was that they had to recompile apache and php with the curlssl module.

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.

Downloading file in Android browser data transfer failed

We've been searching for the cause of this issue for a few days now so maybe somebody has some insight.
We're using php to force a download of files (in this case mp3) from the server into PC browsers and Android devices. The code works fine on PC. On ALL Android devices we've tested, the GET request will trigger the download manager to attempt to get the file, but Android won't respect the attached filename, instead showing the name of the script, and the file download will ultimately fail with the following message:
Download Failed - Data connection failed
Attempting to download the file from a test site running on my computer with the EXACT same code works correctly.
I created a brand new server yesterday with the exact same operating system (CentOS) and version of PHP (5.5.16), dropped my php script onto that box and attempted again from my Android device and it WORKED perfectly. Again, EXACT same php code.
All signs are pointing to the answer being a server (mis)configuration problem. I didn't set up this server, nor do I have root access, so my testing options have been limited to trying to get my sandbox servers to "break" and start reproducing the same behavior.
I'd include PHP code, but I have 2 separate environments where the code works fine. If I run dev tools in my desktop browser against the working and non-working environments and compare responses, they are identical from what I can tell. The headers are identical and the payload is the exact same size. Something is causing Android to not like the response from one server, and like the response from the other.
Some insight, or at least a place to start would be helpful. The only two things that are different between my environments are:
Working sandbox environment is responding with HTTP 1.0 and the SSL
cert is from Rapid SSL. The sandbox environment will work with or without SSL turned on.
Non-working staging/production environments are responding with HTTP
1.1 and the SSL cert is a wildcard cert from COMODO.
I wish I could be more helpful but I've exhausted the usual, obvious questions that responders would ask on here. If you need more info, or want to see phpinfo dumps, I can provide.
Thanks in advance for any assistance.
EDIT - The Android request are showing in the access logs and there are no errors. From a server log perspective, everything looks perfect.

localhost doesn't work

I'm trying to solve out my problem since more than a week, but with no results until now.
When I try to open localhost/phpmyadmin, or any php file, I get on this message:
Internet Explorer cannot display the webpage ".
The same happens with Mozilla; no errors, but the page keeps loading without answer.
My configuration
Windows 7 32bit
Wampserver 2.2D ( all services are running ) green status, server online
My hosts file
127.0.0.1 localhost
::1 localhost
IIS is stopped, but I don't think it's a problem with port 80.
I tried going directly to 127.0.0.1, it didn't work.
I will appreciate any advice.
Thanks
You may want to check your firewall authorizations...
I had same problem; I have since added wampserver as authorized program to my firewall and, as above, stopped IIS services in control panel/admistrative tools.
I had similar problem, a lot of research and analysis but nothing helped. Finally I came across UwAmp which works like a charm for me ever since then. Try it out:
http://www.uwamp.com/
It also supports multiple versions of PHP which you can switch by single click anytime you want.
Ok so if you have IIS on, stop it.
Go to cpanel and search administrative tools, component services, services (local), and scroll to the w's to find and stop:
World wide web publishing service
and
Web deployment agent service (something like that)
Good luck.

how to setup php code to use ssl with https connection

I'm working on my first web site that requires SSL, it's hosted on a PCI Compliant server, SSL is setup correctly (or so I've been told).
I was hoping that I could just change a particular link in my code to go to a page, such as https://mydomain.com/login.php, but alas, it doesn't work. It doesn't even say that a SSL cert is present.
After some reading I'm thinking I must use curl to correctly work with HTTPS correct? If this is the case, are there any good 'still valid' tutorials on this topic?
Also, my hosting company said I was using php modules(I'm assuming he's referring to functions) that aren't compatible with their systems, they must work with 5.3.x...well I went through an entire page of code they claimed wasn't compatible, and every single function was in the php 5.3.x supported functions list (http://php.net/quickref.php).
Any insight into what they mean here? This stuff shouldn't seem like rocket science, but I'm coming up short on figuring it out correctly, and implementing http with SSL.
Thanks!
I've never heard of this. If mydomain.com/login.php is working but https://mydomain.com/login.php is not then it is not setup. Also you might want to see if https://www.mydomain.com/login.php works. It depends on what was setup as the fully qualified domain name in the certificate and key.
Usually servers have a default self signed certificate and it will give you a warning in browsers when trying to go to https. Is that what you are getting?? Or a different error?
Hope this gives you some direction...If it isn't setup you can go to the CA for directions on install directions.

Bizarre timeout in Web CMS, ideas?

I know this kind of thing cannot be adequately answered without a link to the live example. Unfortunately, I can't set one up right now as it's a back-end login and creating a safe public login would be too much to do at this point. Sorry. I'm hoping for ideas and input from people who may have experienced something similar in the past.
I am setting up a CMS for a client with a DSL connection in Spain.
The CMS is hosted on a straightforward standard, LAMP based, shared hosting package in a network center in Germany.
It comes with a .com domain.
When my client tries to log in to the CMS using Internet Explorer 7, everything works fine.
When she tries to log in using Firefox, she gets to the login form, submits it - and then the connection times out.
When she logs in using Firefox but using "domain.com" instead of "www.domain.com", everything works fine.
This happens on all computers that are hooked up to that line. One Windows XP, one Windows Vista.
The front-end part of the site, as well as a second, older CMS, work fine in all browsers.
I do not have access to the raw access logs.
I have not been able to reproduce this behaviour on any other connection.
Debugging ideas are welcome. Remote diagnosis is extremely difficult as the line is too slow to set up a proper remote connection.
If you are limited by how you can troubleshoot this, have the client install Fiddler - Web debugging proxy and then run the trace, and send you the logs, Fiddler will analyze the traffic (be it proxy or DNS timeout, etc)
Take a look if you have not used it before:
http://www.fiddler2.com/Fiddler2/version.asp
Check that Firefox and IE are using the same proxy settings.
DNS issues? can you put here your A records to check is everything is ok?

Categories