I am working on a React web app with npm for the first time. I'm done with the development and now putting the built package on the web server (bluehost).
All is working well on my Mac: the web app allows getting data from mySQL via php, and posting back to the database.
But when I try the same app (on the same URL, same server, script, same everything...) on my Windows machine, I get an error on the first http request used for authentication.
OPTION http://example.com/script.php net::ERR_CONNECTION_REFUSED
First I thought this was a browser issue.
But I don't get the error on Chrome on my mac but do on Chrome on my Windows, as well as FireFox.
Again, I do not get this error when I test the app on my mac.
Could anybody please give me some direction to solve this?
Thank you!
Related
I have created a Cloud9 Environment on my Amazon Linux 2 EC2 Server used for a PHP development website, which also has Apache (httpd) installed for the live version of the website both currently use the exact same files and code.
On my Cloud9 Environment I am receiving an undefined index error when trying to access POST data from a form however on the live website the form works as expected with no errors and I can access the POST data from the form.
I'm unsure of what could be causing the issue, as far as I'm aware these environments will the same /etc/php.ini file configuration.
These are the versions installed on my EC2 server.
PHP 5.4.16
Apache 2.4.46
On the Cloud9 environment - I can see that the POST request was successful and that the POST variables have been returned in developer tools under the network tab, but I still receive the error on the page and cannot access the variables.
POST SUCCESSFUL
Is there any reason why the Cloud9 php web server environment would not allow these $_POST variables to be accessed?
Any help or suggestions are massively appreciated, I have been scratching my head at this for hours on end.
Also let me know if you would like me to post the code of the form, however it is just a basic form with one input field which obviously works on the live environment without any issues.
Cheers,
Joab
The issue was resolved by uninstalling PHP 5.4.16 and installing PHP 7.4
I am trying to get Dreamweaver preview to work for php applications in Windows 10. it has been a pain so far.
I have the server info of:
and yet I get the this error in DW preview:
I have xampp running and Apache and Mysql are both started and running with no problems, the file paths are correct, but I am not sure how to fix this myself. google searching didn't give me much either.
Did you try setting the port for HTTP traffic in the Web URL: http://localhost:8080
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.
I have written some custom webservices to communicate with Infusionsoft. I want to fetch the Custom Field from Infusionsoft on the basis of EmailId.
I have used following SDK to fulfill my requirements: https://github.com/infusionsoft/PHP-iSDK
The issue is that when I test my code in my local machine it runs fine. My local machine contains Windows 7 and wamp server.
But when I deploy it on my cloud server that is based on Ubuntu. it doesnt work. I have already installed apache server on ubuntu..
I have put some debug points in isdk.php file within some functions.. These are the logs from them on each machine:
Local Machine - Windows 7:
In Find By Email Method
***In method caller***
Response From Call: Array
Custom field from Infusionsoft: 20130803T07:46:03
Cloud Server - Ubuntu:
In Find By Email Method
***In method caller***
Response From Call: 0
It seems it gets connected successfully to Infusionsoft but it doesnt return output properly. I have used same request parameters on both.
What I am missing here?? Is it something to do with xmlrpc?? I have placed the xmlrpc directory on ubuntu as well.. but it didnt worked out...
Any quick response would be appreciated.
Thanks
Zunair
Since you did not provide your version of PHP I can only tell you to check your PHP versions and make sure the ubuntu server is at least 5.3.
Print out your response you get from infusionsoft, it should be in the form of an array object and you might have a different message. Perhaps a throttling issue. It looks like the response you are printing out is just some variables you are echoing.
The last thing I can think of to check is the location of the ubuntu machine. If I recall correctly infusionsoft has some groups of IPs blocked from accessing the API. I doubt this is your issue but it is a possibility.
Thanks guys for your response.. I got it working..
The first issue was that infusionsofts logs were not working for me... I did fixed them first and they showed me what was the actual reason..
They were using curl for sending the requests.. In my local machine curl was installed and in ubuntu I didnt have it with me... So, I installed it there.. and then it came back to life.. :)
I am running a virtual machine on my computer (debian 6.0.2.1) that runs an apache+php+mysql server. On my local machine I have a WAMP stack instaled. On both machines I have CodeIgniter deployed and running a RESTful API.
What I am trying to do is to communicate with my virtual machine from the local machine's application. The virtual machine's application accepts post & get methods for an end-point.
e.g. http:///thumbs/save/ it should return a message. If I test it in the browser for the get method, it runs fine. The problem is when I try to access it from the other application (local machine deploy) with a jquery post/get I get the following:
for chrome as usual: XMLHttpRequest cannot load http:///api/thumbs/save. Origin "http://localhost" is not allowed by Access-Control-Allow-Origin.
and firefox just throws a 200 with status OK but it shows up red and with no response.
A little help would be appreciated. Tell me if you need code examples.
Thanks.
The reason you are seeing that error, Access-Control-Allow-Origin, is to prevent a security issue known as XSS (Cross Site Scripting). Your one domain is localhost, and the other is API.
Take a look at this question/answer for some ways around it. No code examples, so not sure what methods/access types you are using: Access-Control-Allow-Origin error sending a jQuery Post to Google API's