I am trying to convert my existing website into PHP Desktop Application using PHP Desktop, everything is working fine but when i am trying to login i am using ajax call for login it does not responding. it does not even print any error message on php desktop console.
It might be that your ajax code is making a request to http://127.0.0.1/some_resource, but phpdesktop web server is running at http://127.0.0.1:1673/ - as you can see in your console logs. PHP Desktop assigns a random web port to avoid conflicts with existing software. In a php script you can know the port by checking $_SERVER variable. If you want to set a fixed web server port then you can do so by editing settings.json file (see the Settings wiki page in phpdesktop project).
You have to check your ajax code to know what url it is trying to access, you can do this using Developer Tools window, you can open it in phpdesktop using mouse context menu.
You don't really have to set fixed web port if you can modify your ajax code to not use full paths with domain names and just the path like "/some_resource".
Related
I'm new to working with real web servers
I developed my Cordova app and used PHP files using XAMPP to provide web servers
but now I want to publish the app and I have a fully functional web server
how can I access the PHP files (I already put in this web service) using the POST method (found in my index.js file in my Cordova app)?
I tried changing the URL in the ajax post request
from http://localhost/config.php for example
to http://IP_OF_WEB_SERVER/config.php
but it's giving a connection timeout
how can I get this to work?
Am I missing something?
The question isn't very clear. You can't access your webserver from cordova, or you want to load a php file inside cordova?
The apache cordova doesn't support the usage of php, and another thing is that you can't use the localhost directly. You can use the inappbrowser plugin or ajax to fetch your contents from a remote web server.
In the first case with the plugin, you only need to specify the web address of your webserver that host your app .php files. With ajax instead you need to set some rule of the default content security policy that is shipped when a cordova app is build.
Scenario: PHP/mySQL web project hosted on remote server with FTP access
IDE: Atom
Problem: I want to be able to use live reload so that edits are instantly viewed in browser. This cannot be done since remote MySQL server is only accessible within domain - thus PDO/PHP cannot access data and web page cannot be created.
jscript and CSS can be edited live with Chrome debugger tools but requires copy/paste to upload changes with FTP.
Is there a solution to this scenario?
I'm working on a raspberry pi project where i've set up a media centre with an apache web-interface over my LAN. I've recently installed the deluge-web browser GUI for managing torrents which runs over a different port.
I'm forwarding port 80 so that I can access the media center interface when i'm away from home for management, but would like to get it set up so i can access the deluge-web ui without having to forward its port, so that i can implement a stricter security control using mysql or php with apache.
So what i'm trying to do is set up a frame which is loading the deluge-web ui on the server-side, visible and accessible by the browser.
I'm running apache 2.2.22, php 5.4.39, raspian (debian 7.8).
Is that it all possible?
No. A frame is a client side technology. It can't do anything about permissions or creating network paths to internal servers.
If you want to make a service accessible with added authentication, then you'll need to look at using something like an SSH tunnel or HTTP proxy instead.
If I understand right, what youre looking for is curl. Check Curl Documentation on PHP Site. Basically, it can download any url (page/file/whatever) and then you can use it in your php script, possibly dumping it into an iframe or div.
I'm using Zend debugger and PDT for PHP development and have run into an issue debugging Facebook PHP. I'm using the example.php in the SDK to test. The application runs fine from Facebook, but I'm having trouble setting breakpoints. I have tried:
Run from Eclipse - Application does not run as expected. I'm getting null values for $_SERVER['HTTP_HOST'] and $_SERVER['REQUEST_URI'] although I can set breakpoints and debug.
Run from Facebook - the application runs as expected, but ignores breakpoints.
I'm using DynDNS for my DNS lookup and have changed my host file to redirect the URL to my local host.
I'm not even sure if #1 is possible, but it would be nice to use Eclipse and not have to refresh a web page as in #2. Any ideas?
Try defining a local domain for your local server in the hosts file of your OS (in Windows you can find it in C:\Windows\System32\drivers\etc).
For example, if your server runs on localhost, add the row:
local.mydomain.com 127.0.0.1
On the Facebook developers site (in your application settings), set the domain of the application to mydomain.com of local.mydomain.com and for the canvas URL (if you work within facebook canvas) set the local URL of your application.
For example:
Canvas URL: http://local.mydomain.com/my_application/index.php
Last, change the Debug URL of the specific page (in Eclipse's menu Run* → Debug Configuration) to the URL of the canvas (for example, http://apps.facebook.com/my_fb_app/).
I have a web application that uses both localstorage but also server side SQL storage. When I test my APK file using Eclipse only the html pages with localstorage work and not the server stuff in the PHP files. How can I direct my PHP files to go to a server since all the APK does it package everything on the client side?
Thanks
You can run PHP on Android. Try SL4A. Web servers can exist on a mobile. There are quite a few that function as a local server, within Android apps.
You can't run php files on mobile except on the browser
So if you want to run PHP files put them on the server and invoke them to return or accept data from you
To run PHP files you need a web server which doesn't exist on a mobile
I believe that you asked this because you could run javascript & HTML files on the mobile
I will recommend two things
1- If you need to run PHP make ana AJAX request on it and keep it on the server and remember the cross-domain
2- you need to consider the performance of the app you are making because after personal experience its slow
One More thing it works on the chrome because you have a web server (APACHE) on your machine