ZK Time and Attendance device with PHP - php

I am using [ZKlib][1]
[1]: https://github.com/dnaextrim/php_zklib to connect to my ZK time and attendance machine. It is using UDP/SOAP to connect to device. Everything is working fine on localhost. But when I live it on server and try to access it though my public static ip that I have purchased from my ISP, even though I have port forwarded it, it cannot connect to the device. I have no issues in connecting to my IP cam through same router.
Another interesting fact is that if I make 3g Hotspot from my cellphone and connect my laptop to it. Now when I put public static IP of my router from which device is connected, and try to hit the device, Wow! Device is connected. But same application when I live it on server, even though I am on my 3g connection it could not connect to my device though my router that is port forwarded. I am wondering what is the issue with it when I live it.

I resolved it. It was issue with my host server. I had to talk to them to enable php_socket.dll extension on their server. Now it's running fine.

Related

Localhost and Android Connection

Let's say I'm developing application on my laptop. I have connection to the localhost, and created database. Will I be able to store, or extract data when I run my application on my phone? The phone is not connected to the laptop.
Yes:
Your phone and laptop connected to same LAN (minimal example: set your phone as router with mobile hotspot and connect your development laptop to it).
In other words simply connect the phone and PC running the server to the same local network.
if you have puplic ip you can even let others test your app and connect to your pc as server (preferred static but dynamic will work as well but you have to monitor it and change it in your app every time it changes but most of the time it stays for hours if its not a moving mobile).
Edit:
For php apps you can install a php server in your android phone like Palapa Web Server (tested) and then in your app just make your calls to local address.

Unable to connect to xampp server from android device

I am using BrainTree Payment service in my android app.For server ,I am using php and XAMPP. Now when I use emulator and access server with "http://10.0.2.2:80".
IP address, everything works fine but if I put my laptop's IP address(where server is running),it does't work on android device and emulator.
I am getting :
"Connection Timeout Error"
Thank You !It turned out to be McAfee was blocking the connection request..SO after disabling McAfee,it worked!
(1) make sure both your android device and your laptop are on the exact same wireless network. This has to be the same router so I would avoid testing in a public area where there may be many routers serving a network.
(2) sometimes your firewall a might be blocking incoming connections, temporarily disable it.
(3) double check you're connecting to the correct IP address in your code. CMD -> ipconfig, then it's ipv4
Make sure you are using the ipv4 that you see when you type ipconfig into command prompt.
Try to disable Windows Defender, change Apache's require all granted config among others and try disabling the Windows firewall.

connect to mysql using php vpn

I have a php script that accesses a mysql database. It lives on a server that has been migrated to aws (amazon web services). This server hosts a website that used to live on a physical server part of a private network.
The databases are still on that private network. I need to connect to a mysql database that is on a server with no public ip address. There is a vpn set up for this network.
I would like to ssh or vpn to the network from the aws server.
This is just to query something once a day.
I tried exec('ssh -f -L 3307:PrivateMYSQLServer:3306 USER#VPNADDRESS') but could not get it to work.
Is there a one liner that I can insert into the php script?
thanks
You’ll have to set up the server in which your script runs to connect back to your network via your VPN client.
Alternatively, you can set up a site to site VPN between your data center and AWS.
If you have a correctly configured site-to-site VPN (and routing tables, security groups, etc.), one end in your VPC and the other end in your private on premises network, then you don't need to create an SSH tunnel. Just connect to your database and run the query.

Apple Push Certificate doesn't work on specific server

I have an iOS app that's beta released since yesterday, but since today the push messages that were send via the Apple production server didn't seem to arrive to the users' phones. I recreated the certificate in the Apple Developer Center, tested it on my local server and verified that the new certificate was working.
Then I deployed the new certificate to my live server, but I keep getting this error message:
stream_socket_client(): unable to connect to ssl://gateway.push.apple.com:2195 (Connection refused)
I've made sure that I really uploaded the new certificate, but even resetting my live server wasn't helping.
I uploaded my project to another live server (a Google Cloud Instance) to verify if the certificate was only working on my local server or if it was just my live server that isn't working properly and the Google live server did deliver the push messages to the devices without an error message.
So it seems my default live server is the only server from where production push messages are not working. The pushes that are sent with the development certificate are delivered from every server successfully by the way.
Why could it be that I can't send push messages from that one specific server? Does anybody have any idea?
You have to check if Push Notification can be send from your server or not. That means the port 2195 should be opened in your server to do the same. Due to technical/ security reasons most of the hosting company blocking the port, you can ask them to open it if they can.
You can confirm whether this is opened or not in your server definitively by using telnet and specifying which port to connect to. From the command line run:
MyServer:~ Home$ telnet gateway.sandbox.push.apple.com 2195
Trying 17.149.34.143...
Connected to gateway.sandbox.push-apple.com.akadns.net.
Escape character is '^]'.
If there is an error connecting then it will just hang and not return - the above shows a working example where I can connect.
You'll need an SSH login to your hosting service to test it this way, and unfortunately you are unlikely to be able to test it on shared hosting without buying an account for VPS hosting- so you probably have to rely on asking their customer services.
Note: However shared hosting from Hostgator, dreamhost is working, you can chat with their support team before purchasing.

Which ip i should put on the url of my php request?

I am developing an application which basically starts with registration system using the wampserver to connect to mysql database through localhost/phpmyadmin as a back-end and android client using genymotion emulator as a front-end and both front and back end communicates through php/mysql API.
I have followed different tutorials to achieve all this but since none of them actually used genymotion I am missing the part of which IP, I should put for this mechanism to follow smoothly.
when you use emulator on you pc , your emulator will connect to virtual network interface that you can change it ....
you should check emulator network interface and enter your pc ip in that network interface ...
i attached a picture of setting of my emulator and you can see my emulator use my wifi network interface .... thus i should insert my computer ip address of wifi network interface
finally you should get your pc ip as network interface that your emulator connected to that and use that ip in emulator for connect to your webserver in your pc.....
in Wampserver, you can not access to apache from outside ...
you should change apache config (httpd.conf) and make access for outside connection ...

Categories