How to run PHP Desktop on LAN/WLAN

3,042 views
Skip to first unread message

Ephraim Tarfa

unread,
Jan 6, 2016, 12:05:04 PM1/6/16
to PHP Desktop
Good day. I appreciate the work you have done and the support you are there giving to those in need.

PHP Desktop is running fine on my local machine. I have a local network which I can access other apps from the server via IP Address either wireless or with network cable.

Please, I want to make my system be the server and let other computers on the same network with me access the software from my system (either by typing my computer's IP in a web browser on their system or, alternatively I want to use Inno Setup Compiler to package my app and install on clients computers but when they launch the exe, it should load the software from my system and display on their computer). How do I do that?

I tried changing my "settings.json" like this:
        "web_server": {
        "listen_on": ["10.10.24.58", 54007], - - - - -  Where 10.10.24.58 is my computer IP while 54007 I wanted it to be a random port so that it doesn't interfere with localhost 127.0.0.1
        "www_directory": "www",
        "index_files": ["index.html", "index.php"],
        "cgi_interpreter": "php/php-cgi.exe",
        "cgi_extensions": ["php"],
        "cgi_temp_dir": "",
        "404_handler": "/pretty-urls.php"
    },

Help me out please!!! Thanks in anticipation.

Czarek Tomczak

unread,
Jan 7, 2016, 2:36:31 AM1/7/16
to phpde...@googlegroups.com
Set listen_on to 127.0.0.1 and create index.php with code that
redirects to your public IP address (or domain) eg. header("Location:
211.244.10.184"); exit;
> --
> You received this message because you are subscribed to the Google Groups
> "PHP Desktop" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phpdesktop+...@googlegroups.com.
> Visit this group at https://groups.google.com/group/phpdesktop.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phpdesktop/4294a208-556a-4688-b8d3-8ef4beb0ddb5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

Ephraim Tarfa

unread,
Jan 7, 2016, 4:14:38 AM1/7/16
to PHP Desktop
Thanks for the prompt reply. I actually tried that and it worked for me. However I got an error especially almost on every first time launch but when I reload the page it takes me there anyways. I think the error sometimes it made mention of "firewalls" but sometimes doesn't on refresh and it goes through (don't know whether firewall is blocking first time connection between the client and the sever but allowing it work next immediate re-launch? Again could that be on the client system or firewalls on the server where PHP Desktop is?).

You know, I developed a browser before (without address bar) using VB.net and its only duty was to launch the app on the server using the server's IP embedded in the VB browser but, issues of error messages popping up (the usual Microsoft error: Send/Don't send error reports and stuffs like that), reporting Windows cannot display page sometimes but when you re-load, it goes through and some places where JavaScript is not there to hold some data for you, on refresh, your data wipes away and you need to re-enter/perform what you were doing before.
This is disgusting and tiring for clients who wants to use the app via the VB browser; AND THAT IS WHAT BROUGHT ME TO PHP DESKTOP: HOW CAN I DEAL WITH ISSUES OF NOT ABLE TO CONNECT TO THE REMOTE (SERVER) COMPUTER AT TIMES BUT OTHER TIMES IT GOES THROUGH.

Czarek Tomczak

unread,
Jan 7, 2016, 4:43:57 AM1/7/16
to phpde...@googlegroups.com
Try some javascript magic - set an interval that checks your web
server using XHR requests every few seconds, if it works then make the
redirect using location.href.

Make sure this is not an issue with your web server dropping connections.

By default Chromium uses IE proxy settings, try to disable it by
setting the "no-proxy-server" switch, see
https://code.google.com/p/phpdesktop/wiki/ChromeSettings .
>> > email to phpdesktop+...@googlegroups.com <javascript:>.
>> > Visit this group at https://groups.google.com/group/phpdesktop.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/phpdesktop/4294a208-556a-4688-b8d3-8ef4beb0ddb5%40googlegroups.com.
>>
>>
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PHP Desktop" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phpdesktop+...@googlegroups.com.
> Visit this group at https://groups.google.com/group/phpdesktop.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phpdesktop/34bf727d-e01c-421f-8d46-2f660125a195%40googlegroups.com.

Ephraim Tarfa

unread,
Jan 7, 2016, 5:38:56 AM1/7/16
to PHP Desktop
Thanks please, I will get back here after I try out your suggestions. I appreciate.

Ephraim Tarfa

unread,
Jan 11, 2016, 11:46:34 AM1/11/16
to PHP Desktop
URGENT PLEASE!!! I redirected an index.php in the PHP Desktop www folder to point to my app already resident on a server running apache (xampp). There are urgent 2 challenges I have that are making me almost give up:

(1) I can't develop javascript or whatever now to ensure steady connectivity between client computers that wants to launch the app and the server and so, almost EVERY FIRST LAUNCH THROWS AN ERROR like this: "Error while loading the start page. An internal local server was blocked by your firewall, please check your firewall settings. Application will terminate immediately". I have turned off the server firewall completely but is still complaining. I thought it may be firewall on my computer but when I moved same PHP Desktop files on another client, I saw thesame complaint on first launch... but subsequent launching does not report error. THIS IS WHAT I AM RUNNING AWAY FROM WEB BROWSER DEVELOPED BY VB.NET TO PHP DESKTOP!!!
(2) It defeats my project aim whenever I see PHP Desktop take me to the default system browser on click of any link in my app. For example, the first start up will throw error and when I re-launch it opens the first page inside PHP Desktop as is supposed to be, but my app usually asks me to sign in and on login, it takes me to the default browser on my system; similarly, any link I click opens in on a tab in the default browser. This means to me that apart from the first page, PHP Desktop isn't opening other pages of my app for me again! I though it was because my developing machine has Apache running and may interfere but when I copied PHP Desktop folder to another machine, it happened thesame.

THESE 2 THINGS ARE MY IMMEDIATE CHALLENGES USING PHP DESKTOP BUT HONESTLY, I LOVE THIS PROJECT AND WOULD BE GLAD TO USE IT. Help me out please if you possibly can!


On Thursday, January 7, 2016 at 8:36:31 AM UTC+1, Czarek Tomczak wrote:

Czarek Tomczak

unread,
Jan 11, 2016, 1:01:31 PM1/11/16
to phpde...@googlegroups.com
What version of phpdesktop are you using? Try all three IE, Chrome and
Chrome Release Candidate and see if there are any differences in
behavior.

In your index.php redirect to http://www.google.com/ or some other
website and see if it throws
the same error on first launch. Is this problem related only to your
web server or does it happen to all websites?

By default external links are opened inside php desktop chrome, see
the ChromeSettings wiki page:

external_navigation = true
Whether to allow navigation to exernal websites inside PHP Desktop
browser. When set to false external links will be opened in OS default
browser. This behavior applies in general to external navigation, so
this gets fired not only when clicking a link, but also when doing a
redirect (whether it is initiated from php or from javascript using
the window.location object).

https://code.google.com/p/phpdesktop/wiki/ChromeSettings
>> > email to phpdesktop+...@googlegroups.com <javascript:>.
>> > Visit this group at https://groups.google.com/group/phpdesktop.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/phpdesktop/4294a208-556a-4688-b8d3-8ef4beb0ddb5%40googlegroups.com.
>>
>>
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PHP Desktop" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phpdesktop+...@googlegroups.com.
> Visit this group at https://groups.google.com/group/phpdesktop.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phpdesktop/1bf6fbaf-eecc-4e9c-a741-6c4a5b079581%40googlegroups.com.

Ephraim Tarfa

unread,
Jan 11, 2016, 5:37:00 PM1/11/16
to PHP Desktop
Thanks for the reply. Find attached pictures of the app am developing.

I was using phpdesktop-chrome-31.8-php5.6.1 but have just changed to chrome-31.8-php-
5.4.33 and is working fine here on my developing machine. Since I have only one PC at home, I will test it on live server at office and try different clients to access it and see then get back to you.

However, I notice a (minor) challenge that I wish its possible to fix: I have noticed that, links to downloadable files like .docx, .pptx, .exe, .zip, etc when clicked, opens a Save File dialog for one to save instead of opening direct with the default program like MS Word opening a .docx file automatically (this is what clients are used to).

Anyways. Thanks so much for the support so far. Please take  look at the "dashboard" picture I sent, I wouldn't figure out a working code for the SAVE menu, either Php or JavaScript I'll appreciate.

Good night.
firstpage.jpg
dashboard.jpg

Czarek Tomczak

unread,
Jan 12, 2016, 6:04:18 AM1/12/16
to phpde...@googlegroups.com
You can open file in a default application by executing such php code:

system("start C:/full/path/to/document.docx")

Add some javascript code that makes an AJAX call to a php script eg.
using jQuery:

<a href="javascript:void(0)"
onclick="$.post('start.php?path=C:/full/path/to/document.docx');">document.docx</a>

Regarding menu - this is out of scope for this forum.
>> https://groups.google.com/d/msgid/phpdesktop/1bf6fbaf-eecc-4e9c-a741-6c4a5b079581%40googlegroups.com.
>>
>>
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PHP Desktop" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phpdesktop+...@googlegroups.com.
> Visit this group at https://groups.google.com/group/phpdesktop.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phpdesktop/9dacc270-d543-4515-b78a-ac27ef9285fe%40googlegroups.com.

Ephraim Tarfa

unread,
Jan 13, 2016, 3:39:38 AM1/13/16
to PHP Desktop
Thanks once again for the support.

Find attached pictures demonstrating the the client-server connectivity challenge I raised before. Like I said, any time I launch the software especially from a client computer, it throws an error for me. The second launch doesn't do that but, if you leave the software on, for like 10 minutes without doing anything, on resume, is like the client will loose connectivity to the server and throws another error as in my second picture here.

I engaged one of my Network Administrators who made mention of some networking terminologies like Address Resolution Protocol (ARP) and Transmission Control Protocol (TCP) asking me that if there can be a way at the Application level to write a code to extend connectivity time/optimize client-server TCT/IP settings, that can solve the issue. Now, I don't know any PHP/JavaScript/JQuery/AJAX code to do this. Can you support me on this too if you possibly can. Thanks as I wait you please.
first-time-launch.jpg
next-page-click-after-10-minutes.png

Ephraim Tarfa

unread,
Jan 13, 2016, 3:42:57 AM1/13/16
to PHP Desktop
Thanks once again for the support.

Find attached pictures demonstrating the the client-server connectivity challenge I raised before. Like I said, any time I launch the software especially from a client computer, it throws an error for me. The second launch doesn't do that but, if you leave the software on, for like 10 minutes without doing anything, on resume, is like the client will loose connectivity to the server and throws another error as in my second picture here.

I engaged one of my Network Administrators who made mention of some networking terminologies like Address Resolution Protocol (ARP) and Transmission Control Protocol (TCP) asking me that if there can be a way at the Application level to write a code to extend connectivity time/optimize client-server TCT/IP settings, that can solve the issue. Now, I don't know any PHP/JavaScript/JQuery/AJAX code to do this. Can you support me on this too if you possibly can. Thanks as I wait you please.



first-time-launch.jpg
next-page-click-after-10-minutes.png

Czarek Tomczak

unread,
Jan 13, 2016, 4:06:52 AM1/13/16
to phpde...@googlegroups.com
Check loading websites other than your web server.

On 1/13/16, Ephraim Tarfa <ephrai...@gmail.com> wrote:
> Thanks once again for the support.
>
> Find attached pictures demonstrating the the client-server connectivity
> challenge I raised before. Like I said, any time I launch the software
> especially from a client computer, it throws an error for me. The second
> launch doesn't do that but, if you leave the software on, for like 10
> minutes without doing anything, on resume, is like the client will loose
> connectivity to the server and throws another error as in my second picture
>
> here.
>
> I engaged one of my Network Administrators who made mention of some
> networking terminologies like Address Resolution Protocol (ARP) and
> Transmission Control Protocol (TCP) asking me that if there can be a way at
>
> the Application level to write a code to extend connectivity time/optimize
> client-server TCT/IP settings, that can solve the issue. Now, I don't know
> any PHP/JavaScript/JQuery/AJAX code to do this. Can you support me on this
> too if you possibly can. Thanks as I wait you please.
>
>
>
> On Tuesday, January 12, 2016 at 12:04:18 PM UTC+1, Czarek Tomczak wrote:
>>
>> You can open file in a default application by executing such php code:
>>
>> system("start C:/full/path/to/document.docx")
>>
>> Add some javascript code that makes an AJAX call to a php script eg.
>> using jQuery:
>>
>> <a href="javascript:void(0)"
>> onclick="$.post('start.php?path=C:/full/path/to/document.docx');">document.docx</a>
>>
>>
>>
>> Regarding menu - this is out of scope for this forum.
>>
>> https://groups.google.com/d/msgid/phpdesktop/9dacc270-d543-4515-b78a-ac27ef9285fe%40googlegroups.com.
>>
>>
>> > For more options, visit https://groups.google.com/d/optout.
>> >
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "PHP Desktop" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to phpdesktop+...@googlegroups.com.
> Visit this group at https://groups.google.com/group/phpdesktop.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/phpdesktop/020f3f03-0133-4e00-a08b-7ee0787b1d95%40googlegroups.com.

Ephraim Tarfa

unread,
Jan 13, 2016, 7:35:19 AM1/13/16
to PHP Desktop
Sorry, I don't quite understands your reply this time please. Can you be more elaborate? The issue here sir, is that I want to see how using PHP Desktop we can enhance client-server communication without the errors in PHP Desktop app on first time launch and same with errors erupting after about 2-5 minutes of inactivity after launching the PHP Desktop app. If this is a known challenge to you the developers of PHP Desktop and have found working solution to it, we beneficiaries would be glad to get the help from you. That is it sir. Thanks as I wait...
Message has been deleted

Czarek Tomczak.

unread,
Jan 26, 2016, 4:01:07 AM1/26/16
to PHP Desktop
Message has been deleted

harllyde...@gmail.com

unread,
Mar 14, 2017, 12:50:07 PM3/14/17
to PHP Desktop
Try this
"listen_on": ["*", 55532]

fahin...@gmail.com

unread,
May 29, 2017, 12:25:08 AM5/29/17
to PHP Desktop
Warning: mysqli_connect(): (HY000/2002): No connection could be made because the target machine actively refused it. in \\POWER8\SCHOOL\school_app\www\databasereg.php on line 11
Failed to connect to MySQL: No connection could be made because the target machine actively refused it.

i can't able to change the ip in "listen_on": ["127.0.0.1", 0],

please help me ...

thelearn...@gmail.com

unread,
Mar 20, 2018, 11:46:37 AM3/20/18
to PHP Desktop
Is it possible to use domain name instead of localhost or 127.0.0.1 and if yes how to do it in php desktop

Plz guide

hallr...@gmail.com

unread,
Dec 1, 2018, 7:11:09 AM12/1/18
to PHP Desktop
Try strating a mySql service. (from xampp ot any other)
Reply all
Reply to author
Forward
0 new messages